System Design: Real-time Superbowl Voting (with FAANG Senior Engineer)

preview_player
Показать описание
System design for a real-time superbowl voting service by a FAANG Sr SWE that has reviewed over 100 design documents 📚

Common names for this system design interview question:
- Voting Service
- Online Polling Service
- Electronic Ballot Service
- Online Survey Service
- Election Service

Request other problems for me to cover here:

Here's a link to our discord channel where I organize the live discussions every weekend:

Originally recorded 12/17/2022

#systemdesign #programming #technology
Рекомендации по теме
Комментарии
Автор

thanks for sharing this! really helpful

xiaoyinqi
Автор

Regarding the discussion about CountMin Sketch. I guess it could be the way to go depending on the flexibility of the requirement, ie:
For this case where we're trying to vote for who the winner will be on the SuperBowl, data not being entirely accurate can be accepted but for an electronic presidential election for example.
Count Min Sketch could not work or at the very least it should be tune in a way that the given probability of error is reduced (more hashing) but that obviously comes with a performance penalty

carlosluque
Автор

Thanks. This one is very helpful. It built many foundational concepts such as thread contention problem solving. But its not clear how thread contention would be solved here for incrementing the counter. In this solution, even if there are 1000 counters, there is possibility of few of 165 counter increment request would be concurrent. How would that work, then? Increasing teh shards reduces the contention but doesn't eliminates that. How would our writes be sequential? can we use broker partition by shard number and asssign one consumer per partition? Thsi would ensure that one single consumer of message would be processing messages sequentially and updating counter in sequence?

mayuragrawal
Автор

So, a message queue can have multiple consumers? (around 41:48)

halterskelter
Автор

Thanks for this. It was really insightful.
One question I have is how does the CDN and UUID prevent vote duplication?

chigozie_jesse
Автор

If the user is not logged in, how do you create a uuid that corresponds to each user to do the de duplication?

maximizedchen
Автор

why.. not simply having the api gateway to prevent duplicates using rate limiting per devuce? why sharding aswell considering you can use dynamoDB and aws which would handle that for you?

MrSaggat
Автор

hope you voted for Democrats when you waited for 2 hours!

abyss