<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ankit Talwar</title>
    <description>The latest articles on DEV Community by Ankit Talwar (@ankit_talwar_bf2e65017756).</description>
    <link>https://dev.to/ankit_talwar_bf2e65017756</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3030253%2F4fba5f36-506e-436d-a41f-ae5ad0c65969.jpeg</url>
      <title>DEV Community: Ankit Talwar</title>
      <link>https://dev.to/ankit_talwar_bf2e65017756</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankit_talwar_bf2e65017756"/>
    <language>en</language>
    <item>
      <title>HLD vs LLD: Understanding the Blueprint Behind Software What I learned about the two levels of software design, and why a developer should care.</title>
      <dc:creator>Ankit Talwar</dc:creator>
      <pubDate>Fri, 13 Nov 2026 12:20:18 +0000</pubDate>
      <link>https://dev.to/ankit_talwar_bf2e65017756/hld-vs-lld-understanding-the-blueprint-behind-software-what-i-learned-about-the-two-levels-of-3m98</link>
      <guid>https://dev.to/ankit_talwar_bf2e65017756/hld-vs-lld-understanding-the-blueprint-behind-software-what-i-learned-about-the-two-levels-of-3m98</guid>
      <description>&lt;p&gt;When I started learning software design, two acronyms kept showing up together: HLD (High-Level Design) and LLD (Low-Level Design). They sounded like the same thing at different zoom levels, and honestly, that's close to the truth. This post is my attempt to explain the difference in plain language, with a Python example, based on what I recently studied in AlgoMaster's Low-Level Design course.&lt;/p&gt;

&lt;h2&gt;
  
  
  The city and the house
&lt;/h2&gt;

&lt;p&gt;The simplest way I found to remember it: building software is like building a city.&lt;br&gt;
Before anyone lays a single brick, someone has to decide where the residential areas go, where the commercial zones sit, how the roads connect them, and where power comes from. That is the city plan, and it is High-Level Design.&lt;br&gt;
Once the plan is approved, an architect picks one plot of land and draws the detailed blueprint for a single house: how many rooms, where the plumbing runs, what the wiring looks like. That is the house blueprint, and it is Low-Level Design.&lt;br&gt;
You need both. A city plan without house blueprints is just a map. House blueprints without a city plan give you a pile of well-built houses with no roads between them. So, both of them have to work together to make something useful work efficiently and smoothly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is High-Level Design (HLD)?
&lt;/h2&gt;

&lt;p&gt;HLD defines the architecture of the system. It answers one big question: how should the system be structured, and how will its major parts talk to each other?&lt;br&gt;
The focus is on what the pieces are, not on how each one works inside. Typical HLD questions include:&lt;br&gt;
• What are the major components or services? (user service, payment service, notification service)&lt;br&gt;
• How do they communicate? (REST, gRPC, a message queue like Kafka or RabbitMQ)&lt;br&gt;
• What technology stack fits? (which language/framework, SQL or NoSQL)&lt;br&gt;
• How does the system stay scalable, reliable and available? (load balancers, replication, CDNs)&lt;br&gt;
• Which third-party services are involved? (a payment provider, cloud storage or third party APIs)&lt;/p&gt;

&lt;p&gt;The output is usually architecture diagrams, data-flow diagrams and a list of technology choices: the skeleton of the system.&lt;/p&gt;

