Skip to content

Topic order

~8 min

In short

  • Work through the topics in this order. Each one builds on the ones before it.
  • For each topic, the table says what you should be able to do and two practice counts: a first pass to cover the topic, and a depth target to get fast and reliable. The counts are the author's guidance. No company publishes one.
  • The honest goal for top companies is volume with review: 1,000 or more problems solved over time, not 100.
  • Free places to practise are listed in free resources.

The order

Order Topic What you should be able to do Practice problems (author guidance) Depth target (author guidance)
1 Arrays and strings Index, slice and update arrays and strings; use prefix sums; reason about O(n) vs O(n^2) 15-20 60+
2 Hashing Use a hash map or set to count, group and look up in O(1) average time; explain the worst case 8-10 40+
3 Two pointers and sliding window Shrink or grow a window over an array or string; move two indices from both ends 10-12 40+
4 Stack and queue Use a stack for matching and "next greater"; use a queue for ordered processing 8 30+
5 Linked list Reverse a list; detect a cycle; use a dummy head; handle the empty and one-node cases 8 25+
6 Recursion and backtracking Write a recursive function with a base case; prune a search; generate subsets and permutations 12 50+
7 Binary search Search a sorted array; binary search on the answer; get the boundaries right 8-10 40+
8 Sorting Sort with a custom key; use sorting to simplify a problem; know the cost of your sort 5 20+
9 Trees and BST Traverse in three orders and by level; compute depth and paths; use BST properties 15 80+
10 Heaps Use a heap for top-k and merging sorted streams; know push and pop cost 6 30+
11 Graphs: BFS and DFS Represent a graph; traverse it; find connected components; detect cycles; BFS for shortest path in unweighted graphs 12-15 80+
12 Shortest paths Use Dijkstra with a heap; know when BFS or Dijkstra is the right tool 5 25+
13 Union-find Union and find with path compression; use it for connectivity and grouping 4 15+
14 Greedy State a greedy choice and check it with a counter-example; use sorting with greedy 8 50+
15 Dynamic programming Define a state; write the recurrence and base cases; go from recursion to a table; optimise space 20-25 120+
16 Tries Insert, search and prefix-match with a trie 4 15+
17 Bit tricks Use AND, OR, XOR and shifts; count set bits; use XOR to cancel pairs 4 15+
18 Intervals Sort intervals; merge overlapping ones; sweep line for counting 6 20+

Totals: the first pass is about 200 problems. The depth targets add up to about 750. The rest of the 1,000+ comes from company-wise practice and contests, below. Topics overlap, and most people need more time on dynamic programming and graphs than the table suggests.

Why 1,000 and not 100

My guidance, from how the Indian market looks to me, is that getting into strong product companies takes much more practice than a hundred problems. Top-company interviews test whether you can solve a problem you have never seen, under time pressure, while explaining your thinking. That ability comes from having met hundreds of problem shapes. 100 problems teach you the topics. A thousand teach you to recognise a new problem quickly.

This is guidance, not a published requirement. No company states a number, and public plans vary from 75 to 350 problems for basic coverage. Treat those as the floor for knowing the topics, and go beyond them if you are aiming high. Solving more is almost never the mistake. Solving without review is.

The bar to aim at

Aim at the hardest-selecting companies, such as Media.net, Coinbase and Rubrik. If you can get through their processes, the rest are easier. That means more hard problems, contests, concurrency and machine coding, not only more of the same. The details and what public sources say are on practising for the hardest companies.

Company-wise practice

After you finish a first pass of a topic, mix in problems asked at specific companies. Do not focus on a single company. Companies change their questions, interviewers differ, and you will probably interview at several. Practise sets from many: for example Amazon, Google, Microsoft, Flipkart, Atlassian and Swiggy, and also service and mid-size companies.

  • Several sites list problems tagged by company. Which tags are free and which are paid changes, so check each site before relying on it. See free resources.
  • Alternate: one week from one company's set, the next from another's, so you meet different styles.
  • Also practise on Codeforces and CSES. Contest problems train speed and unfamiliar problems, which interviews also test.
  • After each session, add the problem to your tracker with the pattern and the mistake, if any.

A simple way to count to 1,000

  1. First pass (about 200): one topic at a time, in the order above.
  2. Depth (about 550 more): the depth targets in the table, mixing topics once you are comfortable.
  3. Company-wise and contests (250 or more): sets by company, plus weekly contests.

Count only problems you could solve again a week later without help. Problems you needed the solution for count only after you solve them again cleanly.

How to read the counts

  • Practice problems are the author's rough guidance for reaching "can solve this without a hint" on a topic. Use them as a starting budget, not a target to hit exactly.
  • No company publishes a required number of problems or hours. Public figures from other sources disagree: one author's plan suggests 75 questions over 12 weeks at 11 hours a week (Tech Interview Handbook), while commercial blogs quote 75-150 and 250-350 (see sources below). Treat all of these as opinions. My advice for strong product companies is higher, as explained above.

Where to practise

Each topic can be practised on the sites in free resources. For a first pass, use one sheet or one roadmap and do its problems in the topic order. Mixing several sheets early tends to spread practice thin.

Try this

Write the 18 topic names on one page and tick each one only when you can solve one medium problem on it, from memory, in under 40 minutes. Start with arrays and strings.

Sources

  • Tech Interview Handbook, coding interview study plan: https://www.techinterviewhandbook.org/coding-interview-study-plan/
  • Educative, "How many LeetCode problems should I do" (commercial blog): https://www.educative.io/blog/how-many-leetcode-problems-should-i-do
  • DesignGurus, "How many LeetCode questions should I solve" (commercial blog): https://designgurus.io/answers/detail/how-many-leetcode-questions-should-i-solve