Skip to content
dsa450for five year olds

Roadmap

Pick where you want to go. Then walk there.

Different companies ask different kinds of questions. Everyone needs the shared core. After that, each kind of company gets its own list and its own plan. Tick problems off as you go; your progress stays in this browser.

The shared core

Everyone does these first.

Eighteen problems that teach the tricks every interview leans on: two fingers, sliding windows, the waiting line, asking your children, and writing answers in a chart.

0/18

In every interview

  1. Say the problem back in your own words, and ask about strange inputs.
  2. Work one small example by hand before you write code.
  3. Say the simple way first and how slow it is. Then find the clever way.
  4. Write the code while you talk. Then walk your example through it.
  5. Say the time and the extra room it needs, and one way to do better.
  1. 01Kadanes AlgoArray · Kadane running sum
  2. 02Find all pairs on integer array whose sum is equal to given numberArray · Hash map counting
  3. 03Merge IntervalsArray · Greedy by sorting
  4. 04Next PermutationArray · Two pointers
  5. 05Trapping Rain water problemArray · Two pointers
  6. 06Find the smallest window in a string containing all characters of another stringString · Sliding window
  7. 07Search in a rotated sorted arraySearching & Sorting · Binary search
  8. 08Write a Program to reverse the Linked List (Both Iterative and recursive)Linked List · Pointer flipping
  9. 09Write a program to Detect loop in a linked listLinked List · Fast and slow pointers
  10. 10Find the next Greater elementStacks & Queues · Monotonic stack
  11. 11Level order traversalBinary Trees · Breadth first search with a queue
  12. 12Find LCA in a Binary treeBinary Trees · Depth first search
  13. 13Check if a tree is a BST or notBinary Search Trees · Depth first search with bounds
  14. 14k largest element in an arrayHeap · Heap of size k
  15. 15Find the no. of IslandsGraph · Depth first search
  16. 16Implement Topological SortGraph · Topological sort
  17. 17Longest Common SubsequenceDynamic Programming · 2D dynamic programming
  18. 18Coin Change ProblemDynamic Programming · Unbounded knapsack

Quant and trading firms

The math olympiad of interviews.

Jane Street, Hudson River Trading, Citadel, Two Sigma, DRW, Optiver, IMC, SIG, XTX, Tower, Virtu, AQR, Radix, WorldQuant

Hard problems under a tight clock, often with a math or probability twist. They watch how you think out loud and whether your code is right the first time. Expect follow ups that change one rule and ask how your answer changes.

Topics to lean on

A plan

  • Weeks 1 to 2: the shared core below, timed, with no hints.
  • Weeks 3 to 4: dynamic programming, every must do problem, plus binary search on the answer.
  • Weeks 5 to 6: bit tricks, greedy proofs (say why the greedy choice is safe), backtracking with pruning.
  • Every week: mental math and probability puzzles outside this site, and two mock interviews where you explain while you type.
0/20
  1. 01Count InversionArray · Divide and conquer
  2. 02Aggressive cowsSearching & Sorting · Binary search on the answer
  3. 03Book Allocation ProblemSearching & Sorting · Binary search on the answer
  4. 04K-th Element of Two Sorted ArraysSearching & Sorting · Binary search on the answer
  5. 05Find the two non-repeating elements in an array of repeating elementsBit Manipulation · XOR tricks
  6. 06Count total set bits in all numbers from 1 to nBit Manipulation · Bit column counting
  7. 07Divide two integers without using multiplication, division and mod operatorBit Manipulation · Shift and subtract
  8. 08Power SetBit Manipulation · Bitmask enumeration
  9. 09Optimal Strategy for a GameDynamic Programming · Interval dynamic programming
  10. 10Maximum profit by buying and selling a share at most k timesDynamic Programming · 2D dynamic programming
  11. 11Boolean Parenthesization ProblemDynamic Programming · Interval dynamic programming
  12. 12Count Derangements (Permutation such that no element appears in its original position)Dynamic Programming · 1D dynamic programming
  13. 13Program for nth Catalan NumberDynamic Programming · 1D dynamic programming
  14. 14Egg Dropping ProblemDynamic Programming · 2D dynamic programming
  15. 15Maximum sum rectangle in a 2D matrixDynamic Programming · Kadane on column strips
  16. 16Job Sequencing ProblemGreedy · Greedy by sorting
  17. 17Fractional Knapsack ProblemGreedy · Greedy by sorting
  18. 18Detect Negative cycle in a graphGraph · Bellman-Ford
  19. 19Minimise the cashflow among a given set of friends who have borrowed money from each otherGraph · Greedy
  20. 20Partition of a set into K subsets with equal sumBacktracking · Backtracking with bitmask memo

