The first round at Mercor was a 30-minute live technical interview. It was rapid-fire Q&A, where you try to answer as many questions as possible. I only got through 3 questions, so I didn't pass.
The first question was to explain in detail a sorting algorithm faster than O(n^2). I gave merge sort. The second question was to give one slower than O(n^2). For brute force you can shuffle and then compare each number, which is O(n*n!).
Then they gave me a piece of code and asked me to find the problems:
The cache has no eviction policy and no size limit.
If there is concurrency, expensive_computation might run too slowly, so the caching has no effect.
What if expensive_computation returns an error?
Input validation.
Then they asked me to add an integration with Stripe.
How to do error handling. I used idempotency and retry.
What data needs to be stored, and which DB to use. ACID, availability.
Discussion
Loading comments…