I’ve always aced these but I don’t know if I’ve ever had a hard one. Last one I got was “YouTube just crashed and you have to rebuild it from scratch...” They just wanted to see if I’d consider the CDN and transcoding, making sure that it’s componentized in a way that removes single point of failure. But if that’s a typical question, then are there any hard ones for people who actually design systems? Surely..
Designing google docs, designing distributed transactions, distributed key value store are pretty involved. The first can go pretty deep talking about OT, CRDTs or other forms of conflict resolution. The latter ones can go into deep about replication, sharding schemes and atomic commit protocols such as 2PC.
How to prepare to be in a position to answer well these questions?
True this is a good one. Great article about Figma’s approach- https://www.figma.com/blog/multiplayer-editing-in-figma/
Any of them. It really depends how deep your interviewer wants to go.
What design questions would one ask to level 64 or senior msft engineer?
I found it hard to design uber. Particularly when it matches you to drivers nearby. No clue how that’s done
I don't know either but if I had to take a guess, it's a graph problem. Each user's phone has a location and weight(s) based on location, destination route, route proximity to other's routes.
Naive implementations are somewhat approachable. In general, you’ll start with a queue of “needs rides” and match for the closest distance/top of “needs rider” queue. That’s your foundation, everything from there is an optimization (until you make the whole thing a neural net). Pure coordinate distance is an easy calculation but you’d soon need to make it a graph problem for cities to include weights based on traffic/average speed throughput. But this still just is an optimization on your “distance” variable. It becomes a synthetic “proximityScore” variable that weighted sums all the proximity details into account. The more naive, the more boneheaded if-statements you’ll have for options like car type, rating>X, etc in the queue matching. But in general, anyone can start with that queue matching foundation and just optimize where business suggests to.
Design a ha and scalable service to generate and serve monotonic increasing ID's.
Twitter snowflake
This one is fun. 0. Clarify actual constraints/opportunities for optimization.. 1. Buy a huge memory/io box on AWS (scalability doesn’t always mean horizontal- see Stackoverflow’s big box arch) 2. Lightweight server increments from memory with backup and failover to disk, which backup/failovers to external disks 3. Maybe an emergency failure replica in other zone which boots up last ID from external backup and serves I’m sure there’s a smarty pants thing I’m missing.. I never know the shorthand *tricks*. Clarification needed on how severe a clash would be in event of catastrophic failure and reboot (if critical, the save to memory, backup, and external has to be atomic, decent performance hit.) Probably need to store IDs as strings or scientific notation for the massive numbers.
Airplane price system
This requires domain knowledge, I guess. Can you give some hints?
This is so complex of a system that I think this is where you make that jump to a neural net or other ML system that manages the many features that the problem has as variables. I fact, you’d probably even want ML for the feature detection itself.
Design an elastic load balancer
I was asked by Google
Beyond a round robin approach? Load balancers can be very simple. You can write one in a low level language just to hold a set of destinations and an index of the last selected one. For “elasticity” just have a private rest API to add/remove destinations.
Design Chrome remote update - friend was asked this question by google
For implementation like on the desktop app? Have database of versions. Just poll every X minutes/listen on socket to API expressing new versions since lastUpdated. Download the binary in background to tmp, move completed binary to apps directory, kill current process and reload. Any deeper than that?
Given Chromiun and chromium os have new releases every couple of hours your approach would not work.
design a leaderboard for a contest (i.e. leetcode contest)
Need more constraints for a decent answer. Quick and dirty- just store the scores in an “entries” table and sort by score. Mega scale, it’d be costly to compute that sort at each query so you’d probably just have an event on saving user entries to balance a Redis-like ordered set with the new entry.
2024 Presidential Election
3h
581
Vote for Trump?
Tech Industry
Yesterday
1437
Do you really think Amazon is that bad
Tech Industry
21h
346
If your company ceased to exist tomorrow, would you celebrate or be mad?
Health & Wellness
11h
944
How can I find success dating in NYC
India
Yesterday
2149
Slavery has REVERSED! the US is the slave!!! Check out this dude who pays a personal trainer in India
Any suggestions to prepare for System Design interviews?
Grokking the system design interview
highscalability.com case studies, and also just pry at your favorite companies to find their service architecture.