YouTube2Text

How to Answer Any System Design Interview (The Delivery Framework) — Transcript

by Hello Interview · 3,134 words · 485 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Combined, Stephanie and I have
  2. 0:01interviewed thousands of candidates at
  3. 0:03big tech companies, and we've also
  4. 0:04conducted thousands of mock interviews.
  5. 0:06And the most common reason that I see
  6. 0:08candidates fail as system design
  7. 0:10interviews isn't that they don't know
  8. 0:11enough information. It's almost always
  9. 0:13because they just have poor time
  10. 0:14management.
  11. 0:15I see this more times than than I can
  12. 0:17even count, right? A candidate spends
  13. 0:18something like 15 minutes on
  14. 0:19requirements, another 10 on back of the
  15. 0:21envelope math,
  16. 0:23and then they get pulled into an
  17. 0:23interesting caching problem all of a
  18. 0:25sudden. But before they know it, the
  19. 0:26interview is over and they've only
  20. 0:28designed half of the system. Candidates
  21. 0:30often come to us and they say they feel
  22. 0:31like it's impossible to cover everything
  23. 0:33in the time that they're given. And I
  24. 0:35get it.
  25. 0:36But in most cases, they do have enough
  26. 0:37time. They're just spending too much
  27. 0:39time on the wrong things.
  28. 0:42This is why we decided to put together
  29. 0:43the Hello Interview Delivery Framework.
  30. 0:45It gives you a plan for how to use that
  31. 0:46time, making sure you get the working
  32. 0:48system while leaving enough room to
  33. 0:50demonstrate your technical depth.
  34. 0:52Here's how it works. You start with your
  35. 0:53requirements, spending about 5 minutes
  36. 0:55there.
  37. 0:56You move on to core entities, spending
  38. 0:58two. Then to your API.
  39. 1:00Some problems need a quick data flow
  40. 1:02after that.
  41. 1:03But then you spend 10 to 15 minutes on
  42. 1:04the high-level design and the last 10 or
  43. 1:06so on deep dives. Those last two parts
  44. 1:09are where the most interesting
  45. 1:10discussions happen, and so we want to
  46. 1:11protect that time as best as we can.
  47. 1:14To make this concrete, let's walk
  48. 1:15through designing Twitter at a really
  49. 1:17high level together, and we'll fill in
  50. 1:19the board one step at a time, the way
  51. 1:21that you would in a real interview. This
  52. 1:23way, if you get nervous or you lose your
  53. 1:24place halfway through, just come back to
  54. 1:27the delivery framework. It shows you
  55. 1:28exactly where you are and what comes
  56. 1:30next. All right, starting with the
  57. 1:31functional requirements. Functional
  58. 1:32requirements are just the features of
  59. 1:34the system.
  60. 1:36These are easiest to write as a users
  61. 1:37should be able to statements. Treat this
  62. 1:40part like a conversation with a product
  63. 1:42manager that you would have on your
  64. 1:43team. You want to ask them targeted
  65. 1:44questions so you can understand what it
  66. 1:46is you need to build, like whether or
  67. 1:47not users can edit tweets or whether the
  68. 1:49feed is purely chronological or
  69. 1:51something more intelligent. That way you
  70. 1:53can land on a short prioritized list.
  71. 1:56If you freeze up, I found it helpful to
  72. 1:58imagine that you have the app or the
  73. 1:59website the product in front of you.
  74. 2:01What do you see? What comes up on each
  75. 2:03screen? That should keep you going.
  76. 2:06For Twitter, users should be able to
  77. 2:07post tweets, they should be able to
  78. 2:09follow other users, and then they should
  79. 2:10be able to see a feed of tweets from the
  80. 2:13people they follow.
  81. 2:14Like I said, you really want to keep
  82. 2:15this list short. Every requirement you
  83. 2:17write down is something that you are now
  84. 2:19on the hook to design. And a lot of top
  85. 2:21tech companies grade you directly on
  86. 2:23whether or not you can really zone in on
  87. 2:25what matters, so you don't want to
  88. 2:26introduce distractions.
  89. 2:28Three here is plenty.
  90. 2:30You could say it plainly in your
  91. 2:31interview, something like I'll focus on
  92. 2:33posting, following in the feed, and I'll
  93. 2:35treat likes, search, and DMs as out of
  94. 2:38scope unless you'd like me to include
  95. 2:39them.
  96. 2:40This way you're opening the conversation
  97. 2:42to the interviewer so that you both can
  98. 2:44agree on the scope and then move forward
  99. 2:45with the rest of the design. Then the
  100. 2:47next thing that you'll do is what we
  101. 2:48call the non-functional requirements.
  102. 2:50These are just the qualities that the
  103. 2:52system needs, things like the system
  104. 2:54should be highly available or the system
  105. 2:57should scale. Make each one really
  106. 2:59specific to the system that you're
  107. 3:00designing, and where you can, even put a
  108. 3:03number on it. So for example, candidates
  109. 3:05will say like this system should be low
  110. 3:06latency, right? This tells me as the
  111. 3:08interviewer nothing because every system
  112. 3:11in essence needs to be low latency or
  113. 3:12usually that's the goal anyway.
  114. 3:14But saying something like the feed
  115. 3:16should load in under 200 milliseconds
  116. 3:18tells your interviewer exactly which
  117. 3:19part has to be fast and how fast.
  118. 3:22For Twitter, the non-functional
  119. 3:23requirements might look like the feed
  120. 3:25loading in under 200 milliseconds,
  121. 3:27choosing availability over consistency,
  122. 3:29and then being able to scale to support
  123. 3:31100 million daily active users.
  124. 3:33If you're not sure where to start, run
  125. 3:35down this short checklist,
  126. 3:37consistency versus availability,
  127. 3:39environmental constraints like battery
  128. 3:41or bandwidth, scalability and the
  129. 3:42read-to-write ratio, latency,
  130. 3:45durability, security, fault tolerance,
  131. 3:47and compliance. Importantly, most
  132. 3:49systems need all of these things,
  133. 3:52but your job is to call out the three to
  134. 3:54five that are uniquely interesting for
  135. 3:56this particular problem. In Twitter's
  136. 3:58case, it's incredibly read-heavy. Far
  137. 4:00more people read tweets than they do
  138. 4:02write them, And so a tweet that shows up
  139. 4:04a few seconds later is totally fine. But
  140. 4:07a slow feed would kill retention.
  141. 4:09Don't worry about getting everything
  142. 4:10here. Focus on just those important
  143. 4:12things rather than being comprehensive.
  144. 4:14Next up, many guides tell you to do
  145. 4:16back-of-the-envelope math next.
  146. 4:18I'd skip it, and I strongly recommend
  147. 4:20that you do too, at least upfront.
  148. 4:23Doing math out loud and on the spot is
  149. 4:25almost nobody's strong suit.
  150. 4:26And I've seen time and time again
  151. 4:27candidates sit in front of me and they
  152. 4:28spend about 10 minutes or so trying to
  153. 4:30do all of this math, calculating daily
  154. 4:32active users, storage, queries per
  155. 4:34second. At the end of all of this math,
  156. 4:35they kind of look at me and they go,
  157. 4:37yeah, so it's a lot or it's a big
  158. 4:38number.
  159. 4:39Okay, cool. We already knew that, and we
  160. 4:42learned nothing about you as the
  161. 4:43candidate, and this was ended up just
  162. 4:45being largely a waste of time.
  163. 4:47So doing math is good,
  164. 4:49but only do it when the outcome of that
  165. 4:51math is going to actually have a
  166. 4:52material difference on the system that
  167. 4:54you're designing.
  168. 4:55So you can tell your interviewer this
  169. 4:56upfront. Say, I'd like to skip
  170. 4:57estimations for now and do the math when
  171. 4:59it affects a decision later on.
  172. 5:01So when does it actually matter then?
  173. 5:03Well, let's take our Twitter example.
  174. 5:04Imagine that we're later on in our deep
  175. 5:06dives and we need to look at
  176. 5:07precomputing every user's feed and
  177. 5:09keeping it in a cache. When we do, we'll
  178. 5:11need to know whether that cache can fit
  179. 5:13in a single server's memory or if we're
  180. 5:15going to need to shard it. That's when
  181. 5:17you would do the math. So right there on
  182. 5:18the whiteboard, next to the cache that
  183. 5:20you're making a decision about, you can
  184. 5:22do your 100 million users each with 200
  185. 5:24newest tweet IDs, 8 bytes apiece, 160
  186. 5:28gigabytes. That's more than you want on
  187. 5:30one node, so you would end up sharding.
  188. 5:32Next up, we suggest that you take a
  189. 5:33couple minutes to list out your core
  190. 5:36entities. These are just the nouns of
  191. 5:38your system. They're the things that
  192. 5:39your API will pass around and that your
  193. 5:41system will store. And your functional
  194. 5:43requirements already name most of them.
  195. 5:46Users post tweets and follow other
  196. 5:48users. So for Twitter, the core entities
  197. 5:50are user, a tweet, and a follow.
  198. 5:52If the entities aren't obvious, just
  199. 5:54look back at your functional
  200. 5:55requirements and ask what data do you
  201. 5:56need to store to support each one of
  202. 5:58these.
  203. 5:59You can keep it as just a simple
  204. 6:01bulleted list on your whiteboard and
  205. 6:03tell the interviewer that it's just a
  206. 6:04first draft. You might end up coming
  207. 6:06back to it. But what it's going to do is
  208. 6:07it's going to orient your thinking so
  209. 6:09that as you move later into your design,
  210. 6:11into both the APIs and eventually onto
  211. 6:13the schema, you have a clear
  212. 6:15understanding of these nouns that you're
  213. 6:16passing around.
  214. 6:18It's really tempting to write out that
  215. 6:19full schema here,
  216. 6:21but you don't know enough yet. So my
  217. 6:22strong recommendation to you is that
  218. 6:24you're going to leave the fields for the
  219. 6:25entities, the columns, so when you get
  220. 6:27to the high-level design and you
  221. 6:28actually add your database and you
  222. 6:30realize exactly what columns you need
  223. 6:32and you can write them down directly
  224. 6:33next to your database.
  225. 6:35The last thing is try to pick good names
  226. 6:37here, too. You could probably get away
  227. 6:39with something, you know, stupid like
  228. 6:41foo and bar, but naming really is one of
  229. 6:43those hard problems in computer science
  230. 6:46and some interviewers do notice whether
  231. 6:47you're good at naming things, as funny
  232. 6:48as that sounds. The next step in the
  233. 6:50framework is the API.
  234. 6:52There are really only two decisions to
  235. 6:53make here.
  236. 6:54Which protocol do you use and which
  237. 6:56endpoints do you need?
  238. 6:58Don't spend too much time on the first
  239. 7:00of those decisions because REST with
  240. 7:02resources and HTTP verbs is almost
  241. 7:05always the right answer.
  242. 7:06If the product has some real-time
  243. 7:08features like live updates, then you
  244. 7:10could add WebSockets or server-sent
  245. 7:12events.
  246. 7:13You can also choose an RPC-style setup
  247. 7:14like gRPC, but it's rarely worth the
  248. 7:17debate in your interview. So 95% of the
  249. 7:19time it's going to just be REST.
  250. 7:21For Twitter, we'll use REST and then
  251. 7:23we'll write one endpoint for each of our
  252. 7:25functional requirements.
  253. 7:27The endpoints map almost one-to-one with
  254. 7:29those functional requirements and the
  255. 7:31resources come straight from your core
  256. 7:33entities as plural nouns.
  257. 7:35So posting a tweet is just a post to a
  258. 7:38tweet endpoint with the text in the body
  259. 7:41and you can fetch a single tweet with a
  260. 7:43GET on a tweet resource.
  261. 7:46Following someone is a post to a follows
  262. 7:48resource with the ID and the user you're
  263. 7:51following and the feed is a GET on feeds
  264. 7:54that returns a list of tweets. Now
  265. 7:56there's a lot more to good API design
  266. 7:58than can fit here and we have a full
  267. 8:00video and an article on it if you want
  268. 8:01to go deeper. The next step, which I'll
  269. 8:03really briefly mention, this one's
  270. 8:04optional and most problems do skip it,
  271. 8:07but if you're building a data processing
  272. 8:08system or something like a web crawler,
  273. 8:10for example, writing down the data flow
  274. 8:13as a short numbered list before you
  275. 8:15design can be incredibly useful. So
  276. 8:17fetch the seed URLs, parse the HTML,
  277. 8:20extract new URLs, store the data, and
  278. 8:22repeat. And you can then draw the system
  279. 8:24by just working through each of those
  280. 8:26steps one by one.
  281. 8:28Twitter is mostly just request
  282. 8:29responses, so we're going to skip the
  283. 8:31data flow. Now next up is that you head
  284. 8:33to the whiteboard and you actually start
  285. 8:34doing what is my favorite part and you
  286. 8:35start getting to draw boxes, components,
  287. 8:37and arrows, and that's the high-level
  288. 8:39design. It's going to get the biggest
  289. 8:40share of our time, 10 to 15 minutes. Now
  290. 8:43the goal of your high-level design is to
  291. 8:45just get the simplest design down that
  292. 8:47satisfies your functional requirements.
  293. 8:49Tell your interviewer this upfront. Tell
  294. 8:51them I'm going to get something working
  295. 8:52end-to-end first, and then I'm going to
  296. 8:54address its limitations via my deep
  297. 8:56dives by going through my non-functional
  298. 8:58requirements. The easiest way to do this
  299. 9:00is to just go endpoint by endpoint,
  300. 9:02which is effectively functional
  301. 9:03requirement by functional requirement.
  302. 9:05So if we take our first endpoint,
  303. 9:07posting a tweet, the request is going to
  304. 9:09go through an API gateway, it's going to
  305. 9:10hit a tweet service, and then we're
  306. 9:12going to write that tweet to our
  307. 9:13database. As you're drawing, make sure
  308. 9:15that you're talking through what each
  309. 9:17request carries and what it changes.
  310. 9:19Then when you reach the database, as I
  311. 9:21mentioned earlier, jot down the fields
  312. 9:23that your design depends on right next
  313. 9:25to it. For a tweet, that might be an ID,
  314. 9:27the author ID, the text, and the
  315. 9:29creation time.
  316. 9:30From there, you continue that same way
  317. 9:32with each other endpoint, following and
  318. 9:34then getting the feed until each
  319. 9:36requirement has a path through the
  320. 9:37design.
  321. 9:39As you go, you're going to notice
  322. 9:40problems with your design, and that's a
  323. 9:41good thing. Point them out, make a quick
  324. 9:43note of them, and then keep going so you
  325. 9:45don't get stuck yet until you have that
  326. 9:46working high-level design.
  327. 9:48This is because the mistake I see
  328. 9:50candidates make so often is that they
  329. 9:51spend 8 minutes trying to fix a
  330. 9:53bottleneck before they've even shown us
  331. 9:55how the rest of the system works. And so
  332. 9:57we'll come back to those problems during
  333. 9:58the deep dive, not focus on them during
  334. 10:00our high-level design. That way, once
  335. 10:02every requirement has a path to the
  336. 10:03design, it's finally time for us to
  337. 10:05address those limitations. We can do
  338. 10:07this by just starting with our
  339. 10:09non-functional requirements and going
  340. 10:11one by one through each of them.
  341. 10:13What needs to be faster? What needs to
  342. 10:15scale? For us, the first one was that
  343. 10:16our feed needs to load in under 200
  344. 10:18milliseconds. And so one fix is to have
  345. 10:21a fan out on write. Each new tweet gets
  346. 10:24pushed into a pre-computed feed for
  347. 10:26every follower, kept in a cache like
  348. 10:27Redis so that loading a feed is a single
  349. 10:30read.
  350. 10:30Accounts with millions of followers
  351. 10:32break this, so they stay on fan out on
  352. 10:34read. In an interview, that trade-off is
  353. 10:36where you would spend most of your time
  354. 10:38in the deep dives.
  355. 10:39Now I'm moving through Twitter's details
  356. 10:41quickly on purpose. Our design
  357. 10:43Facebook's news feed breakdown on Hello
  358. 10:45Interview is totally free and it takes
  359. 10:46nearly this exact problem through every
  360. 10:48single step of the framework, celebrity
  361. 10:50accounts included.
  362. 10:51Watching our breakdown videos is the
  363. 10:53best possible way to see this whole
  364. 10:54delivery framework played out for a full
  365. 10:57problem. Now back to focus on the deep
  366. 10:58dives.
  367. 10:59How much of the deep dives you lead
  368. 11:01depends on your level. Junior candidates
  369. 11:03can expect that the interviewer is going
  370. 11:05to point them at the weak spots and ask
  371. 11:06targeted questions, and they should be
  372. 11:08able to answer them as best as they can.
  373. 11:10Senior and up candidates, on the other
  374. 11:12hand, should be able to find those weak
  375. 11:13spots themselves and proactively drive
  376. 11:16the conversation. You want to be really
  377. 11:18careful here though. Leading doesn't
  378. 11:20mean talking non-stop.
  379. 11:21A common mistake here is just talking
  380. 11:23over the interviewer and then they never
  381. 11:24get a chance to ask something that they
  382. 11:25want to ask.
  383. 11:26They usually have some set of specific
  384. 11:28signals that they want from you. And if
  385. 11:29you never leave a gap, then they can ask
  386. 11:32those questions and end up never getting
  387. 11:33to them. So just make sure that you
  388. 11:35leave some room. As you're leading the
  389. 11:37conversation, check in every once in a
  390. 11:38while. I'm going to go move on to this,
  391. 11:40but is there something that you'd like
  392. 11:41me to focus on instead? This invites
  393. 11:43them to come in with any questions that
  394. 11:45they've been preparing.
  395. 11:46Now there are a couple questions that
  396. 11:47come up a lot when candidates learn the
  397. 11:49delivery framework.
  398. 11:50Like what if your interviewer starts
  399. 11:51asking you deep dive questions before
  400. 11:53you finished the high-level design?
  401. 11:56Well, that's okay. Follow their lead.
  402. 11:57They usually jump in because they've
  403. 11:58seen enough of the basics and they want
  404. 12:00to get a specific signal.
  405. 12:01Answer their specific question and if
  406. 12:03there's a gap left in the design, just
  407. 12:05mention it out loud so they know that
  408. 12:06you're going to come back to it. Another
  409. 12:08question we'll hear is that if you're a
  410. 12:09staff-level engineer, do Do need to
  411. 12:11start with the most basic
  412. 12:13before moving into the deep dives?
  413. 12:15And the answer is you don't. There's no
  414. 12:16reason that you have to start with the
  415. 12:17most naive design, but you want
  416. 12:20something that works and to end before
  417. 12:21you start going really deep. And so you
  418. 12:23can always start a step above the basics
  419. 12:25regardless of if you're staff, senior,
  420. 12:27or even mid-level. You just want to get
  421. 12:29to a place where something is working in
  422. 12:30a quick enough period of time so that
  423. 12:32you can spend time going deep.
  424. 12:34Another question that we'll get is how
  425. 12:35much should I actually be drawing on the
  426. 12:37whiteboard?
  427. 12:38And the answer is enough that somebody
  428. 12:40walking in halfway through could follow
  429. 12:42it.
  430. 12:43This is important because your
  431. 12:44interviewer often finishes the interview
  432. 12:45and then they go rush to a meeting. Then
  433. 12:47they have a busy day. They go home.
  434. 12:49Maybe they have a a busy day with their
  435. 12:51family life and they come back the next
  436. 12:52morning and think, shoot, I have to
  437. 12:53write that interview feedback for Tim
  438. 12:55that I did yesterday.
  439. 12:57Good chance they don't remember much
  440. 12:58about it.
  441. 12:59So they're going to open up your
  442. 12:59whiteboard, see their notes, and pick
  443. 13:01back up from there. So that's the whole
  444. 13:03delivery framework. Requirements, core
  445. 13:05entities, an API that maps onto those
  446. 13:07requirements, a high-level design that
  447. 13:10supports each of those endpoints, and
  448. 13:12then a deep dive that addresses the
  449. 13:13biggest limitations via your
  450. 13:14non-functional requirements.
  451. 13:16The idea is to have a clear plan going
  452. 13:18into the interview so that you can spend
  453. 13:20time actually designing the system and
  454. 13:23not figuring out how to navigate the
  455. 13:25internals in the interview.
  456. 13:26Here at Hello Interview, we've used this
  457. 13:28same framework on more than 30 system
  458. 13:29design problem breakdowns, most of which
  459. 13:32are totally free and each of which have
  460. 13:34a video and an accompanying article.
  461. 13:36So my recommendation to you is to grab
  462. 13:38one of those 30 problems and practice
  463. 13:40going through it yourself using the
  464. 13:42delivery framework. And after a handful
  465. 13:44of repetitions, doing a bunch of
  466. 13:46different problems, you shouldn't need
  467. 13:47to think about the steps anymore.
  468. 13:49If you want to practice going through
  469. 13:50the framework yourself, our guided
  470. 13:52practice on hellointerview.com has each
  471. 13:54of those 30 problems broken down step by
  472. 13:57step where you can work through them in
  473. 13:59order, getting instant feedback on each
  474. 14:01of the steps before moving on to the
  475. 14:02next one. Then when you feel like you
  476. 14:04have the framework down and you're ready
  477. 14:05for the real thing, our live practice is
  478. 14:07going to run you through a full mock
  479. 14:09interview with an AI interviewer on a
  480. 14:11shared whiteboard.
  481. 14:12All right, that's the Hello Interview
  482. 14:14delivery framework. Hopefully this was
  483. 14:15useful to you. And most importantly,
  484. 14:18good luck with your upcoming interviews.
  485. 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.