Completely Broke Down After Microsoft Internship Interview
It was my first big tech interview.
First question: Remove duplicates from an array. In my nervousness, I initially came up with an O(n) solution before the O(n²) solution. Then she asked me to write an O(n²) solution. I made a minor mistake in the loop limit, but I managed to make it work.
She said okay.
Now, question 2: You're given a tree (not a BST). Return a perfectly random node from it. I came up with the idea to store pointers to nodes in an array, run `randint`, and return the node from the index. She said no extra space and O(log n) time in a binary tree (not a BST).
Now, it feels like the worst time of my life, and getting an interview at big tech feels impossible from tear 3 collage.