InterviewLegend

Design a Car System

Commonly asked
Alex Chen20 min readAdded 116 real interview reports

This prompt comes from one first-hand report, an SDE-1 Java loop in Pune written up in October 2025 by a candidate with about a year and a half of experience. It came up in the first technical round, a screen. The same round asked them to explain OOP to a five-year-old and to print the prime numbers in a range. The candidate called the round simple and conceptual. That tells you how big the answer should be. Plan for a whiteboard of classes and a short conversation about patterns. This isn't an hour of machine coding, and there are no servers to size.

The candidate's later rounds show what the loop cares about. In the bar raiser round they debugged two buggy Java snippets, and one of them was a Singleton. The hiring manager asked which design patterns they knew. They named Singleton, Factory, Builder and Observer, and the manager asked them to explain Builder. A car gives three of those four a natural home, so practicing it covers ground the later rounds came back to.

A car is the textbook OOP example, which helps and hurts. Everyone has seen a Car class that extends Vehicle, and the round is checking whether you get past that. A car has an engine. It comes in models and variants, and a buyer picks from a long list of options. Each of those points to a specific choice: composition for the engine, a Builder for the options, a Factory for the models. Make those three choices, say why, and you've answered the prompt.

The Mastercard angle
Mastercard is a Java and Spring shop, and its loops lean hard on Java internals. So answer in Java. Give the engine an interface, make the car a final class, and have each builder method return the builder. Name the SOLID principle as you make each choice.

MastercardPremium lesson · System design round

The Mastercard design, worked end to end.

  1. Requirements and scopeSystem design
  2. The API and data model
  3. The design, drawn out1 diagram
  4. 4 deep divesWith the tradeoffs
Get the Mastercard questions

$49 a year · all 107 companies · instant access

116 Mastercard interview reports · guide updated

Mastercard interview guide

Know what Mastercard asks before you walk in.

29 coding · 4 system design · 15 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Had your Mastercard interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.