Before you start
This is the first lesson of the LLD course. Read this first — it takes 3 minutes and explains what the course is about.
Why start with classes and objects?
Every design problem — Parking Lot, Splitwise, Chess, Uber — starts the same way:
- Read the problem.
- Find the real-world things in it.
- Give each thing a class.
You can't do the advanced lessons if step 3 feels hard. This lesson makes step 3 easy.
The mental model
A class is a blueprint. An object is one real thing
built from that blueprint. Book is the blueprint. Your copy
of Designing Data-Intensive Applications is an object.
Two objects built from the same class don't share data. They have the same fields and the same methods, but their values are different.
What a real design interview looks like
The interviewer describes a problem. You have 45 minutes. You need to:
- Ask clarifying questions (3-5 minutes)
- Find the classes you need (5-10 minutes) ← today's lesson
- Sketch how the classes connect
- Write the classes and methods
- Walk through an example with the interviewer
Step 2 is the one nobody teaches. It looks easy, so most
students skip it and start typing code. Then the interviewer
asks "what if the user has two payment methods?" and they're
stuck — because they never made Payment a separate class.
Every lesson in this course drills one piece of this flow.
Today: turning "there's a book in the problem" into
class Book.
About the tests
There's a hidden test_solution.py file that decides
whether your code passes. You can't see it in this
lesson — the objective above tells you everything the
tests check.
Real jobs work the same way: someone tells you the requirements, and you write code to match. The requirements ARE the spec.
The grader runs the tests when you click Submit. Green = pass.
What comes next
The next four lessons cover more OOP basics: encapsulation, inheritance, composition, and polymorphism. Same format — read, write code, get feedback. By the end of the module you'll be ready for the design patterns.