SevyDevy

Module 1 · How an App Answers a Tap · Lesson 1 of 35

What is system design? Seeing the whole app behind one tap

10 minFree System design course · Beginner to intermediateLesson 1.1By Saket Bhatnagar

Researched and drafted with AI, reviewed and edited by Saket Bhatnagar.

In short

  • What is system design? It is deciding which parts an app needs, how they talk, and what happens when more people arrive or something breaks.
  • Every design is a set of trade-offs. Whatever a choice gives you, you pay for in some other way.
  • This course is HLD-first. HLD, high level design, is the boxes, arrows and trade-offs, not the code inside one box.
Soon

Video lesson · coming soon

What is system design? The whole app behind one tap

Lala, your AI mentor, will walk you through this lesson in a short animated video. Until then, everything is here to read and try.

  1. 01 The Saturday restart
  2. 02 Sunita plans a wedding
  3. 03 Myth or fact
  4. 04 SeatJaldi v0: one machine
  5. 05 Three questions for every box
  6. 06 Sketch v0, then follow the tap

On Saturday morning, 100 members of a Kothrud cricket club open SeatJaldi to book ₹299 seats. For a few minutes, nobody can book anything.

Meera Kulkarni put ₹6 lakh of her savings into SeatJaldi, a ticket app for her club in Pune. Everything runs on one ₹1,200-a-month machine, and it had restarted for an update right as members opened the app.

“I will rewrite the booking code to make it faster,” says Arjun Nair, her first hire. Meera asks, “Will faster code stop the machine restarting?” Arjun has no answer. Later he admits, “I do not even know what happens after I tap Book.” All companies, people and numbers in this course are made up.

What is system design?

System design is deciding which parts an app needs, how they talk, and what happens when more people arrive or something breaks. Meera’s question was about the parts, not the code.

Every design is a set of trade-offs. Picture a see-saw with five arms, one for each thing in the list below. Push one arm down and at least one other goes up.

  • Speed: answers come fast, but you pay for more machines.
  • Cost: the bill stays small, but there is less room for crowds.
  • Correctness: every booking is right, but the checks take time.
  • Staying up: the app keeps working when a part stops, but a second machine ready to take over costs money.
  • Simplicity: there are few parts, but there is one place to break.

You have seen this when a shopping app is quick on a quiet afternoon but spins during a big sale. Same parts, bigger crowd, and the first part to run out makes everyone wait.

You have seen an app say “Down for maintenance” while the same company’s website works. Often one part had nothing ready to take over while it was updated. A second machine would have cost more, so the company chose cheap over always on. That was a trade-off, not a bug.

Try it yourselfMyth or fact: flip each cardSay the fact out loud, then flip the card.

What parts does a simple app need?

A simple app needs three parts: a phone app that asks, a server that runs the code, and a place that remembers. That place is the database. Like Sunita’s one kitchen and one gas cylinder, each part is cheap and can run out.

SeatJaldi’s server checks which seats are free and takes each booking. Its database keeps every seat and booking, on the same machine.

SeatJaldi v0: one phone, one server

SeatJaldi in launch week: one phone, one ₹1,200-a-month server, and the database on that same machine. One part to run, and one part to lose.

Diagram connections:

  • Member's phone to App on one server (Taps Book)
  • App on one server to Seat database (Reads, writes)
  • App on one server to Whole app stops (If it fails)
  • Seat database to Whole app stops (Same machine)
  • Member's phone: The app a member taps Book on.
  • App on one server: Checks seats, takes bookings.
  • Seat database: Same machine as the app.
  • Whole app stops: Nothing is left to answer.

The one machine runs out of room to work first. It can handle only so many bookings at once, so the rest wait in line. The ones that wait too long fail with an error. And if the machine stops, everything stops, like on Saturday.

In SeatJaldi v0, the whole machine is the single point of failure. Like Sunita with one gas cylinder, Meera has nothing to switch to.

What is the difference between HLD and LLD?

HLD, high level design, is the boxes, arrows and trade-offs of the whole app, like the SeatJaldi v0 drawing. LLD is how the code inside one of those boxes is organised.

