Foundations
Complexity & Big-ODescribe the approach first, analyze it after coding, and distinguish auxiliary memory from the input and output.Core
Complexity & Big-O
Why am I learning this?
Describe the approach first, analyze it after coding, and distinguish auxiliary memory from the input and output.
Prerequisites
Start here - no required prerequisite.
Learn
- O(1), O(log n), O(n), O(n log n), and O(n²)
- Recursive call stacks
- Auxiliary versus total memory
- Intuitive amortized analysis
Recognize It When…
- A proposed solution repeats work or scans the same data many times.
- The interviewer asks whether the approach scales or can use less memory.
Analyze complexity after describing the approach and again after coding; the implementation may change the real cost.
Practice
No problems in this topic match the active plan and filters. The full topic remains available when filters are reset.
Mastery Check
- Given ordinary interview code, explain its time and auxiliary space complexity without guessing.
- Count nested work accurately instead of assuming every nested loop is O(n²).
- Include recursion depth and state the dominant term clearly.
Arrays & StringsTurn repeated scans into indexed lookups, counts, or one deliberate traversal while staying precise about mutation.Core
Arrays & Strings
Why am I learning this?
Turn repeated scans into indexed lookups, counts, or one deliberate traversal while staying precise about mutation.
Prerequisites
Start here - no required prerequisite.
Learn
- Indexing and traversal
- In-place mutation
- Frequency counting
- Auxiliary arrays or maps
- Sorting as preprocessing
Recognize It When…
- Pair or combination lookup
- Duplicates or frequencies
- Contiguous data
- Rearranging elements
- Comparing character counts
Core Problems
5Not StartedTwo SumHash map lookupEasyCore
Turns a quadratic pair search into one deliberate lookup pass.
Interview follow-ups
- What changes if the input is sorted?
- What would you precompute for many repeated queries?
Staged hints
Spend focused time first. Use the smallest hint that gets you moving, then finish the solution yourself.
- Hint 1For each value, what partner would complete the target?
- Hint 2Store information that lets you test for that partner in O(1) average time.
- Hint 3Scan once: check for the complement before recording the current index.
Not StartedContains DuplicateSet membershipEasyCore
Builds the fastest recognition reflex for repeated membership checks.
Not StartedValid AnagramFrequency countingEasyCore
Teaches counts as a compact representation of unordered character data.
Not StartedFind Pivot IndexLeft/right aggregatesEasyCore
Connects total-sum reasoning to prefix-style scans without extra arrays.
Practice Problems
2Not StartedIsomorphic StringsBidirectional mappingEasyPractice
Tests whether one-way mapping logic misses collisions.
Mastery Check
- Recognize when repeated lookup suggests a map or set.
- Explain the O(n) alternative to an O(n²) brute force.
- Handle duplicates, missing values, empty input, and mutation constraints.
Hash Maps & SetsUse maps for associated state and sets for membership - not as automatic answers to every array problem.Core
Hash Maps & Sets
Why am I learning this?
Fast membership and frequency lookup appear inside many interview patterns.
Prerequisites
Learn
- Membership versus key/value state
- Frequency maps
- Canonical keys
- Average-case lookup
- Space trade-offs
Recognize It When…
- Repeated membership checks
- Counting or grouping
- Need to remember prior values
- Need a canonical representation
Core Problems
5Not StartedTwo SumHash map lookupEasyCore
Turns a quadratic pair search into one deliberate lookup pass.
Interview follow-ups
- What changes if the input is sorted?
- What would you precompute for many repeated queries?
Staged hints
Spend focused time first. Use the smallest hint that gets you moving, then finish the solution yourself.
- Hint 1For each value, what partner would complete the target?
- Hint 2Store information that lets you test for that partner in O(1) average time.
- Hint 3Scan once: check for the complement before recording the current index.
Not StartedContains DuplicateSet membershipEasyCore
Builds the fastest recognition reflex for repeated membership checks.
Not StartedValid AnagramFrequency countingEasyCore
Teaches counts as a compact representation of unordered character data.
Not StartedGroup AnagramsCanonical hash keysMediumCore
Teaches how to design a stable key for equivalence classes.
Not StartedTop K Frequent ElementsFrequency map + Top KMediumCore
Composes counting with candidate selection and supports multiple valid strategies.
Interview follow-ups
- When would you choose a heap over frequency buckets?
- How does the complexity change when K is close to n?
Practice Problems
1Mastery Check
- Choose map versus set deliberately.
- Design a key that preserves the required equivalence.
- Explain average O(1) lookup and the added O(n) space.
Sign in to persist problem state across this roadmap and the question library.