Status: software engineer, 9 Yrs YOE
Position: SDE at Amazon
Location: CA
Date 7 Jan, 2022
Online assessment:
Consisted of 2 parts
Part 1:
2 coding questions.
I think I completed 1st coding question completely, but only able to pass a few test cases in 2nd one.
Part 2:
Behavioral questions and situation related questions
Phone Screen:
I was interviewed by a senior SDE. He asked me about my most challenging task that I took up voluntarily. I didn't expected such type of question, I thought it was only about coding. However, I gave my example though not well-prepared and not quite related to development.
Then he asked about how I learn new technology, I said the best way to learn is to actaully work on it. If any problem encountered, ask Google.
He was quite satisfied with my answer.
Then go to coding question, he asked there is huge dictionary, I was given a word, and I need to write a function to determine if the word exists in the dictionary. However, given the I/O is so expensive, I need to come up with a way to minize the disk access.
I said we can use a cache to record each query, if queried before, just return the answer from cache.
Then he adds on to ask what is the size of the cache, how to prevent out of memory exception and what to do if the limit is reached.
Initially, I proposed a round-robin approach to recycle the cache(ie. 1000, 0, 1, .. etc ),
But it may leads to most-queried one being erased. Then he said we should consider the freq / update time of the queries.
I said ok. I use another hashmap to store the query count of each entry in the cache, override the one with lowest freq.
Finally, I gave my complexity analysis , ie. O(N) when cache is full and need to find least queried one to replace.
However, 2 days later I got rejected. not sure it was about my behavioral question or I gave a sub-optimal solution in coding question.