Friday, September 18, 2015

Amazon Coding Test and First Interview

# Coding Test
Amazon coding test was an average test (my hardest ever was Codility test for Codility which I thankfully passed). It consisted of 3 problems all easy to solve, but with tricky corner cases. It was on Codility were you can lock a problem after you finish it, or not and leave to the end, all up to you. My advice is do not lock the problems just leave it the end. I locked a problem then I figured out there was a subtle bug in my code, it would make my solution fail for most of the cases. Anyway I passed this test and moved the first interview. I think at Amazon they take both your coding test and the interview together to determine if you will pass to the next phase or not, that is why I did the interview although failing drastically in the coding test.

Lessons learnt:
1. Avoid over confidence.
2. Write test cases before submitting your code, imagine this code is going for production wouldn't you do so?

# Interview
The interview was really hard, he asked question about system design, algorithms, behavioral, knowledge, scalability, lots of aspects. Here are the list of questions:

  1. A question about My pattern analysis course? He was so detailed oriented.
  2. Did you dive deep before? How?
  3. What is the difference between an abstract class and an interface?
  4. What is a static method?
  5. How do you use static method?
  6. What is the difference between Public, Private, and Protected?
  7. What happens you write an address in the address bar, until you load the page?
  8. How to make the DNS so fast?
  9. How to make sure your cache is valid? How to make it fast?
  10. Why a system might be in an inconsistent state?
  11. Give an example of a system that is available but not necessary consistent.
  12. What is the complexity of inserting into a hash function?
  13. What is the worst case scenario?
  14. What to use instead the linked list within the hashmap?
  15. What will be the complexity of that?
  16. Given about 50M Resume remove the duplicates?
Lessons Learnt:
1. Sometimes the question is really simple like what is the complexity of inserting into a hashmap, do not over estimate the problem just give the answer O(length of input)
2. Do not just say things you know, say things related to the question.
3. You will be asked really tough questions about everything you have in your resume, so be mindful about what you write there.
4. Design questions should be answered in a specific way: a) Determine the use cases and the constraints b) Abstract Design c) Understanding Bottlenecks d) Scaling your design.
5. The interviewer should be treated as a co-worker not an interrogator, so be friendly.
6. Ask questions don't jump into answers without clear definition of the question.
7. RULE OF THUMB, imagine every question you are being asked is a problem you face at work, for example if it was a design question, imagine it will be your project for the quarter.
8. Do not say unrelated, unnecessary shit, as the interviewer will most probably ask about it.

Tips:
Amazon looks for experienced developers rather than competitive programmers, so in order to get there go work for a year or so then apply again.

No comments:

Post a Comment