Round 1 - Online Assessment (OA)
There were two medium-level questions. The second question was implementation-heavy and involved creating an in-memory database and handling transactions through different phases.
Round 2 - Coding
The interview started with a discussion of my projects and past experiences. I had to implement an API handler with very low latency. I suggested using multithreading since some tasks were independent. Although I was a bit rusty with multithreading and couldn't implement it well, I provided a strong theoretical answer and covered all edge cases, which seemed to satisfy the interviewer.
Round 3 - DSA
Question 1: Best Time to Buy and Sell Stocks. Question 2: Best Time to Buy and Sell Stocks III.
I quickly provided a dynamic programming (DP) approach for the second question, and the interviewer agreed. I began implementing it when she mentioned that she wanted the most optimal answer, which is O(N). Not knowing the greedy solution and running low on time, I panicked a bit. With a hint from the interviewer, I was able to solve it and implemented it quickly. She was very supportive and helpful throughout the interview.
While not my best performance, the round went well; I received positive feedback and was called for the next round.
Round 4 - High-Level Design (HLD)
We discussed my current projects and some technical questions. Then, I was asked to design PasteBin, including how to generate URLs for the content. We discussed this and follow-ups for a long time. Although I couldn't complete my design in time, the overall discussion went well.
The interviewer was very soft-spoken and made me feel comfortable.
Round 5 - Hiring Manager (HM)
This was the most challenging round.
I had to design an algorithm that generated a random stream of specific characters, each with a weight, such that the summation of the stream's probability remained close to 1. Since the stream had to be random, I couldn't use any prior information about the stream to generate the next character.
Maintaining uniform distribution and meeting the summation criteria was difficult. The problem boiled down to creating a weighted random function after discussing various possible solutions that the interviewer gently rejected.
After resolving the weighted random function part, there were several follow-up questions on how I would choose the character or find it in my array of input characters. The interview ended on a positive note, though it was mentally exhausting.
The recruiter confirmed that all rounds went well, and I am now waiting for the results.