CTC: 28 LPA
Profile: Software Development Engineer
Mode: Off Campus
Round 1: Paper Coding
3 Coding questions
Given two linked lists each represents a number, write a function that returns a linked list that represents sum of two numbers represented by the given linked lists.
123 represented as 1->2->3
456 represented as 4->5->6
o/p: 579 represented as 5->7->->9
Given an array find if sum of any two numbers in the array is zero
Next greater number with same number of digits
Very famous question
Round 2: F2F
Given a string and an array of string that represents a dictonary, count and print all the anagrams of the given string that exists in the given dictonary
asked me to write production ready code. Remember in amazon interviews always write error free code that can handle all the edge cases.
Given a tree and address of a node in the tree, find all the nodes that are at k distance from the given node
wrote full code, some minor edge cases were not handled in first attempts so he asked me to find those and correct the code.
Even in second attempt code was not handling all the cases he asked me to do it again
Third attempt still some cases were missing
In Fourth attempt he was satisfied, some errors were there but he was satisfied
So Never Give Up
Round 3: F2F
Given a linked list where each not has 2 pointer fields one nextPtr for next node and 1 randPtr that points to a random node. Create a copy of the given list but you can not modify the given linked list.
Write code on paper that should handle all the cases.
He asked me to dry run the code.
Reverse the given sentence word by word.
Given a BST find the distance between two given node(by value), handle all the cases if value is not present in the tree.
write the code and dry run it.
Round 4: F2F
Project discussion (45 min)
Tips: Prepare your project in such a way that when you explain interviewer should be able to understand it. First explain what the project is and how it works(just overview). If he asks then only go for code or class diagram.
He found my project interesting so arround 40-50 min he was discussing on project only that too without single line of code.
Given an array and a empty tree, insert the array elements in the tree such a way that it should become a BST
Handle the cases if no of nodes in the tree are more then array size and vice-versa
Asked me to write code on paper and dry run it.
Round 5: F2F
Project discussion(30 min)
Given a grid with zero and ones where find the sortest path between given two cells where you can travel over ones only
This questions took very long time, I gave him approach he modified the questions, again I gave him approach he modified the question. He repeated this for 4 times.
Given an expression like 3+5*6/4+0-4/3 evaluate it.
I told him it can be solved by stack after converting it into pospix
He asked me to write the code for it, I was not able to re-call exact algo but I explained him whatever I had figured out from 2-3 examples, he was satisfied.
Question 3: (worst question of the interview process)
He confused me alot with the question either I was not able to understand well or he was not explaining properly.
At last question was, Given a family relation ship as input:
A B Father B C Brother E C mother
Design your own data structure to store this family relation and answer the query print all the members who has only one grand parent and exact 4 child.