Open In App

Amazon Interview | Set 123 (On-Campus for Internship)

Improve
Improve
Like Article
Like
Save
Share
Report

Online round: In this round there were 20 MCQ’s to solve and 2 coding question. Of the 20MCQ’s a couple of questions were on Quantitative aptitude, relationships, OS, DBMS, Data structures etc. there was negative marking for every wrong answer so I attempted only 15 for which I was sure.

Q1- find the first non repeating character in a string.

Q2- given a binary tree where each node has some weight. You have to return the max weight in the binary tree.
Maxweight = value of root node + value in its left subtree and right subtree.

Ex  - 2
   /   \  
  -1    3
Output = 4 

1st round(50 mins):
Q1. Reverse link list in k chunks
Interviewer was first interested in approach then he asked me to code.

Q2. Spiral order traversal of binary tree
I first told him 2 stack approach but he asked me to do without stack .Then I gave him a solution using one queue and one stack and he finally asked me to code both the approaches.

Q3. Longest palindromic substring
I first used DP but he asked me to do O(1) space complexity. I was unable to do so.

2nd round :
Q1. Connect sibling pointer in a binary tree
Connect Nodes at Same Level
https://www.geeksforgeeks.org/connect-nodes-at-same-level-with-o1-extra-space/

Q2. Push ,pop and min operations in O(1)

He asked me to do middle operation also and then he asked me to code 2nd problem.
https://www.geeksforgeeks.org/design-a-stack-with-find-middle-operation/

Q3. Given n point in a 2d plane ,find k distant nodes from the origin.
I told him min heap approach and he was satisfied.

Q4. Problem statement was very long but it was topological sorting.

I used adjacency list representation, he asked me why
And finally asked me to code it.

Overall it was a very nice experience interviewing with them.

Some tips:


Last Updated : 24 Jun, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads