TCS Prime Software Engineer — Parking Lot OOP Design
- Field
- Engineering
- Company
- Tata Consultancy Services
- Role
- Prime Software Engineer
- Duration
- 20 min
- Difficulty
- Hard
- Completions
- New
- Updated
- 2026-06-11
How to prepare
What this round tests, what strong and weak answers sound like, and the traps to sidestep.
What this round is about
- Topic focus. You model a small real system, usually a parking lot, in object-oriented terms: classes, responsibilities, relationships, and how the design extends.
- Conversation dynamic. The interviewer gives you a vague design X prompt, lets you think, then pushes one question at a time on every choice you make.
- What gets tested. Whether you can identify entities, assign single responsibilities, choose composition versus inheritance, apply open-closed when a new type is added, and defend it all out loud.
- Round format. Roughly twenty minutes on a shared whiteboard, with a design brief on a card; you sketch the class diagram and talk through it.
What strong answers look like
- Clean decomposition. You name ParkingLot, ParkingSpot, Vehicle and Ticket quickly and give each a one-sentence responsibility without using the word and.
- Defended relationships. You say this is composition because a lot has spots, not is a spot, when the interviewer asks why not inheritance.
- Extension without edits. Asked to add an electric scooter or UPI payment, you add a new subclass behind an interface and name the existing class you do not touch.
- Pattern with a reason. You place a factory or strategy only where it removes real duplication, and you can say a singleton is often a trap.
What weak answers look like (and how to avoid them)
- The god class. One ParkingLot doing parking, payment, tickets and reports. Split responsibilities so each class has one reason to change.
- Definitions without application. Reciting the four pillars but not pointing to where abstraction lives in your design. Always tie theory back to a class on the board.
- Editing old code to extend. Adding a new vehicle type by changing a switch inside an existing class. Extend through an interface instead.
- Over-engineering. Three factories and a strategy for a two-line problem. Keep the first cut simple and say where you would extend later.
Pre-interview checklist (2 minutes before you start)
- Recall the core four. Have ParkingLot, ParkingSpot, Vehicle and Ticket ready as a starting skeleton.
- Have a one-line responsibility per class. Be ready to describe each without the word and.
- Think of one extension. Know how you would add a new vehicle type or payment mode without editing existing classes.
- Identify your private fields. Be ready to say why a field is private and what breaks if it is public.
- Pull up the whiteboard early. Plan to put boxes on the page in the first two minutes rather than narrating in the air.
- Recall the last-slot case. Have a spot-level lock answer ready for two cars reaching the last spot at once.
How the AI behaves
- Probes every claim. It asks you to defend each class split and relationship, not just name it.
- No mid-interview praise. It will not say great answer; it acknowledges the specific choice you made, then pushes.
- Interrupts on the god class and on over-engineering. It pushes back equally on one class doing everything and on too many classes for a tiny problem.
- Adds requirements live. Once you have a design, it introduces a new type or a concurrency case to see how far your design stretches.
Common traps in this type of round
- Coding before designing. Jumping into syntax before the classes and responsibilities exist on the board.
- Responsibility soup. A class you can only describe using the word and, which signals it is doing too much.
- Modify-to-extend. Editing an existing class to add a new vehicle type instead of adding a subclass behind an abstraction.
- Pattern for its own sake. Forcing a factory or singleton where a plain class would do, to look advanced.
- Silent thinking. Going quiet on a hard probe instead of narrating the tradeoff you are weighing.
- Ignoring the edge case. Skipping invalid input or the two-cars-one-spot race when the interviewer raises it.
Sample problems you'll face
The problem below is the same one you'll work through in the live session — no surprises. Read the constraints carefully; the AI persona will refer you to the on-canvas card by problem number.
- 1Design a Parking Lot in Object-Oriented Terms
Design a parking lot system using object-oriented design. Identify the core entities and model them as classes, decide the relationships between them, define the interfaces, and apply the SOLID principles so the design is clean and extensible. The lot has multiple spots of different sizes. Vehicles of different types arrive at an entry, are assigned a compatible free spot, receive a ticket, and pay on exit. The interviewer will ask you to extend the design (a new vehicle type, a new payment mode) without modifying existing classes, to justify why a field is private, to defend composition versus inheritance, and to say where a design pattern genuinely fits. The bar is a design you can defend out loud, not a perfect UML diagram.
Example inputA car drives up to the entry gate; one compact spot and one large spot are free. Later, the operator asks you to also support an electric scooter that needs a charging-enabled spot, and to accept UPI payments in addition to cash.Example outputParkingLot holds a collection of ParkingSpot objects (has-a, composition). Vehicle is an abstract base with Car, Motorcycle and Truck subclasses (is-a). assignSpot returns a compatible ParkingSpot and issues a Ticket. To add ElectricScooter, add a new Vehicle subclass and a charging-capable spot type without editing ParkingLot; to add UPI, add a new implementation behind a PaymentProcessor interface. The last free spot is protected by a spot-level lock so two cars cannot both claim it.- Identify the entities and model them as classes; give each class a single responsibility you can state in one sentence without using the word and.
- Decide each relationship explicitly as has-a (composition or aggregation) or is-a (inheritance), and be ready to defend the choice.
- Apply SOLID: especially single responsibility, and open-closed so a new vehicle type or payment mode can be added without modifying existing classes.
- Encapsulate internal state behind methods; be ready to justify why each exposed field is public and each hidden field is private.
- Use a design pattern (factory, strategy, observer) only where it removes real duplication or coupling; do not force a pattern, and treat singleton with caution.
- Handle the concurrency edge case where two vehicles reach the last free spot at the same time by protecting the allocation step.
- On the whiteboard, draw the class diagram: one labelled box per class, and label every connecting line as has-a or is-a so the relationships are readable without narration.
The full breakdown
How you're scored, the questions candidates ask most, and the research this interview is built on. Skim it — or just start the interview.
Interview framework
You will be scored on these 6 dimensions. The full rubric with definitions is below.
What we evaluate
Your final scorecard breaks down across these dimensions. The full rubric and tier criteria are revealed inside the interview itself.
- Class Decomposition Clarity22%
- Relationship Modelling Reasoning20%
- Open-Closed Extension Handling22%
- Encapsulation Defense Depth13%
- Pattern Placement Judgment12%
- Design Tradeoff Self-Awareness11%
Common questions
Sources this interview is built on
Real candidate-report URLs (Glassdoor / AmbitionBox / PrepInsta / GeeksforGeeks / Medium) reviewed when authoring the questions, persona, and rubric. Verify the realism yourself.
- Shocking TCS Prime Interview Experience 2026 - Code Bridgecodebridg.in
- TCS Prime Sample Interview Questions and Answers 2026placementpreparation.io
- Top 20 Low Level Design Interview Questions [2026 Guide]lowleveldesignmastery.com
- Parking Lot Low Level Design | Hello Interviewhellointerview.com
- What is Low Level Design? The Complete 2026 Guidelowleveldesignmastery.com