&lt;p&gt;Example: a ride-hailing app. At the HLD level you would sketch separate Passenger, Driver, Matching and Billing services. The Matching service broadcasts ride requests through a message queue. Passengers and drivers exchange live locations over WebSockets. Location data lives in a NoSQL store, while user and billing data sit in a relational database (You may have to show user and user's  ride and transaction history). Everything runs in containers on Kubernetes behind load balancers for scaling and smoothnes.&lt;/p&gt;

&lt;p&gt;Notice what is missing: not a single class or method is mentioned.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Low-Level Design (LLD)?
&lt;/h2&gt;

&lt;p&gt;LLD zooms into one component and turns the abstract plan into something a developer can actually code. This is where you decide the internal structure: classes, their responsibilities, attributes, methods, relationships and design patterns.&lt;br&gt;
LLD questions sound like this:&lt;br&gt;
• Which classes do I need, and what is each one responsible for?&lt;br&gt;
• What attributes and methods does each class have?&lt;br&gt;
• How do the classes relate (inheritance, composition)?&lt;br&gt;
• Which design pattern fits (Factory, Singleton, Strategy)?&lt;br&gt;
• What are the exact method signatures, return types and exceptions?&lt;/p&gt;

&lt;p&gt;Example: the Billing Service from the same ride-hailing app. You might define Ride, Invoice, and a PaymentStrategy interface with two implementations, CreditCardPayment and WalletPayment. An Invoice has a Ride (composition - has a relationship). The Strategy pattern lets the rider switch payment methods without touching the invoice logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  What LLD looks like in Python
&lt;/h2&gt;

&lt;p&gt;Since I mostly write Python, here is a small sketch of that Billing design using an abstract base class:&lt;/p&gt;

&lt;p&gt;from abc import ABC, abstractmethod&lt;br&gt;
class PaymentStrategy(ABC):&lt;br&gt;
    &lt;a class="mentioned-user" href="https://dev.to/abstractmethod"&gt;@abstractmethod&lt;/a&gt;&lt;br&gt;
    def process_payment(self, amount: float) -&amp;gt; bool:&lt;br&gt;
        ...&lt;/p&gt;

&lt;p&gt;class CreditCardPayment(PaymentStrategy):&lt;br&gt;
    def process_payment(self, amount: float) -&amp;gt; bool:&lt;br&gt;
        print(f"Charging {amount} to credit card")&lt;br&gt;
        return True&lt;/p&gt;

&lt;p&gt;class WalletPayment(PaymentStrategy):&lt;br&gt;
    def process_payment(self, amount: float) -&amp;gt; bool:&lt;br&gt;
        print(f"Deducting {amount} from wallet")&lt;br&gt;
        return True&lt;/p&gt;

&lt;p&gt;class Ride:&lt;br&gt;
    def &lt;strong&gt;init&lt;/strong&gt;(self, ride_id: str, fare: float):&lt;br&gt;
        self.ride_id = ride_id&lt;br&gt;
        self.fare = fare&lt;/p&gt;

&lt;p&gt;class Invoice:&lt;br&gt;
    def &lt;strong&gt;init&lt;/strong&gt;(self, ride: Ride, payment: PaymentStrategy):&lt;br&gt;
        self.ride = ride          # composition: an invoice has a ride&lt;br&gt;
        self.payment = payment    # strategy: swappable payment method&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def pay(self) -&amp;gt; bool:
    return self.payment.process_payment(self.ride.fare)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;invoice = Invoice(Ride("R-101", 250.0), WalletPayment())&lt;br&gt;
invoice.pay()&lt;/p&gt;

&lt;p&gt;This is LLD in action: concrete classes, clear responsibilities, and a design pattern chosen on purpose. Adding UPI or a gift-card option later means writing one new class, with no changes to Invoice.&lt;/p&gt;

&lt;h2&gt;
  
  
  How they work together
&lt;/h2&gt;

&lt;p&gt;HLD and LLD are not rivals. They are consecutive steps in one process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Requirements say what the system must do.&lt;/li&gt;
&lt;li&gt; HLD breaks the system into components.&lt;/li&gt;
&lt;li&gt; LLD designs the inside of each component.&lt;/li&gt;
&lt;li&gt; Code implements the LLD.
Skip HLD and your components won't fit together. Skip LLD and each component turns into tangled code that is painful to extend.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  My takeaways
&lt;/h2&gt;

&lt;p&gt;• HLD answers "what are the pieces and how do they connect?" LLD answers "how is each piece built?"&lt;br&gt;
• HLD is about services, databases, queues and scaling. LLD is about classes, interfaces, relationships and patterns.&lt;br&gt;
• They are two zoom levels of the same process, and each depends on the other.&lt;br&gt;
• As a Python developer, I'll practise LLD first by modelling small systems with classes and design patterns, then move on to HLD topics like scalability and messaging.&lt;/p&gt;

&lt;p&gt;If you are preparing for software interviews, both skills get tested, so it helps to practise them as a pair.&lt;/p&gt;

</description>
      <category>education</category>
      <category>software</category>
    </item>
  </channel>
</rss>
