uday4friendz
BAN USER- 0of 0 votes
AnswersThis was the 2nd round. Face to face. DS and Algo
- uday4friendz in India for Product Details Page
Q1) Given an array 'A' of size 'n' and a number 'm' such that 'm <= n'. For all subsets of 'A' of size 'm', return the difference between the number of non-increasing and non-decreasing sub-sequences.
He asked me to write the program on paper in any language.
This is how i approached it.
1) First i gave the brute force solution and explained it to him. He liked it.
2) Then he asked for the complexity of the solution. I gave right ans.
3) Then i told him that it can be optimized by 'xyz' approach.
4) Then he asked me if i can write the solution. I said i will first explain him how it can be solved. Then if he wants me to write the code, he will have to leave me alone for some time. He agreed. I explained.
5) There was a bug in my solution. He gave a test case that exposed it. Then i rectified the bug. He accepted.
6) He said that it. He does not need the full code.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersThis was the first round. A written test. I was asked to write a complete program that can execute with proper syntax. Also comment on the complexity and add comments to code where necessary. And i had to write it on Paper. Three questions were given and was asked to answer any two. I was given 1hr time for this.
- uday4friendz in India for Product Details Page
This was one of the questions
Q) You are given a BST and a number k. Find the node in the tree which has the value closest to k.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Programming Skills - 0of 0 votes
AnswersThis was the first round. A written test. I was asked to write a complete program that can execute with proper syntax. Also comment on the complexity and add comments to code where necessary. And i had to write it on Paper. Three questions were given and was asked to answer any two. I was given 1hr time for this.
- uday4friendz in India for Product Details Page
This was one of the questions.
Q) You are given a linked list and two integer nums 'm' and 'n'. Retain 'm' elements and delete 'n' elements. Do this repeatedly till the end of the linked list.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Programming Skills