Back to blog

How to Master Low-Level Design and High-Level Design

Most backend interviews test two different skills, and many people prepare for only one of them. Low-Level Design (LLD) is about how you structure code: classes, interfaces, relationships and patterns. High-Level Design (HLD) is about how you structure systems: services, databases, caches and queues, and how they hold up under load.

I use both every day. At work I built a support-ticket backend where a RabbitMQ consumer had to scale across many instances without escalating the same ticket twice. That meant thinking about distributed locks with Redis (HLD) and about clean, testable consumer code (LLD) at the same time. The two skills feed each other.

Two free GitHub repositories by ashishps1 have become my go-to roadmaps: awesome-low-level-design and awesome-system-design-resources. Here’s how I’d use them to go from zero to interview-ready.

LLD vs HLD in One Minute

  • Low-Level Design answers: how should this feature be written? You design classes, choose design patterns and make the code easy to extend. A typical question: design a parking lot.
  • High-Level Design answers: how should this system be built so it scales? You choose components, data stores and communication styles, and explain the trade-offs. A typical question: design a URL shortener.
Low-Level DesignHow one service’s code is structuredParkingLotlevelspark()LevelspotsParkingSpottypeisFree()owns (composition)High-Level DesignHow services work togetherClientLoad balancerServiceServiceCacheDatabase
Low-level design looks inside one service. High-level design looks at how services fit together.

An easy way to remember it: LLD is about one service done well; HLD is about many services working together.

Part 1: The Low-Level Design Roadmap

The awesome-low-level-design repository is laid out in the order you should learn it:

  1. 1OOP fundamentals
  2. 2Class relationships
  3. 3Design principles
  4. 4Design patterns
  5. 5UML
  6. 6Concurrency
  7. 7Practice problems
The LLD learning path, from first principles to interview problems.
  1. OOP fundamentals: classes and objects, enums, interfaces, encapsulation, abstraction, inheritance and polymorphism.
  2. Class relationships: association, aggregation, composition and dependency. Knowing when one object owns another (composition) versus simply uses it (dependency) shapes every design.
  3. Design principles: SOLID, DRY, KISS and YAGNI. These are the rules you use to judge whether a design is good.
  4. Design patterns: creational (Singleton, Factory Method, Builder), structural (Adapter, Decorator, Facade, Proxy) and behavioral (Strategy, Observer, State, Command). Learn the problem each one solves, not just its diagram.
  5. UML: class, sequence and state diagrams, so you can sketch a design quickly on a whiteboard.
  6. Concurrency: threads, locks, semaphores, deadlocks, and patterns like producer-consumer and thread pools. Many LLD rounds now end with a concurrency follow-up.
  7. Practice problems: start with easy ones (Parking Lot, Vending Machine, Logging Framework), move to medium (LRU Cache, Elevator System, Pub Sub System), then hard (Splitwise, Chess, Movie Ticket Booking).

A Pattern in Action

Patterns make more sense in code. Here’s the Strategy pattern applied to parking-lot pricing, a classic LLD problem. Each pricing rule is its own class, so adding a new one never changes existing code. That’s the Open/Closed principle from SOLID:

ParkingTicket.java
interface PricingStrategy {
    double calculate(long hoursParked);
}

class HourlyPricing implements PricingStrategy {
    public double calculate(long hoursParked) {
        return hoursParked * 40;
    }
}

class FlatDailyPricing implements PricingStrategy {
    public double calculate(long hoursParked) {
        return Math.ceil(hoursParked / 24.0) * 500;
    }
}

class ParkingTicket {
    private final PricingStrategy pricing;

    ParkingTicket(PricingStrategy pricing) {
        this.pricing = pricing;
    }

    double fee(long hoursParked) {
        return pricing.calculate(hoursParked);
    }
}
ParkingTicketpricing: PricingStrategyfee(hours)«interface»PricingStrategycalculate(hours)HourlyPricingcalculate(hours)FlatDailyPricingcalculate(hours)usesSolid arrow: usesDashed line, hollow arrow: implementsNew pricing rule = one new class.Nothing else changes.
The same code as a UML class diagram: ParkingTicket depends on the interface, never on a specific pricing rule.

Part 2: The High-Level Design Roadmap

