LLD INTERVIEW WORKFLOW / OBJECT DESIGN BRIEF

Identify core entities

Step 2: identify the core entities from the agreed use cases.

BeginnerPhase 10 / Topic 2 of 8ResponsibilitiesCollaborationsExtensibility
01

Overview

Step 2: identify the core entities from the agreed use cases. Walk each use case and underline nouns: cinema, screen, seat, movie, show, booking, payment, user. Keep the ones with identity, state, and behavior as classes; turn others into attributes, enums, or value objects. Separate type from instance (Seat in a screen vs ShowSeat for a particular show).

Write the entity list with one-line responsibilities before drawing relationships. Interviewers look for a clean, domain-accurate vocabulary and the key distinctions that make the design work, such as Show vs Movie and Seat vs ShowSeat.

Listing the cast before writing scenes

A playwright first lists the characters and what each wants. Scenes (interactions) come next. Extras without lines become scenery (attributes).

02

When to use it

  • Right after scoping in every LLD interview.
  • When a model feels tangled; re-derive entities from use cases.
03

Where it shows up in interviews

Noun extraction

Recognize it when: use cases written; now pick classes.

  • Design a movie ticket system
  • Design Splitwise
  • Design a car rental system
04

Where it is used in real software

DDD ubiquitous language

Entity names come from how the business talks (Show, Screening, Booking).

ER modeling

Database design follows the same entity discovery.

CRC cards

Class-Responsibility-Collaborator cards speed up entity discovery in workshops.

05

Key terms

Entity
Has identity and lifecycle.
Value object
Defined by values: Money, SeatType, TimeRange.
Type vs instance
Seat (physical) vs ShowSeat (seat for one show).
Service
Stateless coordinator for cross-entity use cases.
06

How it works, step by step

  1. 1
    Extract nouns from use cases

    Write them all down.

  2. 2
    Merge synonyms, drop attributes

    'Hall' = Screen; 'price' is an attribute.

  3. 3
    Find type-vs-instance splits

    Movie vs Show; Seat vs ShowSeat.

  4. 4
    Classify

    Entity, value object, enum, service, external interface.

  5. 5
    One-line responsibility each

    If you cannot state one, reconsider.

07

Entities for the movie ticket system

From the scoped use cases

Step 1 / 8
NameKindResponsibility
MovieEntityTitle, duration, language
Cinema / Screen / SeatEntitiesPhysical layout; seat type
ShowEntityMovie on a screen at a time; owns ShowSeats
ShowSeatEntitySeat state for one show: available, held, booked
HoldEntityTemporary claim with expiry
BookingEntityConfirmed seats, payment reference
Money, SeatTypeValue object / enumPrice and category
BookingService, PaymentGatewayService / interfaceOrchestration / external payments

NOWName: Movie | Kind: Entity | Responsibility: Title, duration, language

The ShowSeat entity is the key insight: seat availability is per show, not per physical seat.

08

Implementation

type SeatType = "regular" | "premium";type Money = Readonly<{ cents: number; currency: "INR" | "USD" }>; class Movie { constructor(readonly id: string, readonly title: string, readonly minutes: number) {} }class Seat { constructor(readonly id: string, readonly row: string, readonly type: SeatType) {} }class Screen { constructor(readonly id: string, readonly seats: readonly Seat[]) {} } class ShowSeat {  status: "available" | "held" | "booked" = "available";  constructor(readonly seat: Seat, readonly price: Money) {}} class Show {  readonly seats: Map<string, ShowSeat>;  constructor(readonly id: string, readonly movie: Movie, readonly screen: Screen, readonly startsAt: Date, price: (s: Seat) => Money) {    this.seats = new Map(screen.seats.map((s) => [s.id, new ShowSeat(s, price(s))]));  }} class Booking { constructor(readonly id: string, readonly showId: string, readonly userId: string, readonly seatIds: string[], readonly total: Money) {} }
09

Complexity and performance

Entities6-10

For a 45-minute design.

Time~5 minutes

Then relationships.

10

Trade-offs

Granularity

Too few entities create god classes; too many add ceremony. Aim for one clear responsibility each.

Model reality vs model behavior

Include only real-world concepts that affect the required behavior.

11

Variants and related techniques

Aggregates

Group Show and its ShowSeats as one consistency boundary.

Event-first discovery

Start from events (SeatHeld, BookingConfirmed) and derive entities.

12

Common mistakes

  • Storing availability on the physical Seat.

    Fix: Availability belongs to ShowSeat (per show).

  • A single Manager class holding everything.

    Fix: Entities own their data and rules; services orchestrate.

13

Interview questions

Why have both Seat and ShowSeat?

A physical seat exists once per screen, but its availability differs for every show. ShowSeat holds per-show state and price, while Seat holds layout information.

How do you decide whether something is a class or an attribute?

If it has identity, its own state, or behavior (a Booking), it is a class. If it only describes something else (a title, a seat row letter), it is an attribute or a value object.

14

Practice problems

ProblemDifficultyWhat it trains
Entities for a food delivery appEasyType vs instance.
Entities for an online auctionMediumLifecycle entities.