Low-level design
Object-oriented design for interviews: the framework, design principles and patterns, concurrency, and problem breakdowns you can practice in the code runner.
Object-oriented design for interviews: the framework, design principles and patterns, concurrency, and problem breakdowns you can practice in the code runner.
12 write-ups
| Title | Difficulty |
|---|---|
| Design Chess Design a two-player chess game with piece movement rules, move validation that respects check, checkmate and stalemate detection, and a move history with undo. | Hard |
| Design a Collaborative Document Editor Design a Google Docs style document server: concurrent edits rebased onto the latest text, a version history you can read at any point, and nested comments anchored to text that moves. | Hard |
| Design a Concurrent Hash Map Design a thread-safe hash map from scratch, from one global lock to lock striping, with atomic putIfAbsent and increment, a cheap size counter, and resizing without deadlock. | Hard |
| Design a Garbage Collector Design a garbage-collected heap with roots, references and automatic collection, compare reference counting with mark-and-sweep, and see why cycles and deep chains shape the design. | Hard |
| Design a Key-Value Store with Transactions Design a Redis-like in-memory key-value store with expiring keys, nested begin/commit/rollback transactions, and a write-ahead log so committed data survives a crash. | Hard |
| Design a Memory Allocator Design a malloc-style allocator over a fixed heap with allocate, free and reallocate, first-fit and best-fit placement, block splitting, coalescing of free neighbours, and fragmentation stats. | Hard |
| Design a Message Queue Design a Kafka-like message queue with partitioned append-only logs, key-based partitioning, consumer groups with rebalancing, committed offsets, time-based retention and thread-safe producers and consumers. | Hard |
| Design a Multi-Level Cache Design an L1/L2 cache in front of a slow store, with LRU eviction per level, promotion on reads, write-through and write-back policies, and a distributed version with consistent hashing and quorums. | Hard |
| Design a Skiplist Design a skip list with search, add and erase in O(log n) on average: a sorted linked list with express lanes, random node heights you can replay, duplicates, and the follow-ups on maps, ranks and threads. | Hard |
| Design a Spreadsheet Design a spreadsheet whose cells hold numbers or formulas, with a dependency graph that recalculates every affected cell once in topological order and rejects circular references. | Hard |
| Design an In-Memory Database Design an in-memory database with typed tables, SQL-like select, update and delete with WHERE and ORDER BY, and sorted indexes that stay in sync and speed up queries without changing results. | Hard |
| Design an Order Matching Engine Design a stock exchange's order book and matching engine with limit and market orders, price-time priority, partial fills and cancels, matched in batch first and then as a stream. | Hard |