The awesome-system-design-resources repository builds up from fundamentals to complete systems:

  1. Core concepts: scalability, availability, reliability, single points of failure, latency vs throughput, consistent hashing and the CAP theorem.
  2. Networking: DNS, proxies vs reverse proxies, HTTP and HTTPS, TCP vs UDP, and load balancing.
  3. APIs: REST vs GraphQL, WebSockets, webhooks, API gateways, idempotency and rate limiting.
  4. Databases: SQL vs NoSQL, ACID transactions, indexes, partitioning, sharding and replication.
  5. Caching: caching strategies, eviction policies, distributed caches and CDNs.
  6. Asynchronous communication: pub/sub, message queues, message brokers and change data capture.
  7. Distributed systems: service discovery, consensus, distributed locking, circuit breakers and distributed tracing.
  8. Trade-offs: strong vs eventual consistency, vertical vs horizontal scaling, batch vs stream processing, push vs pull. This is where interviews are won, because every good answer is a trade-off.
  9. Practice problems: easy (URL Shortener, Distributed Cache, Authentication System), medium (WhatsApp, Notification Service, Rate Limiter), then hard (Uber, Google Docs, a BookMyShow-style ticket booking system).
ClientCDNLoad balancerAPI gatewayService AService BService CCachePrimary DBRead replicaMessage queueWorkerstatic filesfrom the edgeslow workgoes async
Most HLD answers are variations of this shape: route traffic, keep services stateless, cache hot data, replicate the database and move slow work to a queue.

The repository also links classic papers (Dynamo, Kafka, Spanner, MapReduce, the Google File System and more) and engineering write-ups from companies like Discord, Netflix, Stripe and Slack. Reading one a week shows you how these ideas hold up at real scale.

How to Answer Any Design Question

Both repositories include a guide on structuring interview answers. This is the flow I follow:

  1. 1Clarify

    What must it do, and how well?

  2. 2Estimate

    Users, requests per second, storage

  3. 3Entities & APIs

    Classes, endpoints, data model

  4. 4Draw

    Classes or services and data stores

  5. 5Go deep

    The hardest part: concurrency, consistency

  6. 6Trade-offs

    What you chose, and what you gave up

Six steps that work for both LLD and HLD questions.
  1. Clarify the requirements. Ask what the system must do and how well it must do it (scale, latency, availability) before drawing anything.
  2. Estimate the scale. Rough numbers for users, requests per second and storage tell you whether one database is enough or you need sharding and caching.
  3. Define the core entities and APIs. In LLD these become your classes; in HLD, your service endpoints and data model.
  4. Draw the design. Classes and relationships for LLD; services, data stores and queues for HLD.
  5. Go deep on the hard part. Concurrency, consistency, a hot shard or a failure mode. Interviewers care most about how you handle the tricky part.
  6. Discuss the trade-offs. Say what you chose, what you gave up and when you’d choose differently.

A 6-Week Plan

  • Weeks 1–2: LLD foundations. OOP, class relationships, SOLID and the most common patterns (Strategy, Factory, Observer, Singleton, Builder, Decorator). Solve one easy LLD problem every two days.
  • Week 3: Concurrency and medium LLD. Locks, thread pools and producer-consumer, then LRU Cache, Elevator System and Pub Sub System.
  • Week 4: HLD foundations. Core concepts, networking, APIs, databases and caching.
  • Week 5: Distributed systems. Queues, consistency, sharding, replication and the trade-offs section.
  • Week 6: Mock interviews. Two HLD and two LLD problems, each against a 45-minute timer, explained out loud.

Books That Go Deeper

  • Designing Data-Intensive Applications by Martin Kleppmann: the best single book on how databases, replication and distributed systems really work.
  • System Design Interview, Volumes 1 and 2 by Alex Xu: worked examples of classic HLD questions.
  • Head First Design Patterns: the friendliest introduction to design patterns, and one of the books the LLD repository recommends.
  • Clean Code and Refactoring: also on the LLD repository’s list, for writing code that stays easy to change.

My Takeaway

LLD makes you a better engineer every day you write code; HLD makes you better at thinking in systems. You don’t need expensive courses for either. Two free repositories, a notebook and steady practice will take you a long way.

Resources

System DesignLow-Level DesignHigh-Level DesignInterviews