At Sunita’s wedding, HLD is three kitchens, two counters and a store room. LLD is how one cook arranges one kitchen’s shelves. Both matter, but they get decided in different meetings.

How do engineers design a system in a design review?

In a design review, a meeting where the team checks a plan before building it, engineers work through the four steps below. When the numbers change, they go round again. Sunita asks the same two things: what is the plan, and what if the gas runs out?

  1. Write what it must do

    Members pick a seat, pay ₹299 and get a ticket.

  2. Put numbers on it

    For SeatJaldi today: 100 members, ₹1,200 a month, and how many book in the busiest minute. Nobody has measured that last one yet.

  3. Draw the boxes

    Only the parts the first two steps need. That is still v0.

  4. Review what fails

    Ask every box the three questions below.

The failure review for SeatJaldi v0
Review questionSeatJaldi v0’s answer
Is this box a single point of failure, even during a planned update?Yes. One machine runs everything, so even a planned restart stops all booking.
What happens at 10 times the people?Unknown. Nobody has measured how many bookings a minute it can take. A test that sends many fake bookings at once would tell them.
What if a part it needs gets slow?A slow database slows every booking, because the app waits on it. The trouble spreads to everything that waits.

Adding parts is never free either. Parts on different machines talk over the network, the wires between computers. That is slower than inside one machine, and more can break on the way.

So write down the reason, not only the diagram. One machine: 100 members fit, and it costs ₹1,200.

Try it yourself

  1. Pick an app

    Choose one you use daily, such as a food or train app.

  2. Write three to five parts

    Such as the phone app, accounts, orders, a payment partner.

  3. Draw the arrows

    One arrow from each part to the part it talks to.

  4. Circle one part

    Circle the part that would hurt most if it stopped, and guess whether the real app has a second one ready. Write: “It gains X, but the price is Y.”

  5. Check your work

    You have 3 to 5 boxes, each with an arrow, and a yes or no beside the circled box for “has a second one ready?”. A no is why it would hurt most. Your sentence names a gain and a price. If it names only a gain, you wrote a wish, not a trade-off.

Back in Kothrud, Arjun draws SeatJaldi v0 for Meera. Meera is Sunita with 100 guests, and one kitchen is right for today. One machine keeps the bill at ₹1,200 and gives them one thing to understand. The price is a single point of failure.

Now Meera’s question has its design answer. Faster code would not stop the restart, because every update needs one. A second machine that can take over, with its own copy of the seats, would keep booking open, but it costs more rupees. A cheaper fix for planned updates is to run them late at night, when almost nobody books. That does nothing for a crash, though. Only numbers will say when to pay for more.

They keep one machine for now, and Arjun promises to ask the gas question every time: what if this part stops? But one question still bugs him. When Arjun taps Book, what actually happens between his phone and that server?

Check yourself

Check yourself

Meera asks, “Can we buy the strongest server so nothing can ever go wrong?” What is the best reply?

Pick an answer to see why it is right or wrong.

Check yourself

Which of these is an HLD question rather than an LLD question?

Pick an answer to see why it is right or wrong.

Remember these three

  1. Every design is a set of trade-offs: push one arm of the see-saw down and another goes up.
  2. HLD is the parts, how they talk and why; LLD is how the code inside one part is organised.
  3. Ask every box three questions: can it stop everything, what happens at 10 times the people, and what if a part it needs gets slow?

Questions people ask

What is system design in simple words?
It is deciding which parts an app needs and how they talk. It also plans what happens when more people arrive or a part breaks.
What is the difference between HLD and LLD?
HLD is the whole app drawn as boxes, arrows and trade-offs. LLD is the inside of one box: how its code is organised into classes, usually planned before the code is written.
Is system design only for interviews?
No. Teams use it whenever they add a feature, check a monthly bill, or ask what happens if one part fails. Interviews test it because the work needs it.
Is system design asked in fresher interviews?
It depends on the company. Some fresher rounds include a small design question and others do not, so practise drawing parts and naming trade-offs either way.