Skip to content

How to learn DSA from zero

For anyone starting coding prep, from first-year student to 3 years of experience. When done you will have a language, a weekly hour budget, a 12-week order and an 11-step method.

What interview-ready means

You are ready when you pass these tests, not when you reach a problem count. Jugal cleared Amazon, Google, and Meta with 120 LeetCode problems (post).

Test Target Source
Unseen Medium problems Solve most of them in 20 to 25 minutes NeetCode
Pattern recognition Name the pattern from the problem statement alone, before you read any solution Jugal's 60-day roadmap
Talking Say the brute force, the better idea, and both complexities before you type Jugal's Amazon roadmap
Code Syntactically correct code without an IDE, no pseudo code Amazon SDE II prep
Memory Old misses pass when you re-solve them from a blank file How to practice

The full self-test with numbers is on How to practice.

What coding rounds test in 2026

  • Algorithms are still the core. In a 2025 interviewing.io survey of 67 interviewers, none of the 52 FAANG respondents said their company had dropped algorithm questions. 58% said they changed the kind of question, toward custom and multi-part problems with deeper follow-ups (interviewing.io).
  • Meta (as of Oct 2026): select roles now have an AI assistant built into CoderPad (Meta hiring process). The AI-enabled round replaces one of two onsite coding rounds; one classic problem round with no AI stays (Hello Interview).
  • Google (as of Oct 2026): its own pages say AI tools are not permitted in interviews (How we hire). A Gemini-assisted pilot for select US teams was reported in May 2026 (Aced). Ask your recruiter which format you get.
  • Amazon: the coding part of the SDE online assessment averages 70 minutes. Public docs such as the JDK or STL are allowed, and browser use is logged (Amazon OA prep).
  • What to do about it: learn each pattern well enough to solve a problem you have never seen, without AI help. Jugal: "Algorithmic fundamentals still matter, because at least one round remains assistance-free at most companies" (post). Ask your recruiter which rounds allow AI, then add that format to your practice (AI-assisted practice, AI-enabled rounds).

The method, step by step

  1. Pick one language and learn its interview toolkit (3 to 5 days). Use the table in Pick your language. Learn only the calls on the language cheat sheets: hash map, set, deque, heap, sort with a key, binary search.
  2. Learn Big-O (2 sessions, about 2 hours). Watch NeetCode: Big-O Notation, read the NeetCode Big-O notes, then memorize the tables in the Big-O cheat sheet. You are done when you can state the cost of every line you write.
  3. Set up your tracking sheet and a cheat-sheet doc (30 minutes). Copy the header and formulas from Tracking sheet template. Make one empty page per pattern in your cheat-sheet doc.
  4. Pick one spine list. NeetCode 250 if you are starting from zero, Grind 75 or NeetCode 150 if you know arrays, hash maps, trees and recursion. Compare them on Problem lists. Never run two spine lists at once.
  5. Learn topics in dependency order. Go top to bottom on Topics. For each topic: read the linked resource (20 to 30 minutes), implement the data structure once from a blank file, then solve the 2 to 4 starter problems.
  6. Drill one pattern at a time, 2 days each. Jugal: "Spend two days doing ONLY sliding window problems. Then two days on binary search." (post). Use the cues, template and ordered problems on Patterns. Day 1: 2 Easy with the template open, then 2 to 3 Medium closed and timed. Day 2: 2 Medium cold and 1 Hard capped at 40 minutes.
  7. Run the same routine on every problem. Restate, pick a target complexity from the input size, write examples, say the brute force, name the pattern, code, dry-run, state complexity, log it. Timers and the hint ladder are on How to practice.
  8. Re-solve every miss on day 1, 3, 7 and 21. Code it from a blank file without looking. A failed re-solve restarts at day 1. Jugal's version: "Come back to it three days later. Try again." (post).
  9. Switch to unseen problems after about 75. One LeetCode contest a week, plus random picks from your list where you name the pattern before you code. Contest times and rules are on How to practice.
  10. Talk out loud from week 3. Narrate every problem as if an interviewer were listening. When a screen is booked, learn the minute-by-minute plan on The 45-minute interview and the rubric on Code quality.
  11. Add company lists and mocks in the last 2 to 4 weeks. Use your target's page in Companies and run 2 mocks a week from Mock interviews.

