Discover / Coding interview preparation / Reading path

Best Books for Coding Interviews, in Order

@codesherpaBeginner → Expert
10
Books
124
Hours
5
Stages
Rate this path

This curriculum takes a beginner from zero interview experience to confidently tackling top-tier coding interviews across all four pillars: algorithmic patterns, data structures, system design, and behavioral rounds. Each stage builds directly on the last — you first develop the programming and CS fundamentals needed to understand problems, then drill patterns and data structures, then tackle the advanced system design and behavioral rounds that separate good candidates from great ones.

1

Foundations: CS Thinking & Problem-Solving Basics

Beginner

Build the core programming intuition, basic data structures vocabulary, and a problem-solving mindset needed to approach any coding challenge without feeling lost.

Study plan for this stage

Pace: 4–5 weeks, ~40–50 pages/day (mix of reading and reflection). Week 1–2: "Think like a Programmer" (core chapters on problem-solving); Week 3–5: "A Common-Sense Guide to Data Structures and Algorithms" (foundational chapters through basic sorting/searching).

Key concepts
  • The problem-solving framework: understand the problem, devise a plan, carry out the plan, review the solution (from Spraul's methodology)
  • Breaking down complex problems into smaller, manageable subproblems and recognizing patterns
  • Core data structures: arrays, linked lists, stacks, queues, and basic trees—what they are, how they work, and when to use each
  • Time and space complexity basics: Big O notation, why it matters, and how to estimate it intuitively
  • Algorithmic thinking: recognizing that different approaches to the same problem have vastly different performance characteristics
  • The relationship between data structure choice and algorithm efficiency—why the right structure matters before you code
You should be able to answer
  • Walk through Spraul's problem-solving framework: what are the four steps, and why is each one essential before writing code?
  • Explain the difference between an array and a linked list. When would you choose one over the other, and what trade-offs exist?
  • What is Big O notation, and why do we use it instead of measuring time in seconds? Give examples of O(1), O(n), O(n²), and O(log n) operations.
  • Describe a real-world scenario where choosing the wrong data structure would make your algorithm impractical. How would you fix it?
  • How do stacks and queues differ conceptually and structurally? Give a practical example where each is the natural choice.
  • Trace through a simple sorting or searching algorithm by hand. Can you explain why it works and estimate its time complexity?
Practice
  • Complete all 'Think like a Programmer' exercises in Chapters 1–4 (or equivalent foundational chapters). Write out your problem-solving framework for each before coding.
  • Implement arrays, linked lists, stacks, and queues from scratch in your chosen language. Don't copy—build them to understand how they work internally.
  • Solve 10–15 'easy' LeetCode or HackerRank problems (e.g., reverse an array, find duplicates, basic string manipulation) using Spraul's framework. Write pseudocode first, then code.
  • Draw diagrams for at least 5 different data structures showing how elements are stored and accessed. Label time complexities for insertion, deletion, and search.
  • Implement and trace through 2–3 basic sorting algorithms (bubble sort, selection sort, insertion sort) by hand on paper, then in code. Annotate with Big O analysis.
  • Refactor a naive solution to a problem (e.g., finding duplicates in O(n²)) into a more efficient one using a better data structure (e.g., hash set in O(n)). Document the trade-offs.

Next up: This stage equips you with the mental models and vocabulary needed to recognize problem patterns and choose appropriate tools, preparing you to tackle intermediate algorithm design (sorting, searching, dynamic programming) and more complex data structures with confidence.

Think like a Programmer
V. Anton Spraul · 2012 · 256 pp

Teaches the meta-skill of decomposing problems before writing a single line of code — essential for beginners who freeze when they see an unfamiliar problem. Read this first to build the right mental habits.

A Common-Sense Guide to Data Structures and Algorithms
Jay Wengrow · 2017 · 222 pp

Introduces arrays, hash tables, stacks, queues, trees, and Big-O notation in plain English with visual intuition. This is the gentlest on-ramp to the data structures you will be drilled on in every interview.

2

Core Patterns: Algorithms & Data Structures Drilling

Intermediate

Master the recurring algorithmic patterns (sliding window, two pointers, BFS/DFS, dynamic programming, backtracking) and the data structures that underpin them, so you can recognize and apply them under pressure.

Study plan for this stage

Pace: 16–20 weeks total, broken into 3 book-specific phases: • Phase 1 — "Grokking Algorithms" (Weeks 1–3): ~20–25 pages/day; read linearly, sketch every diagram by hand. • Phase 2 — "Cracking The Coding Interview" (Weeks 4–12): ~15–20 pages/day; read the DS/Algorithm chapters (VI–VIII) deeply, skim the d

Key concepts
  • Sliding Window & Two-Pointer patterns — recognizing when a contiguous subarray or pair-based scan collapses O(n²) to O(n) (Grokking ch. 4 + CTCI arrays chapter + EPI ch. 6)
  • BFS vs. DFS trade-offs — level-order traversal, shortest-path guarantees (BFS) vs. exhaustive path exploration and recursion stack (DFS), as developed in Grokking ch. 6–7 and CTCI Trees & Graphs chapter
  • Dynamic Programming decomposition — identifying overlapping subproblems and optimal substructure, memoization vs. tabulation, classic 1-D and 2-D DP tables (Grokking ch. 9, CTCI ch. 8, EPI ch. 16–17)
  • Backtracking & Recursion — building a solution incrementally and pruning invalid branches early; permutations, combinations, and constraint-satisfaction problems (CTCI Recursion & DP chapter, EPI ch. 15)
  • Core Data Structures — arrays, strings, hash maps, stacks, queues, heaps, and linked lists as the substrate for every pattern above (CTCI ch. 1–4, EPI ch. 6–10)
  • Graph representations & traversal — adjacency list vs. matrix, topological sort, connected components, and cycle detection (CTCI Trees & Graphs, EPI ch. 18–19)
  • Sorting & Binary Search — quicksort/mergesort internals, Big-O intuition, and binary search as a pattern (not just an algorithm) applied to answer-space problems (Grokking ch. 4–5, CTCI Sorting & Searching, EPI ch. 11–12)
  • Complexity analysis discipline — deriving time and space complexity for every solution you write, using the Big-O primer in Grokking ch. 1 and CTCI's Big O chapter as a shared reference
You should be able to answer
  • Given an unseen array problem, can you identify within 2 minutes whether a sliding window, two-pointer, or hash-map frequency count is the right entry point — and justify why using the pattern taxonomy from CTCI and EPI?
  • Can you trace through BFS and DFS on the same graph (drawn by hand) and explain exactly when each produces a correct shortest path — referencing the graph chapters in CTCI and EPI ch. 18?
  • Can you derive a DP recurrence relation from scratch for a new problem (e.g., coin change, longest common subsequence), implement both memoized and tabulated versions, and state the time/space complexity of each — as practiced in Grokking ch. 9 and CTCI ch. 8?
  • Can you implement a backtracking solution for generating all permutations or solving a constraint problem, clearly marking where pruning occurs — as illustrated in CTCI's Recursion & DP chapter and EPI ch. 15?
  • Can you articulate the Big-O cost (time AND space) of every major operation on arrays, linked lists, hash maps, heaps, and binary search trees — using the complexity tables in CTCI's introduction and Grokking ch. 1?
  • After reading an EPI problem statement, can you independently outline a brute-force solution, identify its bottleneck, and then apply the appropriate pattern to reach an optimal solution before checking EPI's walkthrough?
Practice
  • Pattern flashcard drill (ongoing): Create one flashcard per pattern (sliding window, two pointers, BFS, DFS, DP, backtracking) listing: trigger signals, canonical template code, and a representative problem from each book. Review daily using spaced repetition.
  • Grokking re-implementation sprint (Weeks 1–3): After each Grokking chapter, close the book and re-implement every algorithm shown (binary search, quicksort, BFS, Dijkstra, DP knapsack) from memory in Python, then diff against the book's pseudocode.
  • CTCI 'solve-first' gauntlet (Weeks 4–12): For every problem in CTCI's Data Structures and Algorithm chapters, write a full solution on paper or in an IDE before reading the hint or solution. Log your time, your Big-O, and the pattern used. Aim to cover at least 80% of problems.
  • EPI timed mock sessions (Weeks 13–20): Pick 3 EPI problems per session (one easy, one medium, one hard from the same chapter). Set a 35-minute timer per problem. After time is up, read EPI's solution, annotate what you missed, and re-solve from scratch 48 hours later.
  • Weekly pattern audit: Every Sunday, list all problems solved that week, tag each with its primary pattern, and identify your two weakest pattern tags. Dedicate the first 30 minutes of each weekday the following week to one additional problem in those weak areas (sourced from CTCI or EPI).
  • Complexity proof habit: For every solution you write throughout all three books, add a mandatory comment block: // Time: O(?), Space: O(?), Pattern: ?, Why this pattern?. Review these blocks at the end of each week to catch any hand-wavy reasoning.

Next up: Mastering these patterns through Grokking, CTCI, and EPI builds the algorithmic vocabulary and muscle memory needed to tackle the next stage — system design and domain-specific problem sets — where the same data structures (graphs, heaps, hash maps) reappear at architectural scale and must be chosen deliberately under interview constraints.

Grokking Algorithms: An illustrated guide for programmers and other curious people
Aditya Y. Bhargava · 2016 · 256 pp

A beautifully illustrated bridge from the previous stage into real algorithm design — covers recursion, quicksort, graphs, and dynamic programming with zero intimidation. Read before CTCI to solidify intuition.

Cracking The Coding Interview
Gayle Laakmann McDowell · 2010 · 504 pp

The single most canonical coding interview book in existence. After building intuition, use this to drill 189 real interview problems organized by topic, and absorb its insider advice on how interviewers actually evaluate candidates.

Elements of programming interviews in Python
Adnan Aziz · 2017 · 413 pp

Goes deeper and harder than CTCI with more problems and more rigorous solutions. Read after CTCI to stress-test your pattern recognition and push into harder problem variants that appear at top-tier companies.

3

Advanced Algorithms: Patterns at Scale

Expert

Internalize the hardest recurring patterns — dynamic programming variants, graph algorithms, and combinatorial problems — at the level required by FAANG and equivalent companies.

Study plan for this stage

Pace: 16–20 weeks total. Weeks 1–12: "Introduction to Algorithms" (Cormen) — focus on Parts III–VI (graph algorithms, dynamic programming, NP-completeness); aim for ~25–35 pages/day, 5 days/week, re-reading dense sections (e.g., DP chapters) twice. Weeks 13–20: "The Algorithm Design Manual" (Skiena) — ~20

Key concepts
  • Dynamic Programming foundations: optimal substructure, overlapping subproblems, memoization vs. tabulation (CLRS Ch. 15 — rod cutting, LCS, matrix-chain multiplication)
  • Graph representations and traversals: BFS, DFS, topological sort, and their correctness proofs (CLRS Ch. 22–23)
  • Shortest-path algorithms: Dijkstra, Bellman-Ford, Floyd-Warshall, and when each applies (CLRS Ch. 24–25)
  • Minimum Spanning Trees: Prim's and Kruskal's algorithms, cut property, and union-find (CLRS Ch. 23)
  • Advanced DP variants: interval DP, bitmask DP, DP on trees/graphs, and sequence alignment (CLRS Ch. 15 + Skiena Ch. 8)
  • Combinatorial search and backtracking: pruning strategies, permutations/subsets, and constraint satisfaction (Skiena Ch. 7)
  • NP-completeness and reductions: recognizing intractable problems, approximation strategies, and when to reach for heuristics (CLRS Ch. 34 + Skiena Ch. 9)
  • Algorithm design paradigms as a unified mental model: divide-and-conquer, greedy, DP, and graph search compared side-by-side (Skiena Part I, Ch. 1–5)
You should be able to answer
  • Given a new problem, how do you determine whether it has optimal substructure and overlapping subproblems, and therefore whether DP applies? Use the LCS and matrix-chain examples from CLRS Ch. 15 to justify your reasoning.
  • What is the key difference between Dijkstra's and Bellman-Ford algorithms in terms of correctness guarantees, and under what graph conditions does each one fail or become preferred? (CLRS Ch. 24)
  • How does Kruskal's algorithm use the union-find data structure to achieve near-linear performance, and what invariant does the cut property guarantee about the MST? (CLRS Ch. 23)
  • Skiena's 'War Story' chapters illustrate algorithm selection in practice — describe the decision process Skiena uses to move from a brute-force approach to an efficient one, and map that process onto a FAANG-style interview setting.
  • How would you reduce a novel combinatorial problem to a known NP-complete problem to prove its hardness, and what does that tell you about your implementation strategy? (CLRS Ch. 34 + Skiena Ch. 9)
  • When should backtracking with pruning be preferred over a DP solution, and how do you estimate the effective search-space reduction from a given pruning strategy? (Skiena Ch. 7)
Practice
  • Implement every major algorithm from CLRS in your language of choice (Dijkstra, Bellman-Ford, Floyd-Warshall, Prim, Kruskal, DFS/BFS with timestamps) from scratch — no library calls — and verify against the book's worked examples.
  • For each DP problem in CLRS Ch. 15 (rod cutting, LCS, matrix-chain), first write the naive recursive solution, profile it, then convert it to top-down memoization, then bottom-up tabulation; record the runtime difference empirically.
  • Pick 10 LeetCode Hard problems tagged 'Dynamic Programming' or 'Graph' (e.g., Edit Distance, Word Break II, Alien Dictionary, Critical Connections). Before coding, write out the recurrence relation or graph model on paper, referencing the relevant CLRS chapter.
  • Work through Skiena's 'catalog' chapters (Part II) for sorting, graphs, and DP: for each data structure or algorithm listed, write a one-paragraph 'when to use this' card in your own words, building a personal reference sheet.
  • Simulate a timed FAANG interview: give yourself 35 minutes per problem on 2 problems per week from the advanced sets (bitmask DP, interval scheduling, strongly connected components). After time is up, compare your solution to an optimal one and annotate the gap.
  • Prove (on paper) the correctness of at least three algorithms from CLRS using their provided loop invariants or induction arguments — then explain the proof aloud as if teaching it, using Skiena's more intuitive framing as a bridge.

Next up: Mastering these algorithmic patterns and their correctness arguments builds the analytical vocabulary needed to tackle system design and scalability challenges, where the same trade-offs — time vs. space, greedy vs. optimal, exact vs. approximate — reappear at distributed-systems scale.

Introduction to Algorithms
Thomas H. Cormen · 1990 · 1292 pp

Known as CLRS, this is the definitive reference for understanding WHY algorithms work, not just how to code them. Use it selectively (not cover-to-cover) to deeply understand DP, graph algorithms, and complexity proofs when patterns feel unclear.

The algorithm design manual
Steven S. Skiena · 1998 · 748 pp

Skiena's 'war stories' and catalog of algorithm problems make this the best book for developing the instinct to match a new problem to a known algorithmic strategy — the exact skill tested in hard interview rounds.

4

System Design: Architecture Rounds

Expert

Confidently walk through designing large-scale distributed systems (URL shorteners, news feeds, ride-sharing backends) in a structured, communicative way that satisfies senior-level interviewers.

Study plan for this stage

Pace: 8–10 weeks, ~40–50 pages/day (with design exercises interspersed). Week 1–6: "Designing Data-Intensive Applications" (900 pages); Week 7–10: "Machine Learning System Design Interview" (400 pages).

Key concepts
  • Scalability, availability, and maintainability as pillars of system design; how to measure and trade off these qualities
  • Data models and query languages: relational vs. document vs. graph models, and when to choose each
  • Storage engines and indexing: B-trees, LSM trees, and how they affect read/write performance
  • Replication strategies (single-leader, multi-leader, leaderless) and their consistency guarantees
  • Partitioning (sharding) techniques and how to handle skewed data and hot partitions
  • Transactions, ACID properties, and isolation levels; when weak consistency is acceptable
  • Batch processing and stream processing architectures for handling large-scale data pipelines
  • ML system design: defining metrics, data pipelines, feature engineering, model training, and serving at scale
  • End-to-end ML workflows: from problem framing through monitoring and iteration in production
You should be able to answer
  • How would you design a URL shortener that handles 1M requests/day? Walk through data models, replication, partitioning, and consistency trade-offs.
  • Explain the differences between single-leader and multi-leader replication. When would you use each, and what are the consistency challenges?
  • Design a news feed system for a social network. How would you handle fan-out, caching, and eventual consistency?
  • What are the trade-offs between strong and eventual consistency? Give examples where each is appropriate.
  • How would you design the data pipeline and feature store for an ML recommendation system serving millions of users?
  • Walk through the full lifecycle of an ML system in production: from problem definition through monitoring, retraining, and handling model drift.
  • Compare batch processing vs. stream processing for a real-time analytics system. What are the latency, throughput, and complexity trade-offs?
  • Design a ride-sharing backend (matching, pricing, routing). How would you partition data, handle hot spots, and ensure consistency?
Practice
  • Design a URL shortener from scratch: sketch the data model, estimate QPS and storage, choose a replication strategy, and explain how you'd handle partitioning and hot keys.
  • Design a news feed system: define the fan-out strategy (push vs. pull), sketch the schema, estimate cache hit rates, and explain consistency guarantees.
  • Design a ride-sharing backend: handle real-time matching, pricing, and routing; discuss how you'd partition by geography, handle surge pricing, and ensure low latency.
  • Compare two database choices for a given use case (e.g., PostgreSQL vs. MongoDB for a user profile store). Write a 1-page analysis of trade-offs.
  • Implement a simple LSM tree or B-tree simulator in code to understand how indexing affects read/write performance under different workloads.
  • Design an ML recommendation system end-to-end: define the problem, sketch the data pipeline, feature engineering, model training cadence, and serving architecture.
  • Mock interview: spend 45 minutes designing a large-scale system (e.g., video streaming, payments, inventory management) with a peer or mentor; record yourself and review for clarity and depth.
  • Create a replication strategy decision tree: given a use case, walk through when to choose single-leader, multi-leader, or leaderless replication.

Next up: This stage equips you to confidently architect distributed systems and ML pipelines at scale; the next stage will likely focus on diving deeper into specific technologies (databases, message queues, ML frameworks) and practicing rapid prototyping under interview time pressure.

Designing Data-Intensive Applications
Martin Kleppmann · 2017 · 618 pp

The deepest, most respected book on how real distributed systems actually work — databases, replication, consistency, and streaming. Reading this first gives you the conceptual vocabulary to reason about any system design question.

Machine Learning System Design Interview
Ali Aminian · 2023 · 294 pp

Translates distributed systems concepts directly into the interview format with step-by-step walkthroughs of 16 classic system design questions. Read after Kleppmann so you understand the 'why' behind every design decision Alex Xu recommends.

5

Behavioral & The Complete Interview Game

Intermediate

Craft compelling, structured behavioral stories, negotiate offers confidently, and develop the full-loop interview strategy that ties all technical preparation together.

Study plan for this stage

Pace: 4–5 weeks, ~40–50 pages/day, with 2–3 days per week dedicated to behavioral storytelling practice and mock interviews

Key concepts
  • The STAR method (Situation, Task, Action, Result) for structuring behavioral narratives that demonstrate impact and leadership
  • How to identify and articulate your core strengths, weaknesses, and motivations in a way that aligns with PM/interview expectations
  • The complete interview loop: technical assessment, behavioral evaluation, case studies, and how they interconnect
  • Negotiation fundamentals: understanding your leverage, researching market rates, and anchoring offers strategically
  • Storytelling frameworks that showcase problem-solving, cross-functional collaboration, and data-driven decision-making
  • How to handle difficult questions (failures, conflicts, gaps) by reframing narratives to highlight learning and growth
  • The full-loop strategy: how behavioral stories, technical preparation, and case study skills work together to create a cohesive candidacy
You should be able to answer
  • How do you structure a behavioral story using STAR, and what makes a PM-specific story compelling versus generic?
  • What are your top 3–5 core strengths and how would you demonstrate each one with a concrete example from your background?
  • How do you handle a question about a failure or weakness in a way that shows growth and self-awareness rather than defensiveness?
  • What is your negotiation strategy: how will you research your market value, set your anchor, and respond to a lowball offer?
  • How do the behavioral, technical, and case study components of an interview reinforce each other, and how does your preparation address all three?
  • What are the key differences between PM interview expectations and other roles, and how does your storytelling reflect PM-specific competencies?
Practice
  • Write out 5–7 STAR stories covering different competencies (leadership, conflict resolution, data-driven decisions, failure/learning, cross-functional collaboration, ambiguity, and impact). Aim for 2–3 minutes per story when spoken aloud.
  • Record yourself telling one behavioral story, then listen back and identify: unclear moments, filler words, lack of specificity, and missing impact metrics. Re-record until it feels polished.
  • Conduct 3–4 mock behavioral interviews with a peer, friend, or mentor. Have them ask follow-up questions and rate your clarity, authenticity, and PM-relevance on a 1–10 scale.
  • Research salary data for your target role/company using Levels.fyi, Blind, Glassdoor, and your network. Document your target range, walk-away number, and negotiation talking points.
  • Create a one-page 'interview narrative' that ties together your background, core strengths, PM philosophy, and why you're pursuing this specific role. Use this as your north star for all behavioral responses.
  • Practice handling 4–5 tough questions (e.g., 'Tell me about a time you failed,' 'Why are you leaving your current role?', 'What's your biggest weakness?') by writing out responses first, then delivering them conversationally.

Next up: Mastering behavioral storytelling and negotiation strategy equips you to confidently navigate the entire interview loop, allowing you to seamlessly integrate technical problem-solving, case study analysis, and interpersonal communication into a unified, compelling candidacy that stands out to hiring teams.

Cracking the PM Interview
Gayle Laakmann McDowell · 2013 · 363 pp

Despite the PM title, its chapters on behavioral interviews, resume crafting, and offer negotiation are the most actionable available and apply directly to software engineering candidates at any level.

Discussion

Keep reading

Paths that share books, cover the same subject, or open a related topic.

Shares 3 books

Software engineering: the best books to read in order

Beginner10books92 hrs4 stages
Shares 2 books

The Best Competitive Programming Books, in Order

Beginner9books124 hrs5 stages
More on Web accessibility

Best Books on Web Accessibility, in Reading Order

Beginner6books33 hrs4 stages
More on Web performance optimization

Best Books on Web Performance, in Reading Order

Beginner8books39 hrs4 stages

More on coding interview preparation