Company : Amazon
Branches : CS & IT
Interview Type : On campus (Internship)
Interview Process: Cut off: 75%.
Round 1: 90 minutes
It comprised of 20 MCQs on aptitude, operating system, DBMS, data structures and algorithms on Hackerrank.
There were 2 coding questions
1. Given a string find the first non repeating character in it, O(n) was good enough.
2. Given an array of integers, find count of minimum number of elements to be removed from the array such that the maximum element of the new array is at most twice of the minimum. O(nlogn) solution was required.
Started with Introduction then he jumped into project and discussed about 15 mints.
Q1. Given an array of stock prices, find maximum loss in buying and selling stocks. I gave him appoach first, then he asked me to code. Coded it.
Q2. List of stations and distances between them are given and find all pairs shortest distance.(Floyd warshall algorithm in O(V^3).)
Q1. I was asked to throw some light on some trending technologies.(I explained about Cloud,Big Data etc.) It took 30 mins and he looked impressed.
Q2. Implement Dictionary(I asked about the basic layout and was told that lot of words have been already entered each having its definition,synonyms and antonyms).(I started from vector < vector< string> > , then HashMap, then Set > and then RB Tree approach too.)
Q1. Level Order Traversal in spiral form?
Q2. Merge k sorted arrays.(All approaches)?
Q3. Diameter of the Binary Tree?
1. Interviewer don’t expect you to give all correct answer though they want to see your approach first and how you tackle a problem which you don’t know apriori.
2. Along with basic data structures also have some idea of advance data structures like BBST,Trie,Graphs etc.