15 LLD Interview Questions & Answers

That nervous feeling before a technical interview is something all of us have faced. Your palms get sweaty as you think about how to discuss system design and low-level details that might make or break your chances. You’ve practiced coding challenges, but those Low-Level Design (LLD) questions still make you doubt yourself.

I’ve coached hundreds of candidates through this exact situation, and I can tell you with confidence: with the right preparation, you can turn LLD questions from a weakness into your greatest strength. Let’s walk through the most common questions you’ll face and how to tackle them with clarity and confidence.

LLD Interview Questions & Answers

These questions represent what interviewers are really looking for when they assess your ability to design components and classes at a detailed level.

1. How would you design a parking lot system?

This question tests your ability to identify objects, relationships, and operations in a real-world scenario. Interviewers ask it because parking lot design incorporates many core object-oriented principles like inheritance, encapsulation, and polymorphism.

When answering, start by defining the key entities such as ParkingLot, ParkingSpot, Vehicle, Ticket, and Payment. Focus on establishing clear relationships between these entities and defining their attributes and behaviors.

Always consider edge cases like different vehicle sizes, payment methods, and how to handle situations like a full parking lot or ticket loss.

Sample Answer: I would approach this design by first identifying the main classes: ParkingLot, ParkingSpot, Vehicle, Ticket, and PaymentProcessor. The ParkingLot would contain multiple ParkingSpots, each with attributes like size (compact, regular, handicapped) and status (available, occupied). Vehicles would be categorized by type and size. When a vehicle enters, the system checks for available spots matching the vehicle size, assigns one if available, and generates a Ticket with entry time. Upon exit, the system calculates fees based on duration, processes payment, and frees up the spot. For extensibility, I’d use interfaces for payment processing to easily add new payment methods in the future.

2. Can you design a library management system?

This question examines your grasp of relationship complexity between users, books, and operations like borrowing and returning. Employers want to see if you can handle a system with various user roles and access restrictions.

For a strong answer, outline the core classes like Library, Book, User, and Transaction. Define how books are cataloged, borrowed, returned, and how fines are calculated.

Demonstrate your understanding of authorization by explaining how different user roles (member, librarian, admin) have different permissions within the system.

Sample Answer: My design would center around key classes including Book, User, Catalog, and Transaction. Books would have properties like ISBN, title, author, category, and availability status. Users would include Members, Librarians, and Admins with appropriate inheritance. The Catalog would manage searching and filtering of books. The Transaction class would handle borrowing, returning, and reservation operations with appropriate validations. For example, when a member requests to borrow a book, the system would check availability, member status (active/blocked), and lending limits before creating a transaction with due dates. I’d implement notifications for due dates and integrate a fine calculation system for overdue returns.

3. How would you design a chess game?

This question helps interviewers assess your ability to model complex rule-based systems with many interacting parts. Chess combines object hierarchies, state management, and rule enforcement—all crucial aspects of software design.

Your answer should define the game board representation, piece hierarchy, movement validation, and game state tracking. Explain how you’d implement special moves like castling and en passant.

Talk about how you’d separate game rules from the UI to maintain clean architecture and allow for potential AI players or network play.

Sample Answer: I’d structure the chess game around classes like Board, Piece (with subclasses for Pawn, Knight, Bishop, etc.), Player, and Game. The Board would be an 8×8 grid storing piece positions, while each Piece subclass would implement its own movement validation. The Game class would manage turns, check for check/checkmate conditions, and track game history for undos and move validation. For special moves, I’d implement rule validators in the appropriate classes—for example, castling logic would verify the king and rook haven’t moved and that spaces between are empty and not under attack. I’d use the Observer pattern to notify the UI of game state changes, keeping the core game logic independent from the presentation layer.

4. Design a movie ticket booking system

This question evaluates your ability to handle concurrent operations and resource allocation. Employers are interested in how you manage conflicts when multiple users might try to book the same seat simultaneously.

In your response, outline the main components like Theater, Show, Seat, Booking, and Payment. Explain locking mechanisms to prevent double bookings and how you’d handle payment timeouts.

Detail how you would implement seat selection visualization and the booking workflow from seat selection to payment confirmation.