AI labs and elite product teams

Build a small thing that really works.

Anthropic, OpenAI, Nvidia, Netflix, Roblox and similar teams

Practical coding: build a cache, a parser, a scheduler or a search box, then extend it when the interviewer adds a rule. Clean, tested code matters as much as the trick. Graphs, heaps, tries and careful design of small classes come up a lot.

Topics to lean on

A plan

  • Weeks 1 to 2: the shared core below, written as clean classes with small tests.
  • Weeks 3 to 4: design style problems: LRU cache, min stack, circular queue, phone directory with a trie.
  • Weeks 5 to 6: graphs and heaps: task ordering, merging many sorted streams, spanning trees.
  • Every week: one long problem where you keep adding features for an hour, the way these rounds work.
0/17
  1. 01LRU Cache ImplementationStacks & Queues · Hash map plus doubly linked list
  2. 02Design a Stack that supports getMin() in O(1) time and O(1) extra spaceStacks & Queues · Stack with an encoded minimum
  3. 03Implement a Circular queueStacks & Queues · Circular array with modulo
  4. 04Arithmetic Expression evaluationStacks & Queues · Two stacks for operators and numbers
  5. 05Implement a Phone DirectoryTrie · Trie
  6. 06Construct a trie from scratchTrie · Trie
  7. 07Find whether it is possible to finish all tasks or not from given dependenciesGraph · Topological sort
  8. 08Implement Kruskals AlgorithmGraph · Union find
  9. 09Clone a graphGraph · Hash map from old to new
  10. 10Merge K sorted arraysHeap · K way merge with a heap
  11. 11Smallest range in K ListsHeap · K way merge with a heap
  12. 12Median in a stream of IntegersHeap · Two heaps
  13. 13KMP AlgoString · Prefix function (KMP)
  14. 14Rabin Karp AlgoString · Rolling hash
  15. 15Huffman CodingGreedy · Greedy with a min heap
  16. 16Weighted Job SchedulingDynamic Programming · 1D dynamic programming
  17. 17Construct Binary Tree from String with Bracket RepresentationBinary Trees · Recursive parsing

Big tech

The classic exam, medium to hard.

Google, Meta, Microsoft, Apple, Amazon, Uber, Airbnb, Tesla, DoorDash, Coinbase, Block, PayPal

Two or three coding rounds of 45 minutes, usually one medium and one hard problem each. Trees, graphs, sliding windows, heaps and dynamic programming carry most of the weight. You must state the complexity and handle edge cases without being asked.

Topics to lean on

A plan

  • Weeks 1 to 2: arrays, strings and the shared core below.
  • Weeks 3 to 4: trees, BSTs and heaps, every must do problem.
  • Weeks 5 to 6: graphs and dynamic programming, then backtracking.
  • Weeks 7 to 8: mixed timed sets of two problems in 45 minutes, and mock interviews.
0/20
  1. 01Median of 2 sorted arrays of different sizeArray · Binary search on the answer
  2. 02Largest rectangular Area in HistogramStacks & Queues · Monotonic stack
  3. 03Maximum of all subarrays of size kHeap · Monotonic deque
  4. 04Merge K Sorted Linked ListsHeap · K way merge with a heap
  5. 05Dijkstra algoGraph · Dijkstra
  6. 06Given a sorted Dictionary of an Alien Language, find order of charactersGraph · Topological sort
  7. 07Count Strongly connected Components (Kosaraju Algo)Graph · Depth first search, two passes
  8. 08Cheapest Flights Within K StopsGraph · Bellman-Ford with limited rounds
  9. 09Word LadderGraph · Breadth first search
  10. 10Construct Binary tree from Inorder and preorder traversalBinary Trees · Divide and conquer
  11. 11Find all Duplicate subtrees in a Binary treeBinary Trees · Hash map of subtree shapes
  12. 12Diameter of a treeBinary Trees · Depth first search
  13. 13Largest BST in a Binary TreeBinary Search Trees · Postorder with return info
  14. 14Edit DistanceDynamic Programming · 2D dynamic programming
  15. 15Longest Palindromic SubstringDynamic Programming · Expand around center
  16. 16Longest Increasing SubsequenceDynamic Programming · Binary search on tails
  17. 17Word Break ProblemDynamic Programming · 1D dynamic programming
  18. 18Matrix Chain MultiplicationDynamic Programming · Interval dynamic programming
  19. 19Printing all solutions in N-Queen ProblemBacktracking · Backtracking
  20. 20Sudoku SolverBacktracking · Backtracking

