Open In App

Amazon Interview | Set 55 (On-Campus)

Last Updated : 16 Apr, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

Online Test on InterviewStreet: 
18 MCQs (Normal C loop questions, networking, dbms, os, analytical) 
2 Coding questions 
1. Check if an undirected graph is a tree or not. 
2. Given an array of integers, print the 2 elements with least absolute difference. 

Interview Rounds:- 
Round 1: 
Tell me about yourself. 
1. Given a matrix(not necessarily square) in which the elements in a row, as well in a column are sorted. Find a given integer in the matrix. 
Tell the approach. And then code. 
2. Given a position where a knight is placed on an nXn chessboard. Find the maximum number of knights that can be placed on the board, so that no 2 knights attack each other. 
Remember that you need to just give the number of knights, not all their positions. I first could arrange ceil(n*n/3) knights. Then he asked me find a better solution. Finally I got to ceil(n*n/2). Then he asked me to code it. Then he asked me to remove the ceil condition(check for even and odd separately). 
He asked me if I had some question for him. I asked – Amazon strives to be the most costumer centric company on earth. What, as a programmer/developer, do you do to achieve this, because generally, the customer’s problems are an issue for high level managers and planners. 

Round 2: 
Started with some questions from my Intern project. 
1. Given a Binary Tree, replace the data of each node by the sum of data of all its descendent nodes.(Leaf nodes will have 0) 
2. Given a sorted array of positive integers, find the least missing positive integer. First I gave an O(n) solution. Then he asked me to optimize it. Finally I gave an O(log n) solution. 
3. Given a stream of numbers, find k random numbers from them. I explained him Reservoir Sampling approach. He asked why this approach works. What is the probability of each number being selected? What is the probability of any number being selected if stream has less than k numbers(its 1). 
He asked me if I had some question. I said I had one, but I already asked it to previous interviewer. He asked me if I got a satisfactory answer to it. I said the answer was very much satisfactory. 

Round 3 (CS Round): 
He asked me if I am comfortable with writing SQL queries. I prefered not to. 
1. What is an interface? Why it is used? Give an example. What is an abstract class? Why it is used? Give example. Why 2 different concepts of interface and abstract class? 
2. Do you know about singleton class? What is it? Implement a simple singleton class. I made some mistakes in making attributes static etc. He guided me and finally I corrected all bugs. 
3. Given a binary tree, where each node has an extra next pointer. Fill the next pointers so that each node’s next pointer points to its next sibling node. First I gave a solution where I would require a map, where each map key will be a level number, and value will be pointer to the last currently accessed node of that level. Then he asked me to do it without space. Finally I gave him a solution without space. I gave a non-recursive approach, and he asked me to code it. 

Round 4(Senior SDE 3 from Seattle Office): 
He told me about himself, his team, his work and his team’s work. 
1. Tell me about one of your challenging project/internship/class assignment. 
2. Give a situation from your life where you were given a negative feedback, and how did you tackle the situation. 
3. Explained me a cache situation, where, keys will be in cache, and each key will point to a string. It was LRU cache condition, and I had to implement the LRU cache. Then write a function to retrieve a string, given its key, from this cache. Retrievel should be O(1) (if you give O(n) retrival, he will ask you to make it O(1) ). 

Finally got an offer !! 🙂 🙂 

While you are answering a question, clarify any doubts that come to you mind. Dont take any assumptions by yourself at all. 
Keep on speaking your approach as you think. Keep speaking, if possible, even when you write code. They want to test if you really know the approach, and not just copying code. All rounds were technical and elimination. The last round has the highest weightage in their procedure. Write clean code, ask for some time if you want. 

Thanks a lot to the GeeksForGeeks team for helping with interview preparations! 🙂 

Many Many congratulations to the author.  

 

Related Practice ProblemsSave Knights

 


Previous Article
Next Article

Similar Reads

