How to Answer Any System Design Interview (The Delivery Framework) — Transcript
Full transcript
- 0:00Combined, Stephanie and I have
- 0:01interviewed thousands of candidates at
- 0:03big tech companies, and we've also
- 0:04conducted thousands of mock interviews.
- 0:06And the most common reason that I see
- 0:08candidates fail as system design
- 0:10interviews isn't that they don't know
- 0:11enough information. It's almost always
- 0:13because they just have poor time
- 0:14management.
- 0:15I see this more times than than I can
- 0:17even count, right? A candidate spends
- 0:18something like 15 minutes on
- 0:19requirements, another 10 on back of the
- 0:21envelope math,
- 0:23and then they get pulled into an
- 0:23interesting caching problem all of a
- 0:25sudden. But before they know it, the
- 0:26interview is over and they've only
- 0:28designed half of the system. Candidates
- 0:30often come to us and they say they feel
- 0:31like it's impossible to cover everything
- 0:33in the time that they're given. And I
- 0:35get it.
- 0:36But in most cases, they do have enough
- 0:37time. They're just spending too much
- 0:39time on the wrong things.
- 0:42This is why we decided to put together
- 0:43the Hello Interview Delivery Framework.
- 0:45It gives you a plan for how to use that
- 0:46time, making sure you get the working
- 0:48system while leaving enough room to
- 0:50demonstrate your technical depth.
- 0:52Here's how it works. You start with your
- 0:53requirements, spending about 5 minutes
- 0:55there.
- 0:56You move on to core entities, spending
- 0:58two. Then to your API.
- 1:00Some problems need a quick data flow
- 1:02after that.
- 1:03But then you spend 10 to 15 minutes on
- 1:04the high-level design and the last 10 or
- 1:06so on deep dives. Those last two parts
- 1:09are where the most interesting
- 1:10discussions happen, and so we want to
- 1:11protect that time as best as we can.
- 1:14To make this concrete, let's walk
- 1:15through designing Twitter at a really
- 1:17high level together, and we'll fill in
- 1:19the board one step at a time, the way
- 1:21that you would in a real interview. This
- 1:23way, if you get nervous or you lose your
- 1:24place halfway through, just come back to
- 1:27the delivery framework. It shows you
- 1:28exactly where you are and what comes
- 1:30next. All right, starting with the
- 1:31functional requirements. Functional
- 1:32requirements are just the features of
- 1:34the system.
- 1:36These are easiest to write as a users
- 1:37should be able to statements. Treat this
- 1:40part like a conversation with a product
- 1:42manager that you would have on your
- 1:43team. You want to ask them targeted
- 1:44questions so you can understand what it
- 1:46is you need to build, like whether or
- 1:47not users can edit tweets or whether the
- 1:49feed is purely chronological or
- 1:51something more intelligent. That way you
- 1:53can land on a short prioritized list.
- 1:56If you freeze up, I found it helpful to
- 1:58imagine that you have the app or the
- 1:59website the product in front of you.
- 2:01What do you see? What comes up on each
- 2:03screen? That should keep you going.
- 2:06For Twitter, users should be able to
- 2:07post tweets, they should be able to
- 2:09follow other users, and then they should
- 2:10be able to see a feed of tweets from the
- 2:13people they follow.
- 2:14Like I said, you really want to keep
- 2:15this list short. Every requirement you
- 2:17write down is something that you are now
- 2:19on the hook to design. And a lot of top
- 2:21tech companies grade you directly on
- 2:23whether or not you can really zone in on
- 2:25what matters, so you don't want to
- 2:26introduce distractions.
- 2:28Three here is plenty.
- 2:30You could say it plainly in your
- 2:31interview, something like I'll focus on
- 2:33posting, following in the feed, and I'll
- 2:35treat likes, search, and DMs as out of
- 2:38scope unless you'd like me to include
- 2:39them.
- 2:40This way you're opening the conversation
- 2:42to the interviewer so that you both can
- 2:44agree on the scope and then move forward
- 2:45with the rest of the design. Then the
- 2:47next thing that you'll do is what we
- 2:48call the non-functional requirements.
- 2:50These are just the qualities that the
- 2:52system needs, things like the system
- 2:54should be highly available or the system
- 2:57should scale. Make each one really
- 2:59specific to the system that you're
- 3:00designing, and where you can, even put a
- 3:03number on it. So for example, candidates
- 3:05will say like this system should be low
- 3:06latency, right? This tells me as the
- 3:08interviewer nothing because every system
- 3:11in essence needs to be low latency or
- 3:12usually that's the goal anyway.
- 3:14But saying something like the feed
- 3:16should load in under 200 milliseconds
- 3:18tells your interviewer exactly which
- 3:19part has to be fast and how fast.
- 3:22For Twitter, the non-functional
- 3:23requirements might look like the feed
- 3:25loading in under 200 milliseconds,
- 3:27choosing availability over consistency,
- 3:29and then being able to scale to support
- 3:31100 million daily active users.
- 3:33If you're not sure where to start, run
- 3:35down this short checklist,
- 3:37consistency versus availability,
- 3:39environmental constraints like battery
- 3:41or bandwidth, scalability and the
- 3:42read-to-write ratio, latency,
- 3:45durability, security, fault tolerance,
- 3:47and compliance. Importantly, most
- 3:49systems need all of these things,
- 3:52but your job is to call out the three to
- 3:54five that are uniquely interesting for
- 3:56this particular problem. In Twitter's
- 3:58case, it's incredibly read-heavy. Far
- 4:00more people read tweets than they do
- 4:02write them, And so a tweet that shows up
- 4:04a few seconds later is totally fine. But
- 4:07a slow feed would kill retention.
- 4:09Don't worry about getting everything
- 4:10here. Focus on just those important
- 4:12things rather than being comprehensive.
- 4:14Next up, many guides tell you to do
- 4:16back-of-the-envelope math next.
- 4:18I'd skip it, and I strongly recommend
- 4:20that you do too, at least upfront.
- 4:23Doing math out loud and on the spot is
- 4:25almost nobody's strong suit.
- 4:26And I've seen time and time again
- 4:27candidates sit in front of me and they
- 4:28spend about 10 minutes or so trying to
- 4:30do all of this math, calculating daily
- 4:32active users, storage, queries per
- 4:34second. At the end of all of this math,
- 4:35they kind of look at me and they go,
- 4:37yeah, so it's a lot or it's a big
- 4:38number.
- 4:39Okay, cool. We already knew that, and we
- 4:42learned nothing about you as the
- 4:43candidate, and this was ended up just
- 4:45being largely a waste of time.
- 4:47So doing math is good,
- 4:49but only do it when the outcome of that
- 4:51math is going to actually have a
- 4:52material difference on the system that
- 4:54you're designing.
- 4:55So you can tell your interviewer this
- 4:56upfront. Say, I'd like to skip
- 4:57estimations for now and do the math when
- 4:59it affects a decision later on.
- 5:01So when does it actually matter then?
- 5:03Well, let's take our Twitter example.
- 5:04Imagine that we're later on in our deep
- 5:06dives and we need to look at
- 5:07precomputing every user's feed and
- 5:09keeping it in a cache. When we do, we'll
- 5:11need to know whether that cache can fit
- 5:13in a single server's memory or if we're
- 5:15going to need to shard it. That's when
- 5:17you would do the math. So right there on
- 5:18the whiteboard, next to the cache that
- 5:20you're making a decision about, you can
- 5:22do your 100 million users each with 200
- 5:24newest tweet IDs, 8 bytes apiece, 160
- 5:28gigabytes. That's more than you want on
- 5:30one node, so you would end up sharding.
- 5:32Next up, we suggest that you take a
- 5:33couple minutes to list out your core
- 5:36entities. These are just the nouns of
- 5:38your system. They're the things that
- 5:39your API will pass around and that your
- 5:41system will store. And your functional
- 5:43requirements already name most of them.
- 5:46Users post tweets and follow other
- 5:48users. So for Twitter, the core entities
- 5:50are user, a tweet, and a follow.
- 5:52If the entities aren't obvious, just
- 5:54look back at your functional
- 5:55requirements and ask what data do you
- 5:56need to store to support each one of
- 5:58these.
- 5:59You can keep it as just a simple
- 6:01bulleted list on your whiteboard and
- 6:03tell the interviewer that it's just a
- 6:04first draft. You might end up coming
- 6:06back to it. But what it's going to do is
- 6:07it's going to orient your thinking so
- 6:09that as you move later into your design,
- 6:11into both the APIs and eventually onto
- 6:13the schema, you have a clear
- 6:15understanding of these nouns that you're
- 6:16passing around.
- 6:18It's really tempting to write out that
- 6:19full schema here,
- 6:21but you don't know enough yet. So my
- 6:22strong recommendation to you is that
- 6:24you're going to leave the fields for the
- 6:25entities, the columns, so when you get
- 6:27to the high-level design and you
- 6:28actually add your database and you
- 6:30realize exactly what columns you need
- 6:32and you can write them down directly
- 6:33next to your database.
- 6:35The last thing is try to pick good names
- 6:37here, too. You could probably get away
- 6:39with something, you know, stupid like
- 6:41foo and bar, but naming really is one of
- 6:43those hard problems in computer science
- 6:46and some interviewers do notice whether
- 6:47you're good at naming things, as funny
- 6:48as that sounds. The next step in the
- 6:50framework is the API.
- 6:52There are really only two decisions to
- 6:53make here.
- 6:54Which protocol do you use and which
- 6:56endpoints do you need?
- 6:58Don't spend too much time on the first
- 7:00of those decisions because REST with
- 7:02resources and HTTP verbs is almost
- 7:05always the right answer.
- 7:06If the product has some real-time
- 7:08features like live updates, then you
- 7:10could add WebSockets or server-sent
- 7:12events.
- 7:13You can also choose an RPC-style setup
- 7:14like gRPC, but it's rarely worth the
- 7:17debate in your interview. So 95% of the
- 7:19time it's going to just be REST.
- 7:21For Twitter, we'll use REST and then
- 7:23we'll write one endpoint for each of our
- 7:25functional requirements.
- 7:27The endpoints map almost one-to-one with
- 7:29those functional requirements and the
- 7:31resources come straight from your core
- 7:33entities as plural nouns.
- 7:35So posting a tweet is just a post to a
- 7:38tweet endpoint with the text in the body
- 7:41and you can fetch a single tweet with a
- 7:43GET on a tweet resource.
- 7:46Following someone is a post to a follows
- 7:48resource with the ID and the user you're
- 7:51following and the feed is a GET on feeds
- 7:54that returns a list of tweets. Now
- 7:56there's a lot more to good API design
- 7:58than can fit here and we have a full
- 8:00video and an article on it if you want
- 8:01to go deeper. The next step, which I'll
- 8:03really briefly mention, this one's
- 8:04optional and most problems do skip it,
- 8:07but if you're building a data processing
- 8:08system or something like a web crawler,
- 8:10for example, writing down the data flow
- 8:13as a short numbered list before you
- 8:15design can be incredibly useful. So
- 8:17fetch the seed URLs, parse the HTML,
- 8:20extract new URLs, store the data, and
- 8:22repeat. And you can then draw the system
- 8:24by just working through each of those
- 8:26steps one by one.
- 8:28Twitter is mostly just request
- 8:29responses, so we're going to skip the
- 8:31data flow. Now next up is that you head
- 8:33to the whiteboard and you actually start
- 8:34doing what is my favorite part and you
- 8:35start getting to draw boxes, components,
- 8:37and arrows, and that's the high-level
- 8:39design. It's going to get the biggest
- 8:40share of our time, 10 to 15 minutes. Now
- 8:43the goal of your high-level design is to
- 8:45just get the simplest design down that
- 8:47satisfies your functional requirements.
- 8:49Tell your interviewer this upfront. Tell
- 8:51them I'm going to get something working
- 8:52end-to-end first, and then I'm going to
- 8:54address its limitations via my deep
- 8:56dives by going through my non-functional
- 8:58requirements. The easiest way to do this
- 9:00is to just go endpoint by endpoint,
- 9:02which is effectively functional
- 9:03requirement by functional requirement.
- 9:05So if we take our first endpoint,
- 9:07posting a tweet, the request is going to
- 9:09go through an API gateway, it's going to
- 9:10hit a tweet service, and then we're
- 9:12going to write that tweet to our
- 9:13database. As you're drawing, make sure
- 9:15that you're talking through what each
- 9:17request carries and what it changes.
- 9:19Then when you reach the database, as I
- 9:21mentioned earlier, jot down the fields
- 9:23that your design depends on right next
- 9:25to it. For a tweet, that might be an ID,
- 9:27the author ID, the text, and the
- 9:29creation time.
- 9:30From there, you continue that same way
- 9:32with each other endpoint, following and
- 9:34then getting the feed until each
- 9:36requirement has a path through the
- 9:37design.
- 9:39As you go, you're going to notice
- 9:40problems with your design, and that's a
- 9:41good thing. Point them out, make a quick
- 9:43note of them, and then keep going so you
- 9:45don't get stuck yet until you have that
- 9:46working high-level design.
- 9:48This is because the mistake I see
- 9:50candidates make so often is that they
- 9:51spend 8 minutes trying to fix a
- 9:53bottleneck before they've even shown us
- 9:55how the rest of the system works. And so
- 9:57we'll come back to those problems during
- 9:58the deep dive, not focus on them during
- 10:00our high-level design. That way, once
- 10:02every requirement has a path to the
- 10:03design, it's finally time for us to
- 10:05address those limitations. We can do
- 10:07this by just starting with our
- 10:09non-functional requirements and going
- 10:11one by one through each of them.
- 10:13What needs to be faster? What needs to
- 10:15scale? For us, the first one was that
- 10:16our feed needs to load in under 200
- 10:18milliseconds. And so one fix is to have
- 10:21a fan out on write. Each new tweet gets
- 10:24pushed into a pre-computed feed for
- 10:26every follower, kept in a cache like
- 10:27Redis so that loading a feed is a single
- 10:30read.
- 10:30Accounts with millions of followers
- 10:32break this, so they stay on fan out on
- 10:34read. In an interview, that trade-off is
- 10:36where you would spend most of your time
- 10:38in the deep dives.
- 10:39Now I'm moving through Twitter's details
- 10:41quickly on purpose. Our design
- 10:43Facebook's news feed breakdown on Hello
- 10:45Interview is totally free and it takes
- 10:46nearly this exact problem through every
- 10:48single step of the framework, celebrity
- 10:50accounts included.
- 10:51Watching our breakdown videos is the
- 10:53best possible way to see this whole
- 10:54delivery framework played out for a full
- 10:57problem. Now back to focus on the deep
- 10:58dives.
- 10:59How much of the deep dives you lead
- 11:01depends on your level. Junior candidates
- 11:03can expect that the interviewer is going
- 11:05to point them at the weak spots and ask
- 11:06targeted questions, and they should be
- 11:08able to answer them as best as they can.
- 11:10Senior and up candidates, on the other
- 11:12hand, should be able to find those weak
- 11:13spots themselves and proactively drive
- 11:16the conversation. You want to be really
- 11:18careful here though. Leading doesn't
- 11:20mean talking non-stop.
- 11:21A common mistake here is just talking
- 11:23over the interviewer and then they never
- 11:24get a chance to ask something that they
- 11:25want to ask.
- 11:26They usually have some set of specific
- 11:28signals that they want from you. And if
- 11:29you never leave a gap, then they can ask
- 11:32those questions and end up never getting
- 11:33to them. So just make sure that you
- 11:35leave some room. As you're leading the
- 11:37conversation, check in every once in a
- 11:38while. I'm going to go move on to this,
- 11:40but is there something that you'd like
- 11:41me to focus on instead? This invites
- 11:43them to come in with any questions that
- 11:45they've been preparing.
- 11:46Now there are a couple questions that
- 11:47come up a lot when candidates learn the
- 11:49delivery framework.
- 11:50Like what if your interviewer starts
- 11:51asking you deep dive questions before
- 11:53you finished the high-level design?
- 11:56Well, that's okay. Follow their lead.
- 11:57They usually jump in because they've
- 11:58seen enough of the basics and they want
- 12:00to get a specific signal.
- 12:01Answer their specific question and if
- 12:03there's a gap left in the design, just
- 12:05mention it out loud so they know that
- 12:06you're going to come back to it. Another
- 12:08question we'll hear is that if you're a
- 12:09staff-level engineer, do Do need to
- 12:11start with the most basic
- 12:13before moving into the deep dives?
- 12:15And the answer is you don't. There's no
- 12:16reason that you have to start with the
- 12:17most naive design, but you want
- 12:20something that works and to end before
- 12:21you start going really deep. And so you
- 12:23can always start a step above the basics
- 12:25regardless of if you're staff, senior,
- 12:27or even mid-level. You just want to get
- 12:29to a place where something is working in
- 12:30a quick enough period of time so that
- 12:32you can spend time going deep.
- 12:34Another question that we'll get is how
- 12:35much should I actually be drawing on the
- 12:37whiteboard?
- 12:38And the answer is enough that somebody
- 12:40walking in halfway through could follow
- 12:42it.
- 12:43This is important because your
- 12:44interviewer often finishes the interview
- 12:45and then they go rush to a meeting. Then
- 12:47they have a busy day. They go home.
- 12:49Maybe they have a a busy day with their
- 12:51family life and they come back the next
- 12:52morning and think, shoot, I have to
- 12:53write that interview feedback for Tim
- 12:55that I did yesterday.
- 12:57Good chance they don't remember much
- 12:58about it.
- 12:59So they're going to open up your
- 12:59whiteboard, see their notes, and pick
- 13:01back up from there. So that's the whole
- 13:03delivery framework. Requirements, core
- 13:05entities, an API that maps onto those
- 13:07requirements, a high-level design that
- 13:10supports each of those endpoints, and
- 13:12then a deep dive that addresses the
- 13:13biggest limitations via your
- 13:14non-functional requirements.
- 13:16The idea is to have a clear plan going
- 13:18into the interview so that you can spend
- 13:20time actually designing the system and
- 13:23not figuring out how to navigate the
- 13:25internals in the interview.
- 13:26Here at Hello Interview, we've used this
- 13:28same framework on more than 30 system
- 13:29design problem breakdowns, most of which
- 13:32are totally free and each of which have
- 13:34a video and an accompanying article.
- 13:36So my recommendation to you is to grab
- 13:38one of those 30 problems and practice
- 13:40going through it yourself using the
- 13:42delivery framework. And after a handful
- 13:44of repetitions, doing a bunch of
- 13:46different problems, you shouldn't need
- 13:47to think about the steps anymore.
- 13:49If you want to practice going through
- 13:50the framework yourself, our guided
- 13:52practice on hellointerview.com has each
- 13:54of those 30 problems broken down step by
- 13:57step where you can work through them in
- 13:59order, getting instant feedback on each
- 14:01of the steps before moving on to the
- 14:02next one. Then when you feel like you
- 14:04have the framework down and you're ready
- 14:05for the real thing, our live practice is
- 14:07going to run you through a full mock
- 14:09interview with an AI interviewer on a
- 14:11shared whiteboard.
- 14:12All right, that's the Hello Interview
- 14:14delivery framework. Hopefully this was
- 14:15useful to you. And most importantly,
- 14:18good luck with your upcoming interviews.
- 14:19You guys are going to crush it.
About this transcript
This page contains the full transcript of How to Answer Any System Design Interview (The Delivery Framework) by Hello Interview, generated from the public captions YouTube serves with the video. The transcript has 3,134 words across 485 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.