Got this systems design question from a crypto trading firm, but didn't answer it well due to my lack of experience. Its a really simple one but really open-ended as well. "How would you design a realtime engine which takes in some market quotes from the exchange, does some calculations, and place some orders back into the exchange?" Isn't it just a matter of subscribing to the tickers through a websocket, write the calculation logic inside the callback function whenever a quote is received, and call the exchange API to publish some orders? What am I missing out on and what else should I have talked about? How would you answer this? TC: 240K
What if there is a major fed event and how is your prepared to handle it? What if market quotes stop feeding? Stateful sockets aren't trivial, that in itself is a question - think like a bunch of friends are flooding your whatsapp group. Ordering is a well known problem. What's yoe and target level?
If you’re ever wondering what did I not talk about, it means you probably didn’t ask enough questions. System design interviews should feel like you’re crunched for time because there’s SO much to talk about. If you have time left over you probably didn’t ask enough questions. There’s no way that you’d be able to design this seemingly “trivial” system in a one hour time, even if you were doing it as part of your own side hobby.
It’s actually not trivial. It is common scenario in interviews.
That’s why I put it in quotes
Real time means requests coming in streams. How would the system handle dropped messages? Fault tolerance, disaster recovery, caching, message queuing etc. You should cover all these, then the interviewer would dive in more details and question. There's much more to talk about than the flow. You need to talk about things that'll keep the system running in prod
India
Yesterday
585
Modi is a legend, will be remembered for centuries to come
Personal Finance
Yesterday
641
Joining a PIP factory. Rate my cash reserves
Tech Industry
Yesterday
1400
The end of Backdoor Roth?!
2024 Presidential Election
Yesterday
639
Heartwarming peaceful protests
Tech Industry
Yesterday
1758
Quitting this Slave life
Before starting to answer this question, you first need to ask 10 more questions to understand the requirements, the goals, the non-goals, etc. from the interviewer. The question is intentionally under specified to trigger your thinking. This applies to any system design interview.