Amazon Interview Experience | Set 351 (Off Campus - For SDE I)
I attended the referral drive in Delhi, so we had to report to 10:00 AM at Amazon's office. ROUND 1: Written – Pen & Paper (11:00 - 12:00 PM) You have to write a short description first of your approach, put comments if necessary to explain that line's logic. Full Optimize Code should be written covering all the edge cases. Also mention the com
5 min read
Amazon Interview Experience | Set 376 (On Campus for Internship)
Amazon visited our campus(Jadavpur University) to recruit interns and FTEs. I'm sharing my internship interview experience. There were 3 rounds in all – 1 Online Round followed by 2 F2F Interviews. Online Round(90 min on Hackerearth): There were 20 questions mostly based on C, C++, DS, Reasoning and a few from OS, OOPS, DBMS etc and 2 coding questi
5 min read
Amazon interview Experience | Set 413 (SDET-1 On-Campus Internship)
This was a pool campus conducted by amazon for internship. Online Round: There were 20 mcq(+1 for each) and 2 coding questions(+30 for each). MCQ had more networking and DS problems. Given three linked list, add them. GeeksforGeeks Link Input will be of this format 1->0->1 8->9->9 5 Output: 1->0->0->5 Solving above problem in p
3 min read
Amazon interview Experience | Set 416 (On Campus for Internship)
Coding Round There were 2 coding questions (10 marks each) and 20 MCQ’s from various core concepts ( OS,DS,Algorithms,DB,C language etc ). Question 1 : https://www.geeksforgeeks.org/given-a-string-print-all-possible-palindromic-partition/ Given a string, find all possible palindromic partitions of given string. Question 2 : You are given with a lar
4 min read
Amazon Interview Experience | Set 432 (SDET Off – Campus)
My friend in Amazon referred me for the job . I was approached by the HR and after lots of delay (1 month), I was scheduled a Telephonic Interview. Round 1: (Telephonic Interview ) - 1h  A screen was shared (Notepad) where I will be writing codes and doing other rough work. I was doing conversation with him on phone. Given n sized stairs and we can
4 min read
Amazon Interview | Set 40 (On-Campus Round 1)
20 Objective type questions (Technical: OS, Java, Networking) and 2 programs. Time given was 90 minutes. 1) Longest Remaining Time Scheduling 2) Threads 3) subnetmask – classB – 64 departments 4) Match the following SMTP BGP TCP PPP 5) On recursion, value of f(513,2) if(n<0) return 0; else return ( n%10 + f(n/10, 2) ) 6) Complexity? f(i) = 2*f(i
2 min read
Amazon Interview | Set 41 (On–campus)
The first round had 20 multiple choice questions covering C programming, Data structures, Algorithms, Maths and puzzles, and a question from Networking and Operating systems. The duration of the test was of 90 minutes and marking scheme was +1, -0.25 It also had 2 coding questions. i) Given an array of numbers, find the minimum value of the absolut
4 min read
Amazon Interview | Set 42 (On-Campus)
Following questions were asked during interview. 1. Given an array, find the longest increasing subsequence of size 3 with max product, all numbers are positive. 2. Given 3 linked lists representing 3 numbers, add them and return the result as another list (take care that your method handles overflows). 3. Find the length of longest path in a binar
2 min read
Amazon Interview | Set 43 (On-Campus)
Questions asked in Amazon Interview. Round 2: Written 1. Find the SQRT of a number. 2. Simulate Reversed level order traversal. Three F2Fs. F2F 1: 1. Given a binary tree, no two adjacent nodes have same color, but all leaves should be in same color. You can fill only with two colors. Write a function to find whether a given tree can be colored usin
2 min read
Amazon Interview | Set 46 (On-campus for Internship)
Written: 20 MCQ on basics of C, OS, Networking + 2 Coding. 1) Left view of Binary Tree. 2) Rotate a matrix by 90 degree. Interview (Round-1) 1. You have to find p,q of matrix p*q such that it fill n elements(n given) Such that a) matrix should be nearest to a square matrix and b) 0Zig-zag traversal of tree 3. You are given an array of length k and
1 min read