LLD toolbox: data structures and design patterns
Module 3 of the System Design Masterclass. Every lesson here is free to read. No account needed.
- 5 lessons
- 1 h 49 min of reading
- 17Lists, maps and sets: pick by the question you askHow to pick a list, a dictionary or a set by the question you must answer fast: the cost of each operation in steps, keys that are safe to use, sorting with tie-breaks, text order against number order, and copies.26 minCore
- 18Ordered data: heaps, sorted lists, queues and dequesHow to pick a structure when the question is smallest, oldest, next in line, most recent, or between two values: heap, sorted list with bisect, deque, ordered dictionary, and two queues for delayed work.25 minCore
- 19Strategy, Observer and StateThree patterns that machine-coding rounds reward, each on small Python code: swap a rule (Strategy), tell everyone who asked (Observer), and change behaviour with the status (State).20 minCore
- 20Factory, Builder and the Singleton trapThree creation patterns on small Python code, and the cases where each one is the wrong choice, especially the Singleton, which hides shared state and makes tests fail.12 minDepth
- 21Command: undo and redoHow to turn a request into an object with do and undo: two stacks for undo and redo, a history limit, grouped steps, the cursor, and where else the same idea appears.26 minCore
Want help while you learn?
Reading is free for everyone. A free account adds the AI tutor, quizzes, notes and your progress.