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.
21 write-ups
| Title | Difficulty |
|---|---|
| Design Connect Four Design Connect Four with gravity drops through column heights, turn checks, wins in four directions found by walking out from the last disc, draws, and room for undo and other board sizes. | Easy |
| Design Tic-Tac-Toe Design tic-tac-toe on an N by N board with turn checks, rejected moves, wins and draws, and a win check that costs O(1) per move thanks to running line counters. | Easy |
| Coordinate Threads in Order Make threads take turns in a fixed order with one recipe, shared turn state plus a condition variable, applied to print in order, FooBar, zero-even-odd, H2O and multithreaded FizzBuzz. | Easy |
| Design a Bloom Filter Design a Bloom filter with a packed bit array, k positions from double hashing, sizing from the expected item count and error rate, and a clear account of false positives. | Easy |
| Design a Hit Counter Design a counter that records hits and reports how many arrived in the last 5 minutes, from a growing list to a queue to a fixed ring of 300 one-second buckets, plus per-page counts and thread safety. | Easy |
| Design a Pizza Ordering System Design a pizza shop's ordering system with sizes and toppings, per-pizza billing, and swappable promotions such as BOGO Tuesday and happy hour, picking the best deal for the customer. | Easy |
| Design a Product Rating System Design star ratings and written reviews for an online store: one rating per user, O(1) averages from a running sum, reviews sorted by newest, stars or helpful votes, and a best-rated list. | Easy |
| Design a Smart Thermostat Design a smart thermostat with off, heat, cool and auto modes, a daily schedule with manual holds, several room sensors, and a deadband so the furnace does not flick on and off. | Easy |
| Design a Tag Management System Design the tagging behind GitHub issues and Jira tickets: add and remove tags with one spelling each, list an item's tags, search by all or any tags with an inverted index, and rank popular tags. | Easy |
| Design a Traffic Light Controller Design the controller for a two-road crossroads: green and yellow phases on timers, a rule that two roads are never green at once, and a pedestrian button that adds a walk phase. | Easy |
| Design a Traffic-Light Intersection Design a thread-safe controller for a two-road intersection: cars from four directions, one green road at a time, switching only when needed, and no crashes or deadlocks. | Easy |
| Design a URL Shortener Design an in-memory URL shortener with counter-based base62 codes, user-chosen aliases that share the code space, and links that expire after a time to live. | Easy |
| Design a Vending Machine Design a coin-operated vending machine with products, a coin box that pays exact change, a cancel button and a service mode for restocking, using the State pattern. | Easy |
| Design an Apartment Visitor System Design a gated-community visitor system where guards log visitors, residents approve or deny them, guests use pre-approved passes, and the gate always knows who is inside. | Easy |
| Design an Employee Attendance System Design an attendance tracker with badge check-in and check-out, several sessions a day, night shifts split at midnight, a daily present or half-day status, and a per-employee report over a date range. | Easy |
| Design Battleship Design two-player Battleship with validated ship placement, a placement-then-battle game phase, shots that report miss, hit and sunk in constant time, and room for a computer opponent. | Easy |
| Design Browser History Design the back and forward buttons of a browser tab: visit clears forward pages, back and forward move several steps at once, built from one stack to two stacks to an array with a cursor. | Easy |
| Design Minesweeper Design Minesweeper: mine placement kept outside the game, neighbor counts, flood reveal with a queue, flags, and win or lose detection with a counter instead of a board scan. | Easy |
| Design Pastebin Design a paste service with short shareable ids, expiry times, public, unlisted and private visibility, owner-only delete and a list of recent public pastes. | Easy |
| Design Snake Game Design the classic Snake game on a grid: a body stored as a queue plus a set, food that appears one piece at a time, growth, wall and self collisions, and the score after every move. | Easy |