Sample Answer: My design would include classes for Theater, Screen, Show, Seat, Booking, and Payment. The system would display available seats for a selected show using a SeatMap class. When a user selects seats, I’d implement a temporary reservation with a time limit (perhaps 10 minutes) using a locking mechanism. This prevents double-booking by marking seats as “temporarily reserved” in the database with proper transaction isolation. The booking process would flow through states like SeatSelected, PaymentPending, and Confirmed. If payment isn’t completed within the time window, the reservation would automatically expire, releasing the seats. For concurrent access, I’d implement optimistic locking with version control to detect conflicts and handle race conditions gracefully.

5. How would you design a hotel management system?

This question tests your ability to model a multi-faceted business with interconnected operations. Interviewers want to see if you can handle complex workflows while maintaining data consistency.

Your answer should cover room inventory management, reservation systems, check-in/check-out processes, and billing. Explain how you’d handle room availability, booking conflicts, and cancelation policies.

Discuss how different user roles like guests, front desk staff, and administrators would interact with the system and what permissions they would have.

Sample Answer: I would design the hotel management system with classes like Hotel, Room, Guest, Reservation, and Payment. Rooms would be categorized by type (Standard, Deluxe, Suite) with attributes like capacity, pricing, and amenities. The reservation system would handle booking workflow including availability checking, confirmation, and modification. To manage availability, I’d implement a calendar-based system that prevents overbooking by atomically updating room status. For the check-in process, the system would verify reservation details, collect payment information, and assign an actual room number. The billing component would track all chargeable services and generate invoices. To ensure data consistency, I’d use transactions for critical operations like reservations and payments, with proper error handling for edge cases like early departures or room changes.

6. Design an online shopping cart system

This question assesses your understanding of e-commerce workflows and transactional systems. Employers want to know if you can design systems that handle money reliably and securely.

When answering, outline the components like Product Catalog, Cart, Order, and Payment Processing. Detail how products are added to carts, how inventory is managed, and how orders are processed.

Explain how you’d handle scenarios like items going out of stock between adding to cart and checkout, and discuss strategies for cart persistence across sessions.

Sample Answer: I would structure this system around classes including Product, ShoppingCart, CartItem, Order, and PaymentProcessor. The ShoppingCart would maintain a collection of CartItems, each linking to a Product with quantity. When adding items, the system would check inventory availability but only reserve stock during checkout. For cart persistence, I’d use a combination of database storage for logged-in users and browser storage (cookies/localStorage) for guests, merging carts when a user logs in. The checkout process would involve creating an Order object, verifying inventory, calculating totals with tax and shipping, and initiating payment processing. To handle concurrency, I’d implement inventory locking during the checkout transaction, with a short timeout to prevent deadlocks. The system would also include order status tracking and notification mechanisms for order confirmation and shipping updates.

7. How would you design a file system?

This question explores your understanding of fundamental computer science concepts. Interviewers use it to gauge your knowledge of hierarchical structures, access control, and resource management.

Your response should cover directory structure representation, file metadata storage, file operations (create, read, write, delete), and permissions management.

Discuss trade-offs between different implementation approaches and how you’d handle edge cases like concurrent access, large files, or deep directory nesting.

Sample Answer: I would model the file system with classes like FileSystem, Directory, File, and User. The core structure would use a tree where Directory objects can contain Files or other Directories. Each File would store metadata (name, size, creation/modification times, owner) separately from content for efficient directory listing. For file operations, I’d implement method handlers for create, read, write, delete with appropriate permission checking. To handle large files efficiently, I’d use a chunked storage approach, breaking files into fixed-size blocks with a reference table. For concurrent access, I’d implement a locking mechanism at the file level using readers-writer locks to allow multiple simultaneous reads while ensuring exclusive access for writes. Permissions would follow the Unix-style owner/group/others model with read/write/execute flags, implemented as bit masks for efficient storage and checking.

8. Design a ride-sharing application like Uber

This question tests your ability to design location-based services with real-time updates. Employers want to see if you can handle complex matching algorithms and state transitions.

When answering, outline components like User (with Rider and Driver subclasses), Trip, Location tracking, and Payment. Explain the rider-driver matching algorithm and how you’d handle trip state management.

Discuss how you’d implement features like surge pricing, fare estimation, and driver/rider ratings.