Tip: Do not spend a week choosing resources. NeetCode: "So many people spend more time thinking about the best way to study than actually studying." (NeetCode).

Pick your language

Use the language you know best. Meta: "Meta engineers use all types of languages, so use the language you're most comfortable with" (Meta careers blog). Microsoft: "You'll be asked to code only in the language you're strong in" (Microsoft).

Language Pick it if What you get Watch out for
Python You are new to interviews, or you know it well Short code. dict, set, collections.deque, Counter, heapq, bisect, functools.cache built in. NeetCode learned Python only for interviews and says the basics took "a few hours" (NeetCode) heapq is a min-heap (negate values for a max-heap). Recursion limit is about 1000 (TIH). list.pop(0) is O(n). -3 // 2 is -2. No built-in sorted map
Java It is your strongest language HashMap, ArrayDeque, PriorityQueue, TreeMap with floorKey and ceilingKey More typing. int overflow. A comparator written as a - b can overflow: use Integer.compare
C++ You do competitive programming, or target systems, HFT or quant software roles STL: unordered_map, ordered map and set with lower_bound, priority_queue. Quant and HFT software roles often center on C++ (Jugal's HFT post) priority_queue is a max-heap by default. Overflow (use long long). Long comparators
JavaScript or TypeScript You target front-end roles and know JS best Fine for arrays, strings, maps and sets No built-in heap (TIH heap page) and no deque. Agree with the interviewer to assume a heap with push and pop
Go or C Avoid for DSA rounds, even if you use them at work Nothing extra for these rounds They lack standard library data structures, per the Tech Interview Handbook

Rules:

  1. Use one language for every practice problem. Switching mid-prep resets your speed.
  2. If two languages tie, pick Python. The Tech Interview Handbook author calls it his "de facto choice for algorithm coding interviews", and adds: "Most of the time, the bottleneck is in the thinking and not the writing."
  3. Python, Java and C++ are the safe picks. The Tech Interview Handbook notes that Google's algorithm rounds have been limited to Java, C++, JavaScript or Python (TIH). Meta's AI-enabled round supports Python, Java, TypeScript, C++, C#, Kotlin, Swift, Rust and Go (Meta hiring process). For anything else, ask your recruiter before the screen.
  4. Practice without autocomplete. Amazon: "Expect to be asked to write syntactically correct code" and no pseudo code (Amazon SDE II prep). Type one solution a week in a plain editor with autocomplete off.

Templates on Patterns are in Python. The matching Java and C++ calls are on Topics.

Weekly hour budgets

Benchmarks to plan with:

  • Total: about 30 hours for the bare minimum, about 100 hours to be well prepared (Tech Interview Handbook).
  • Default plan: 3 months at 11 hours a week (TIH study plan).
  • Per new problem: 50 minutes. Grind 75 budgets each problem at about twice its solve time (solve, then check), which averages about 50 minutes.

Hours below are for coding only. Applications, outreach, resume and behavioral take another 4 or more hours a week (Start here).

Your situation Coding hours a week New problems a week Grind 75 schedule to open
Student with full classes 6 to 10 7 to 11 12 weeks at 6 hours: 85 problems, or 12 weeks at 10 hours: 137 problems
Student on break or summer 15 15 to 18 4 weeks at 15 hours: 71 problems
Working engineer 5 to 10 6 to 10 12 weeks at 6 hours: 85 problems, or 12 weeks at 8 hours: 111 problems
Interview in about 4 weeks 10 12 4 weeks at 10 hours: 50 problems
Phone screen in 2 weeks 15 20 2 weeks at 15 hours: 39 problems

How to spend the hours:

  1. Split each session about 70/30. 70% new problems from this week's pattern, 30% due re-solves. If more re-solves are due, cut new problems first.
  2. Keep the order Grind gives you. The order=all_rounded part of each link keeps Grind's priority order. Without it, the site orders problems by difficulty, so all the Hards pile up at the end (Grind 75 changelog).
  3. Block the time on your calendar. Day-by-day schedules for students, working engineers and summer breaks are on How to practice.

The 12-week learning order

Coding only, about 6 to 10 hours a week, matching the 12-week plan on Start here. Starting from zero? Use the 16-week plan, which spends extra weeks on the same order.

Week Topics to learn (Topics) Patterns to drill (Patterns) New problems Done when
1 Big-O, arrays, strings, hashing Hashing 8 Language cheat sheet written. Tracking sheet live
2 Two pointers, sliding window, prefix sums Two pointers, Sliding window, Prefix sums 8 You can say which of the three a problem needs from its first line
3 Stack, queue, linked list Stack and monotonic stack, Fast and slow pointers, Linked list reversal 8 Linked list reversal typed from memory without a bug
4 Binary search, sorting Binary search, Cyclic sort 8 One binary search template used for every variant
5 Recursion, backtracking, binary trees Backtracking, Tree DFS, Tree BFS 8 Iterative in-order traversal written once by hand
6 Binary search trees, heaps, intervals Tree DFS (BST problems), Heaps, Intervals 10 Heap used in 3 problems without looking up the API
7 Graphs: DFS, BFS, topological sort Graph DFS, Graph BFS, Topological sort 10 DFS and BFS each written from scratch in 20 minutes or less (a target from Jugal's Google plan)
8 Union-find, shortest paths, tries Union-find, Shortest paths, Trie 9 A Trie class written on paper in about 20 minutes (a target from Jugal's Meta plan)
9 Dynamic programming, 1D and knapsack Dynamic programming 10 State and recurrence written in words before any code
10 Dynamic programming 2D, greedy, bits Dynamic programming, Greedy, Bit manipulation 10 You can say why a greedy choice is safe, or why it is not
11 Design a data structure, matrices, mixed practice Design a data structure, Matrix traversal 8 plus 1 contest LRU Cache written from a blank file
12 Mocks and your weakest pattern Your 2 weakest patterns from the tracking sheet 10 2 mocks done. About 107 new problems in total, plus re-solves

Watch out: Do not skip ahead to dynamic programming in week 2 because it feels important. Every DP problem needs recursion, and most need arrays, hashing and trees first.

How Jugal did it

"Everyone told me I needed at least 400 solved problems before I could even think about applying to FAANG. I had 120." In the same post: "I spent two months being very deliberate about what I practiced and why." He cleared all three loops: Amazon, Google, and Meta (post).

The rules he used, each from his own posts:

Rule In his words Post
Patterns over volume "3 LeetCode problems a day (focus on patterns, not volume)" The Job Hunt I Didn't Burn Out Doing
Cluster by pattern "Solve them in clusters. Spend two days doing ONLY sliding window problems." Your 6-Week Amazon Interview Roadmap
Timebox, then retry "Set a timer. 30 minutes per medium problem. If you can't solve it in 30, look at the solution, understand it, and move on." Your 6-Week Amazon Interview Roadmap
Name the pattern "After you solve one, note the pattern it used. Spotting the pattern quickly is the actual skill being tested." Want a Job in the Next 30 Days?
Follow the roadmap order "Go in the roadmap's order. It's sequenced so each topic sets up the next one." Want a Job in the Next 30 Days?
Talk before you code "Start coding only after you've talked it through." Your 6-Week Amazon Interview Roadmap
End with mocks, not new problems "Two clean mock sessions will do more for you than 20 new problems at this stage." I Cleared Amazon, Google, and Meta With Only 120 LeetCode Problems

Use his material in this order:

  1. Follow the 60-day pattern roadmap if you want patterns instead of a list. The plan is in I Cleared Amazon, Google, and Meta With Only 120 LeetCode Problems, and the day-by-day version (60 to 90 minutes a day: theory, 2 to 4 problems, notes) is Master DSA with patterns. A block-by-block summary is on Problem lists.
  2. Prefer weekly blocks? Use the 10-week pattern plan from Jugal's interview with Michael, CEO of Simplify: one or two patterns a week, each with linked problems (Michael's 10-week FAANG roadmap).
  3. Use his company pattern map in the last 1 to 2 weeks. It lists 4 patterns per company for Amazon, Google, Meta, Netflix, Uber, Airbnb, Microsoft and Apple, with problems for each, in his free Company Wise DSA patterns Notion page. A summary is on Patterns.
  4. Run a 5-week company plan once you have a target: Meta, Amazon, Google, Apple, Netflix. Each has 4 topic weeks with time limits, then a week of timed mocks. Fixes for their Premium-only and renamed problems are on Problem lists.
  5. Watch his Amazon walkthrough before an Amazon loop: How I cleared Amazon Technical Interview | DSA + System Design | 4 week plan. The "Dry Run Trick for Debugging" chapter starts at 11:40.

Free resources for the theory

Use these when a topic does not click from the page linked on Topics. Free first.

  • Tech Interview Handbook algorithm cheatsheets: one page per topic with costs, techniques, corner cases and essential questions, by Yangshun Tay (author of Blind 75 and Grind 75). How to use it: read the topic page before you drill it, and copy its corner cases into your cheat sheet.
  • NeetCode Roadmap: the NeetCode 150 drawn as a dependency tree of 18 topics, with a free video per problem. How to use it: finish a node's Easy and Medium problems before you open the next node. Watch the video only after 20 to 30 minutes of your own attempt.
  • How I would learn Leetcode if I could start over (NeetCodeIO): the method in one video. How to use it: watch once in week 1, then stop planning and start.
  • Hello Interview: data structures and algorithms (freemium): visual lessons for 16 patterns. How to use it: read the overview page of a pattern before day 1 of that pattern.
  • CodeSignal Learn (freemium): structured DSA paths with an AI tutor. How to use it: Jugal's weeks 1 to 2 pick is the "Mastering Algorithms and Data Structures" path, one module a day, asking the tutor before you look up an answer (post).
  • Striver's A2Z DSA Sheet (freemium: the free tier covers the free questions; TUF+ is paid): 495 topics, about 400 practice problems plus 50 theory lessons, in 20 modules. The site estimates about six months. How to use it: if you are a first or second-year student learning DSA from scratch, especially for Indian campus placements, do one module at a time in order.
  • Princeton Algorithms, Part I and Part II (free on Coursera, no certificate): a university course in Java. Part I covers union-find, stacks, queues, sorting, priority queues, BSTs and hash tables. Part II covers graphs and strings. How to use it: if you have never taken a DSA class, do Part I before your spine list.
  • LeetCode Explore cards: free short courses per topic (arrays, linked list, queue and stack, binary search, recursion, binary tree, heap, graph, trie, DP). How to use it: when a topic is new, do its card before the starter problems on Topics.
  • Python Tutor: a step-by-step visualizer for Python, Java, C, C++ and JavaScript. How to use it: paste a buggy linked list or recursion solution and watch the pointers and call frames change line by line.
  • Abdul Bari: Algorithms: whiteboard lectures on complexity, sorting, greedy, DP and graphs. How to use it: watch the one lecture for the topic that did not click, not the whole playlist.
  • MIT 6.006 Introduction to Algorithms (Spring 2020): the full MIT course with lectures, notes and problem sets. How to use it: watch the hashing, heaps, graphs or DP lecture when you want the theory behind a pattern.
  • William Fiset: Graph Theory: animated graph algorithms. How to use it: watch the BFS, DFS, topological sort and Dijkstra videos in week 7 and 8.
  • VisuAlgo: step-through animations of sorting, lists, heaps, BSTs, graphs and union-find. How to use it: step through the animation once for every new data structure.
  • Kunal Kushwaha: Java + DSA: long Java DSA course from zero. How to use it: only if Java is your language and you are new to programming.
  • Coding Interview University: a full CS study plan by John Washam. How to use it: read the advice on flashcards and doing problems while you learn. Skip the full plan unless you lack CS basics.
  • Beyond Cracking the Coding Interview (paid book, 9 chapters free): the sequel to Cracking the Coding Interview, by Gayle Laakmann McDowell, Mike Mroczka, Aline Lerner and Nil Mamano. How to use it: read the free sneak peek chapters on sliding windows and binary search before you drill those patterns.
  • Cracking the Coding Interview and Elements of Programming Interviews (paid books): the two books in the resource lists of Jugal's FAANG plans. How to use it: optional. If you buy one, use it for explanations, not as a second problem list.

Tip: You do not need a paid course. If you pay for one thing, make it one month of LeetCode Premium ($35 a month as of Oct 2026) 2 to 5 weeks before a scheduled interview, for company tags. Details on Problem lists.

Checklist

  • Language picked, and its cheat sheet written from Topics
  • Big-O tables learned from the cheat sheet
  • Tracking sheet and pattern cheat-sheet doc created
  • One spine list picked on Problem lists
  • Weekly coding hours blocked on the calendar
  • First 2-day pattern cluster scheduled
  • Re-solve dates set for day 1, 3, 7 and 21
  • First weekly contest on the calendar
  • Readiness self-test passed on How to practice

Next: DSA topics in learning order