All roadmaps
DSAEasy → Medium

Python DSA — Intermediate

Step up to real interview problems. Arrays get trickier, you meet hash maps properly, and you start working with linked lists. Each problem introduces one new idea.

20 problems~8h
1
Two Sumeasydsa

Hash map for O(n) complement lookup — the most common interview problem. Every intermediate path starts here.

2
Contains Duplicateeasydsa

Set for O(1) seen-check — upgrade from the basic array scan you did in beginner.

3
Valid Anagrameasydsa

Counter comparison — upgrade from is-anagram-basic. Now use Python Counter and sort comparison both ways.

4
Valid Palindromeeasydsa

Two pointers from both ends — your first proper two-pointer problem. Clean and transferable to arrays.

5
Missing Numbereasydsa

XOR trick vs sum formula — two approaches. Learn XOR as an alternative O(1) space technique.

6
Single Numbereasydsa

XOR all elements — any number XORed with itself cancels. Elegant O(n) time, O(1) space.

7
Majority Elementeasydsa

Boyer-Moore voting algorithm — a single-pass counter trick. First algorithm that feels like a real insight.

8
Move Zeroeseasydsa

In-place two-pointer write — slow pointer tracks the next write position. Core in-place array pattern.

9
Squares of a Sorted Arrayeasydsa

Two pointers from both ends filling result from back — applying two pointers to a new shape of problem.

10
Best Time to Buy and Sell Stockeasydsa

Track running min + compute max profit in one pass — Kadane's intuition applied to finance problems.

11
Valid Parentheseseasydsa

Stack for bracket matching — your introduction to stack data structure. Push open, pop and verify on close.

12
Reverse a Linked Listeasydsa

Three-pointer node reversal (prev, curr, next) — the most fundamental linked list operation.

13
Linked List Cycleeasydsa

Floyd's slow/fast pointer — if they meet, there's a cycle. Your first pointer-chasing algorithm.

14
Middle of the Linked Listeasydsa

Slow/fast pointer to find midpoint in one pass — the same Floyd trick applied to a different goal.

15
Remove Linked List Elementseasydsa

Dummy head node pattern — simplifies edge cases when the head itself might be removed.

16
Merge Two Sorted Listseasydsa

Merge two chains with a dummy head — builds toward merge sort and merge-k-sorted-lists.

17
Find Pivot Indexeasydsa

Prefix sum from left + total sum minus prefix from right — prefix sums applied to balance problems.

18
Max Consecutive Oneseasydsa

Sliding counter reset on zero — clean warm-up for the harder Max Consecutive Ones III with a budget.

19
Product of Array Except Selfmediumdsa

Prefix and suffix product arrays — no division allowed. Elegant two-pass O(n) with O(1) extra space.

20
Group Anagramsmediumdsa

Sorted string as hash map key — grouping by a derived key. A pattern you will see in many bucket problems.