Sample Answer: My design would center around entities like User (with Rider and Driver specializations), Trip, Location, and Payment. The core flow starts when a Rider requests a ride, specifying pickup and destination locations. The system would use a matching service to find nearby Drivers based on geospatial indexing (using something like a quad tree or geohash). For real-time location updates, I’d implement a WebSocket connection that regularly updates position data from the driver’s device. The Trip would progress through states (Requested, Accepted, InProgress, Completed, Canceled) with appropriate validations and notifications at each transition. For fare calculation, I’d design a flexible pricing service that considers distance, time, demand, and special conditions. The rating system would allow both parties to rate each other after trip completion, updating their average scores. To handle peak demands, I’d implement a surge pricing algorithm that adjusts rates based on the supply-demand ratio in specific geographic zones.

9. How would you design a social media platform?

This question examines your understanding of highly scalable systems with complex user interactions. Interviewers want to assess how you handle features like feeds, connections, and content sharing.

Your answer should detail the core entities like User, Post, Comment, and Connection. Explain how you’d implement the news feed algorithm and content discovery features.

Discuss privacy controls, notification systems, and how you’d optimize for read-heavy operations typical of social platforms.

Sample Answer: I would design this platform with key components including User, Post, Comment, Like, and Connection (Friend/Follow) classes. The feed generation would use a combination of approaches—a push model that pre-computes feeds for active users and a pull model that generates feeds on-demand for less active users. For the User class, I’d implement privacy settings that control visibility of different content types to different connection groups. The Post class would support various content types (text, image, video) through composition, with metadata for discovery. For efficient content delivery, I’d implement a caching strategy with time-based invalidation for popular content. The notification system would use an Observer pattern, allowing users to subscribe to different event types. For scalability, I’d partition data by user to distribute load, and implement a read-replica strategy to handle the high read-to-write ratio typical of social platforms.

10. Design a task management system like Jira

This question assesses your ability to design workflow systems with customizable business rules. Employers want to see if you can model complex state machines and permission systems.

In your response, outline entities like Project, Task, User, and Workflow. Explain how tasks move through different states and how you’d implement custom workflows per project.

Discuss features like task assignment, due dates, priorities, and reporting mechanisms.

Sample Answer: My design would include classes like User, Project, Task, Workflow, and Comment. The Task would be the central entity with attributes for title, description, assignee, reporter, status, priority, and due date. Each Project would have its own customizable Workflow defining valid task statuses and transitions. I’d implement this using a state machine pattern, where each status has defined allowed transitions with optional validation rules. For access control, I’d use a role-based permission system with Project-specific roles that can be assigned to Users. The reporting system would leverage a query builder pattern to construct filtered views of tasks. For notifications, I’d implement both in-app alerts and email options using the Observer pattern, allowing users to subscribe to specific events like task assignment or status changes. The system would also include audit logging for all significant actions to support compliance requirements and provide change history.

11. How would you design a logging system?

This question evaluates your understanding of high-throughput systems and data processing pipelines. Interviewers want to see if you can design for performance and reliability.

Your answer should cover log generation, collection, storage, and querying. Explain different log levels and how they would be used for filtering.

Discuss strategies for handling high volumes of logs, retention policies, and search capabilities.

Sample Answer: I would design a logging system with components like Logger, LogEntry, LogProcessor, and LogStorage. The Logger would provide methods for different severity levels (DEBUG, INFO, WARNING, ERROR, FATAL) with appropriate filtering capabilities. Each LogEntry would contain timestamp, level, source, message, and structured metadata for better searching. To handle high throughput, I’d implement an asynchronous architecture using a buffer queue where logging calls return immediately after adding to the queue, with separate worker threads handling processing and storage. For storage, I’d use a tiered approach—recent logs in fast storage for quick access, with older logs compressed and moved to cheaper storage based on configurable retention policies. The query interface would support filtering by all fields and use indexing for common query patterns. For distributed systems, I’d add correlation IDs to track requests across services, and implement aggregation capabilities to consolidate related logs from multiple sources.

12. Design a calendar application

This question tests your ability to handle date and time complexities and recurring events. Employers want to assess your understanding of event scheduling and user availability management.

When answering, outline classes like Calendar, Event, Reminder, and User. Explain how you’d implement recurring events using patterns, and how you’d handle timezones.

Discuss features like event sharing, invitations, and conflict detection when scheduling.

