LESSON 11.1
The machine coding approach
Master the 90-minute low-level design interview: requirement scoping, entity modeling, API design, pattern selection, and test-driven implementation.
6 min read
The Machine Coding Round is the standard practical interview for mid-to-senior software engineers at companies like Uber, Flipkart, Swiggy, and Razorpay. In 90 to 120 minutes, you must design and code a fully working, extensible, and tested object-oriented application from scratch.
Unlike algorithm rounds (LeetCode), Machine Coding tests real-world software craftsmanship: can you design clean entities, adhere to SOLID, pick the right patterns, and ship working code under time constraints?
The 5-Phase Time Plan (90 Minutes)
- Clarify Requirements & Bounds (15 min):
- Identify actors and primary use cases (e.g.
ParkVehicle,UnparkVehicle,CalculateFee). - Define constraints: single-floor or multi-floor? In-memory or database? Thread-safe?
- Identify actors and primary use cases (e.g.
- Entity & Interface Modeling (15 min):
- Identify nouns (Entities, Value Objects) and verbs (Operations).
- Define interfaces for repositories, strategies, and external services.
- Core Business Logic & Pattern Integration (40 min):
- Implement domain entities with invariant enforcement.
- Inject strategies (pricing, allocation, dispatch).
- Driver / CLI / Integration (10 min):
- Wire up the controller or command runner to execute user inputs.
- Testing & Edge Cases (10 min):
- Write automated unit tests verifying core paths and boundary failures.
In code
Common Traps to Avoid
- The Database Trap: Do not spend 45 minutes configuring SQLite, Prisma, or Docker unless explicitly asked. An in-memory
Mapwith a Repository interface is expected and preferred. - The Perfection Trap: Do not over-engineer with 15 GoF patterns on line 1. Write the simplest working domain code first, then refactor.
- The Silent Coder Trap: Talk through your trade-offs with the interviewer as you type.
Related patterns
- Strategy: For pluggable allocation algorithms (nearest to entrance, lowest floor).
- State: For entity lifecycles (available, reserved, maintenance).
Try it
Parking Lot LLD
Design a multi-level parking lot with support for multiple vehicle types and dynamic hourly pricing.