SWE Interview Preparation MOC

Map of Content for software-engineering interview preparation. Covers algorithms, data structures, system-design building blocks, and the interview process itself. Each leaf is an atomic note; this page is the index — follow the wikilinks. Notes that don’t yet exist appear gray in Obsidian and act as a TODO list.

How to Use This MOC

  1. Start at Foundations if you don’t already have an internal model of asymptotic analysis. Every other note assumes it.
  2. Pick a category and go deep rather than skimming everything. Interviews reward depth.
  3. Each leaf note follows the same structure: plain-English intuition → tiny worked example → pseudocode → Python → complexity analysis with proof sketch → variants → common interview problems → pitfalls. Read the whole note; the pitfalls section is where the interview-relevant nuance lives.
  4. Code in two forms: pseudocode (for the algorithm structure, language-agnostic) and Python (for a runnable example you can paste into an editor and probe).

Uncertain

Interview content evolves with hiring trends. The list below reflects the current consensus of what shows up in 2024–2026 FAANG-style and broader-tech-company loops, but specific company practices drift. Verify against recent (last 12 months) interview reports for any specific employer before committing prep time to a niche topic.


0. Foundations — Asymptotic Reasoning

The vocabulary every other note uses. If you can’t read these comfortably, the rest will not stick.

1. Sorting

The single most over-asked category historically. Modern interviews have shifted away from “implement quicksort” toward “use a sort and reason about its cost,” but every variant below is fair game.

Comparison Sorts

  • Bubble Sort — pedagogical only; never used in production but interviewers ask “what’s wrong with it”
  • Insertion Sort — O(n²) worst, but O(n) on nearly-sorted; used as base case in real sort libs
  • Selection Sort — O(n²) always; useful only for write-minimization (rare)
  • Merge Sort — D&C; stable; O(n log n) guaranteed; O(n) extra space
  • Quicksort — in-place; O(n log n) average, O(n²) worst; pivot strategy matters
  • Heap Sort — O(n log n) worst; in-place; not stable
  • Tim Sort — Python and Java’s default; merge + insertion hybrid; adaptive
  • Intro Sort — C++ std::sort; quicksort + heap-sort fallback

Non-Comparison Sorts

  • Counting Sort — O(n + k) where k is the value range; only for bounded integers
  • Radix Sort — O(d · (n + b)) for d-digit numbers in base b; can beat O(n log n) for fixed-width keys
  • Bucket Sort — O(n) expected for uniformly distributed inputs
  • Quickselect — find k-th smallest in O(n) average; Hoare’s algorithm
  • Median of Medians — O(n) worst-case k-th selection; theoretically beautiful, rarely used

2. Searching

  • Linear Search — baseline; mention in interviews when O(log n) isn’t possible
  • Binary Search — the workhorse; three templates (exact / leftmost / rightmost); off-by-one minefield
  • Binary Search on Answer — when the answer space is monotonic, binary-search the answer (e.g., “minimum capacity to ship in D days”)
  • Ternary Search — for unimodal functions; rare in interviews
  • Exponential Search — for unbounded or unknown-length sorted sequences
  • Interpolation Search — for uniformly distributed sorted data

3. Arrays & Strings — Core Patterns

Patterns more than algorithms. Recognizing the pattern from the problem statement is the skill.

4. Hashing

  • Hash Table — open addressing vs chaining; load factor; amortized O(1)
  • Hash Function Design — universal hashing, MurmurHash, SipHash; what makes a hash “good”
  • Bloom Filter — probabilistic membership; no false negatives, controllable false positives — also in System Design
  • Count-Min Sketch — probabilistic frequency counting
  • HyperLogLog — probabilistic cardinality estimation

5. Linked Lists

6. Stacks, Queues, Deques

7. Trees

Binary Trees

Self-Balancing Trees

  • AVL Tree — strict balance via rotations; tighter than RB
  • Red-Black Tree — balanced via color invariants; backs Java’s TreeMap, C++ std::map
  • B-Tree / B+ Tree — multi-way; backs database indexes
  • Treap — randomized BST + heap on priority; simple to reason about
  • Splay Tree — amortized O(log n); recently-accessed near root

Tries

Range Query Trees

8. Heaps & Priority Queues

9. Graphs

Representations

Traversal

Shortest Paths

Minimum Spanning Tree

Connectivity

Topological Order & DAGs

Flow & Matching

10. Dynamic Programming

The category most candidates fear. The pattern is: identify state, write recurrence, choose top-down (memoization) or bottom-up (tabulation), optionally compress space.

Foundational Patterns

1D Sequence DP

2D Sequence DP

Knapsack Family

Interval DP

DP on Trees

  • Tree DP — children-then-parent post-order DP
  • Rerooting DP — answer for every root in O(n) total

DP on Graphs / Bitmask DP

Digit DP & Other Specialized

DP Optimizations

11. Greedy

12. Divide and Conquer

13. Backtracking

14. String Algorithms

15. Bit Manipulation

16. Math & Number Theory

17. Computational Geometry

18. Concurrency (Interview Subset)

19. System Design Adjuncts

For complete industry-scale system designs (URL shortener, Twitter, YouTube, Uber, S3, Kafka, etc.), see Major System Designs MOC. For architectural styles and patterns (monolithic, microservices, event-driven, hexagonal, CQRS, sagas, circuit breakers, etc.), see System Architectures MOC. This section catalogs the components you assemble; those MOCs catalog the assembled systems and the organizational shapes respectively.

Algorithmic building blocks of system-design rounds. These are not full system designs — they’re the components.

Caching

Hashing & Sketches

Rate Limiting

Distributed Systems Algorithms

Storage

  • LSM Tree — log-structured merge tree; backs LevelDB, RocksDB, Cassandra
  • B+ Tree — also under trees; backs traditional RDBMS indexes
  • Inverted Index — text search backbone

20. Behavioral & Interview Process

The non-coding half. Often the differentiator for senior roles.

Storytelling

Coding-Interview Process

System Design Rounds

Process & Negotiation


Cross-Cutting Pitfall Notes

Notes that apply across many algorithms:


Open Threads

  • Coverage gap: This MOC currently lists ~150 leaf notes; the bolded ones (foundations + most-asked) are the priority for the first wave of writing.
  • Company-specific addenda: separate sub-MOCs for company-specific patterns (e.g., “Google-style optimization round,” “Meta-style product-sense round”) if there’s enough material.
  • Verify & date-stamp: every claim about “currently used in production at X” needs a citation and a year — these rot fast.
  • Visual aids: heavy-diagram notes (segment tree, suffix array) need either mermaid sequences or PNG attachments in Attachments/.

See Also