Sample Answer: I would structure the calendar application around classes like User, Calendar, Event, and Reminder. The Event class would have properties for title, description, location, start/end times, and attendees. For recurring events, I’d implement a RecurrencePattern class that defines frequency (daily, weekly, monthly, yearly) with options for specific days, end dates, or occurrence counts, following the iCalendar RFC specification. To handle time zones correctly, I’d store all times in UTC with explicit user time zone preferences for display. The scheduling system would include conflict detection that identifies overlapping events and provides warnings or alternatives. For sharing and collaboration, I’d implement access control where each Calendar has an owner and additional users with specific permissions (read, modify, admin). The invitation system would support sending requests to both internal users and external email addresses, tracking responses, and updating event status accordingly. Reminders would be configurable with multiple notification methods and customizable lead times.

13. How would you design a chat application?

This question examines your knowledge of real-time communication systems. Interviewers want to see if you understand synchronous operations and message delivery guarantees.

Your response should cover components like User, Conversation, Message, and Connection management. Explain how you’d implement one-to-one and group chats, and how offline message delivery would work.

Discuss features like read receipts, typing indicators, and how you’d handle media attachments.

Sample Answer: My chat application design would center around User, Conversation, Message, and Connection classes. For real-time messaging, I’d implement WebSocket connections for active users with fallback to polling for limited-connectivity situations. Messages would have types (text, media, system) and status tracking (sent, delivered, read). For message synchronization, each message would have a unique ID and timestamp, allowing clients to request only newer messages than their last received one. Group conversations would have additional properties for participants, roles, and permissions. To handle offline scenarios, messages would be stored server-side and delivered when the recipient reconnects, with push notifications alerting users of new messages. For media sharing, I’d implement progressive loading with thumbnails and optimized delivery based on connection quality. Additional features would include end-to-end encryption for private chats, typing indicators implemented with debounced events to reduce traffic, and read receipts that track message visibility across participants.

14. Design a contact management system

This question assesses your ability to design data-centric applications with search capabilities. Employers want to see how you structure user information and implement relationship mapping.

When answering, outline entities like Contact, Group, and User. Explain how you’d implement contact information storage, group management, and search functionality.

Discuss features like contact merging, import/export capabilities, and synchronization with external sources.

Sample Answer: I would design the contact management system with classes like User, Contact, ContactInfo, and Group. Each Contact would have a flexible ContactInfo structure supporting multiple phone numbers, email addresses, and social profiles with type labels (personal, work, etc.). For efficient searching, I’d implement indexing on key fields with support for partial matching and phonetic algorithms (like Soundex) to handle misspellings. The grouping functionality would allow contacts to belong to multiple user-defined Groups for easier organization. For duplicate detection, I’d implement a similarity algorithm considering name, email, and phone patterns, suggesting potential merges with a confidence score. The import/export functionality would support standard formats like vCard and CSV with field mapping capabilities. For synchronization with external sources, I’d design adapters for common services (Google, Microsoft) using their respective APIs, implementing a reconciliation strategy that handles conflicts based on user preference (newest wins, manual resolution, etc.).

15. How would you design a URL shortener service?

This question evaluates your understanding of distributed systems and high-concurrency services. Interviewers want to see if you can handle unique ID generation and redirection logic.

Your answer should outline components like URL mapping, ID generation, and redirection handling. Explain different approaches to generating short URLs and their trade-offs.

Discuss how you’d handle analytics, custom aliases, and URL expiration.

Sample Answer: My URL shortener design would include classes for URL, User, and Analytics. The core functionality requires two main operations: shortening and redirection. For shortening, I’d generate a unique short ID either using a counter-based approach with base62 encoding or by creating a random string and checking for collisions. The generated short URL would be stored with the original URL in a key-value datastore optimized for fast lookups. For the redirection service, when a request comes in with a short URL, the system would look up the original URL and return an HTTP 301 (permanent redirect) or 302 (temporary redirect) based on configuration. To handle high traffic, I’d implement aggressive caching of popular redirects. For analytics, I’d track clicks with metadata like referrer, location, and device, storing them asynchronously to avoid impacting redirect performance. Additional features would include custom aliases (with uniqueness validation), expiration dates for temporary links, and access controls for private links. The system would use a horizontally scalable architecture with the datastore sharded by short ID prefixes.

Wrapping Up

Preparing for LLD interviews might feel overwhelming, but breaking down each question systematically makes the process much more manageable. Focus on identifying the core classes, their relationships, and how they work together to fulfill the requirements.

Practice these questions, but go beyond just memorizing answers. Try to draw out the class diagrams, think about edge cases, and consider how your designs might evolve as requirements change. This deeper understanding is what will truly set you apart in your next technical interview.