Placements roadmap

DSA foundations

Complexity, arrays, searching, sorting and hashing: the tools behind most first-round questions. 5 topics, about 26 hours.

  1. Complexity and recursion

    About 4 h.

    • Give the time and space cost of a loop nest or a recursive function
    • Turn a brute-force idea into an O(n log n) or O(n) one and say what changed
  2. Arrays, binary search and two pointers

    About 8 h.

    • Write binary search without off-by-one bugs, including lower and upper bound
    • Use two pointers and a sliding window to replace a nested loop

    Visualisers: Searching

  3. Sorting

    About 5 h.

    • Write merge sort and quick sort from memory and state their costs
    • Say when counting sort beats comparison sorts
    • Use sorting as the first step of a harder problem

    Visualisers: Sorting

  4. Hash maps and sets

    About 4 h.

    • Use a hash map for counting, grouping and two-sum style lookups
    • Explain collisions and why lookups are O(1) on average but not in the worst case

    Visualisers: Hashing & indexing

  5. Strings

    About 5 h.

    • Solve anagram, palindrome and substring questions with counts and windows
    • Know what string concatenation costs in your language