Google L4/L5
Had virtual onsite for Goog 3-4 days back, 3 coding rounds. Bit of unlucky day.
First interview: Found optimal solution right away. Explained solution for over 10 mins. After coding done, interviewer added a follow up with 10 mins left. Failed to recognise a simple extension to my solution could have handled this. Just 1 minute after the interview correct solution hit my mind :(.
Second interview: By far the most unfortunate one. I listened to question, noted it in shared doc, asked clarifying questions. Explained a dp approach and time complexity and told I would be writing recursive solution with memo. Interviewer agreed. Wrote the code, interviewer doubted about time complexity and asked me to revisit the code. I did and found same time complexity. Next 20-25 minutes went on discussing about time complexity with no agreement at the end. Lesson learnt: Always code bottom up dp.
Third interview: Found optimal solution for first problem quickly, coded it fast. Got second problem. Failed to recognise it as a graph problem. I felt interviewer kept on giving hints way too fast causing thinking even more difficult.
Sometimes I blame the lack of sleep the previous night. The feeling of I could have done much better haunting me :(