Product companies

Solid mediums, explained clearly.

LinkedIn, Spotify, Dropbox, Pinterest, Notion, Figma, Discord, Plaid, Datadog, Asana, Cloudflare, Atlassian, Salesforce, Adobe, Oracle, eBay, Lyft, GitHub

Mostly medium problems on arrays, strings, hash maps, trees and breadth first search, often wrapped in a story about their product. Communication and working code count more than rare tricks.

Topics to lean on

A plan

  • Weeks 1 to 2: arrays, strings, hash maps, and the shared core below.
  • Weeks 3 to 4: stacks, queues, trees and breadth first search.
  • Weeks 5 to 6: heaps, simple graphs, the easier dynamic programming problems, and mocks.
0/15
  1. 01Find longest consecutive subsequenceArray · Hash set lookups
  2. 02Find if there is any subarray with sum equal to 0Array · Prefix sum with a hash set
  3. 03Given a sequence of words, print all anagrams togetherString · Hash map grouping
  4. 04Longest Common PrefixString · Column by column scan
  5. 05LRU Cache ImplementationStacks & Queues · Hash map plus doubly linked list
  6. 06Minimum time required to rot all orangesStacks & Queues · Breadth first search with a queue
  7. 07Right View of TreeBinary Trees · Depth first search
  8. 08Zig-Zag traversal of a binary treeBinary Trees · Two stacks
  9. 09Find Kth smallest element in a BSTBinary Search Trees · Inorder traversal
  10. 10Merge K Sorted Linked ListsHeap · K way merge with a heap
  11. 11Implement BFS algorithmGraph · Breadth first search
  12. 12Clone a graphGraph · Hash map from old to new
  13. 13Longest Increasing SubsequenceDynamic Programming · Binary search on tails
  14. 14Word Break ProblemDynamic Programming · 1D dynamic programming
  15. 15Construct a trie from scratchTrie · Trie

Banks, finance and enterprise

Get the basics perfectly right.

JPMorgan, Goldman Sachs, Morgan Stanley, Capital One, Citi, Wells Fargo, Bank of America, BlackRock, IBM, Intel, Booking, Walmart, and IT services firms

Easier to medium problems, often on an online test first. Arrays, strings, linked lists, stacks, sorting and simple recursion. Clean code and correct edge cases beat fancy tricks.

Topics to lean on

A plan

  • Week 1: arrays and strings.
  • Week 2: linked lists, stacks and queues.
  • Week 3: sorting, binary search and matrices.
  • Week 4: trees basics, a few dynamic programming classics, and timed online test practice.
0/16
  1. 01Reverse the arrayArray · Two pointers
  2. 02Find the maximum and minimum element in an arrayArray · Compare in pairs
  3. 03Given an array which consists of only 0, 1 and 2. Sort the array without using any sorting algoArray · Three pointers
  4. 04Best time to buy and Sell stockArray · Running minimum
  5. 05Check whether a String is Palindrome or notString · Two pointers
  6. 06Balanced Parenthesis problemString · Stack
  7. 07Find Duplicate characters in a stringString · Hash map counting
  8. 08Find the middle Element of a linked listLinked List · Fast and slow pointers
  9. 09Remove Duplicates in a sorted Linked ListLinked List · Single pointer skip
  10. 10Implement Queue using StackStacks & Queues · Two stacks, lazy transfer
  11. 11Evaluation of Postfix expressionStacks & Queues · Stack evaluation
  12. 12Find first and last positions of an element in a sorted arraySearching & Sorting · Binary search
  13. 13Spiral traversal on a MatrixMatrix · Matrix simulation
  14. 14Height of a treeBinary Trees · Depth first search
  15. 15Find a value in a BSTBinary Search Trees · BST search
  16. 16Knapsack ProblemDynamic Programming · 2D dynamic programming