Amazon Interview Experience | Set 200

Aptitude Round: (1:30 hours)
19 MCQs
Easy MCQs on trees, semaphores, deadlocks and algorithms. Few output questions on pointers.

2 Coding questions:

  • Check if two strings are anagram.
  • There are n employees in a company, each having some ratings. The employees are given a hike in their salary based on their ratings, i.e employee with higher rating will get the higher raise. An employee can only know the hike and rating of two of his neighbors, one on the left and other on the right. Given an array of size n, specifying the ratings of n employees, find the minimum hike that should be raised for each employee, such that no employee feels unfair.
    Example: 1 3 5 4 (ratings for 4 employees)
    Output: 1+2+3+2 = 7
    Example: 5 3 4 2 1 6
    Output: 2+1+3+2+1+2 = 11.
    The hikes are positive integers only. The ratings are greater than zero.
    Size of input array: 1-1000000

Round 1:

Round 2:

Round 3:

  • Reverse a stack using only recursion.
  • Create a data structure that maintains a record for all the courses and students enrolled for that course. Each course has course id, and student is uniquely identified by its enrolment no. The data structure should provide following operations:
    • Insert of a new student for a particular course.
    • Deletion of a student for a particular course.
    • Given a (courseid, enrolment no), search if this pair exists or not.
    • At any time you should be able to give the last enrolled student for a particular course.
  • All of the above operations should be executed in O(1).

  • Given a tree, print left most and right most node of each level.
    Output: 1 2 3 4 5 8
  • Given a table that has amount has its column and an integer n, write a query that give nth largest amount value in the table.
  • What are the differences between child processes and threads? Explain virtual memory, paging concept, page replacement algorithms. Design a data structure for working set algorithm.

Round 4:

  • Questions on my internship and projects.
  • Then the interviewer started asking questions on computer networks about framing and all. After asking 3-4 questions on CN, he then switched back to DS.
  • Given a binary tree, find whether it is Binary search tree or not, without using any external dynamic memory for array. Write code for this.
  • And then at last the aura got filled with all the never heard questions on OS and Computer Organization.

Important tips:

  • Have a loud thinking, the interviewer helps you if you get struck.
  • Don’t do silly mistakes while writing code, take your time but have a neat, optimized code.

  • If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

    Write your Interview Experience or mail it to

    My Personal Notes arrow_drop_up
    Article Tags :
    Practice Tags :


    Please write to us at to report any issue with the above content.