4 ms·
Hmm… this code doesn’t work in the real world unless you only run it on a single machine. Perhaps a more interesting question is how to make a multi-node queue
by dudeinjapan 1y ago
Hmm… this code doesn’t work in the real world unless you only run it on a single machine. Perhaps a more interesting question is how to make a multi-node queue with max N concurrent requests.
- davidgomes 1y agoThe whole point of this interview is that the candidate is operating on a single-threaded environment.
- ramon156 1y agoThese are multiple assumptions "This queue is only on one machine and on one thread", what's the real world use-case here? Not saying there's none but make it clear. I wouldn't want to work for a company that has to think of some random precise question instead of e.g. "when would you not use mysql?"
- dudeinjapan 1y agoI guess I don’t want to hire candidates who assume the world is single-threaded
- jonchurch_ 1y agoThis is handled in the framing of the question: “… it doesn't ever have to handle more than one request at once (at least from the same client, so we can assume this is a single-server per-client type of architecture).“ For sure a multithreaded async queue would be a very interesting interview, but if you started with the send system the interview is constructed around youd run out of time quickly.