Low-Level Design (Object-Oriented Design) Module 17 – Machine-coding and interview practice
Self-mock: object-oriented design discussion
Run a 45-minute object-oriented design self-mock: a prompt, a timer and notes in five stages, then a sample answer, a rubric and a review log.
What you will learn
- Run a 45-minute self-mock with a prompt, a timer and structured notes
- Compare your answer with a sample answer and a four-level rubric
- Track weak areas across mocks with a review log on spaced intervals
Before you start
What you’ll learn · Before you start
What you will learn
- Run a 45-minute self-mock with a prompt, a timer and structured notes
- Compare your answer with a sample answer and a four-level rubric
- Track weak areas across mocks with a review log on spaced intervals
Before you start
On this page
An object-oriented design (OOD) discussion round asks you to design the classes for a prompt and talk them through in about 45 minutes, on a whiteboard or in a shared document, usually with little or no running code. A self-mock rehearses that round alone. You take a prompt you have not seen, start a timer, and work through five stages while writing notes in a fixed layout. Only after the timer stops do you compare your notes with a sample answer and score them on a rubric. The sample answer shows one good answer, not the only one; the rubric keeps your scores consistent from one mock to the next, so that your weak areas become visible.
The five stages and the first prompt
The 45 minutes follow the budgets of the answer framework for a discussion round, and each stage ends with something written down:
The five stages of the self-mock and the review after it
Text description of the diagram
The diagram is a column of six boxes joined by arrows, from top to bottom.
- Minutes 0 to 5, clarify: the questions, numbered requirements, an out-of-scope list and assumptions.
- Minutes 5 to 20, model: the classes, the rule each one owns, and the options rejected.
- Minutes 20 to 30, diagrams: a class diagram, and one state or sequence diagram.
- Minutes 30 to 40, key code: the method that holds the hardest rule, with its tests named.
- Minutes 40 to 45, follow-ups: where each requested change lands.
- After the timer: compare the answer with the sample answer, score the five areas of the rubric, and log the weak ones for review.
The first prompt: Members of a neighbourhood tool library borrow tools such as hammer drills, ladders and pressure washers. They reserve a tool for a few days, collect it and bring it back. The library has a few items of each tool, takes a deposit, and charges for lateness and damage. Design the classes.
Ask your questions before you model anything. In a self-mock, the interviewer’s answers sit on a card that you read only after writing a question down. For this prompt the card says: members reserve a tool type, not a particular item; a reservation lasts 1 to 7 whole days; a tool is collected on the first day and returned by closing time on the last; every late day costs a fee taken from the deposit; a member may hold 2 reservations at once. In the worked mock that follows, five questions in the first four minutes drew out every answer on this card.
Keep the notes in five boxes, one per stage, so that the review can compare like with like:
# Self-mock notes: (the prompt) 45 minutes, timer running
## 1. Clarify (minutes 0 to 5)
Questions asked, and the answers:
-
Requirements, numbered:
- R1
Out of scope:
-
Assumptions, numbered:
- A1
## 2. Model (minutes 5 to 20)
| Class | Knows | Owns the rule |
|-------|-------|---------------|
| | | |
Options rejected, and why:
-
## 3. Diagrams (minutes 20 to 30)
- Class diagram, with multiplicities:
- One state or sequence diagram, for:
## 4. Key code (minutes 30 to 40)
- The method that holds the hardest rule:
- Its tests, by name:
## 5. Follow-ups (minutes 40 to 45)
| Follow-up | Where it lands | What stays untouched | The test that proves it |
|-----------|----------------|----------------------|-------------------------|
## After the timer
Scores from 1 to 4: clarifying __ · classes __ · diagrams __ · key code __ · trade-offs __
The lowest area, and one thing to do differently in the next mock: When the timer stops, score five areas from 1 to 4, one for each stage:
- Clarifying and scope: the questions you asked and the numbered requirements you wrote.
- Classes and responsibilities: each rule has one owner, and rejected options are named.
- Relationships and diagrams: a class diagram with multiplicities and one diagram of behaviour.
- Key code and API: the method that holds the hardest rule, with its tests named.
- Trade-offs and follow-ups: where each change lands, and when a rejected option would win.
Score after the timer, never during it: a mock you stop to judge is no longer timed. Then add the five scores to a review log, which brings a weak area back as a short drill the next day and lets a strong one wait longer each time. Over a few mocks, the log shows which stage keeps costing you points.
The worked mock, stage by stage Pro: opens with a Pro, Premium or Ultimate pass
In this part:
- Minutes 0 to 5: five questions and six requirements
- Minutes 5 to 20: five classes and two rejected options
- Minutes 20 to 30: the class diagram, and a state diagram drawn too late
- Minutes 30 to 40: the key code, run on nine days
- Minutes 40 to 45: three follow-ups
- The sample answer, and where yours may differ
- The rubric: five areas, four levels each
- The worked mock scored
- A review log on spaced intervals
- Twelve prompts for your next mocks
- Check yourself: calibrate your scores
- Calibration questions
- Interview questions
- What are the stages of a 45-minute object-oriented design discussion, and roughly how long does each take?
- In a design discussion the interviewer says almost nothing for the first ten minutes. How do you keep the discussion useful, and how do you check that you are on track?
- Members of a tool library reserve a tool type for a range of days. How would you model reservations so that overlaps, early returns and late returns are all handled? Name the classes and the one rule each owns.
- Ten minutes remain in a 45-minute discussion. You have a class diagram but no code, and the interviewer asks for "the key code". What do you write, and what do you leave as signatures?
- Key takeaways
2 diagrams · 3 runnable examples (Markdown, Python, tool_library.py, walkthrough.py) · 3 interview answers · about 23 minutes
Opening this part with your pass…
This part opens with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so this part can’t be opened at the moment. The free part above stands on its own. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
Read a complete sample first: Low-level design: parking lot (the model)
References
- Unified Modeling Language (UML) 2.5.1 specification (Object Management Group)
- Distributed practice in verbal recall tasks: a review and quantitative synthesis (Cepeda, Pashler, Vul, Wixted and Rohrer, Psychological Bulletin 132(3)) (American Psychological Association)
- dataclasses: Data Classes (Python Software Foundation)
Related tools
Report a problem with this lesson
Kept only in this browser. Your Learn progress