Latest Amazon Interview Questions -3

1. How would you find the second largest element in an array using minimum no of comparisons?

2. Write a C program for level order traversal of a tree?

3. You are given: 3 types of vehicles: Motorbike, Car, and a special type of car for the handicapped.
3 types of parking: Motorbike parking, Car parking, handicapped car parking.

Motorbikes and cars can only park in their designated parkings, while the handicapped cars can park either in their own parking or the regular car parking.
How would you model this as classes? Explain your methods.

4. Given 2 tables: Employee(Employee_Name,Dept_No) Department(Dept_No, Dept_Name)

Write an SQL query which outputs all the employees, and their department nos and names, including all those departments which have no employees working for them.

6. Explain about Inodes?

7.Give a Linux shell command to find all files in a directory which contain ip addresses.

8. Given a table Employee which has columns name and salary, write an SQL query to find the employee with the second highest salary.

9. Given a table of Player which contains Sno and player name, write a query which finds all possible Table Tennis doubles pairings.

10.Given a string A, and a string B, and a dictionary, how would you convert A to B in the minimum no of operations, given that:

i) All the intermediate words must be from the dictionary

ii) An ‘operation’ is defined as:

a) Delete any character from a string ex dog → do

b) Insert any character into a string ex cat → cart

c) Replace any character in the string with another ex cat → cot


  1. I recently attended an Amazon written exam. Sharing some of the Q's with you. Q's are little skewed

    if(fork()) if(!fork()) if(fork())
    no. of times processes are created

    Program to check if a binary tree is a BST

    Given a linked list w/o using extra list seperate even list from odd list

    An SQL query
    Q on system call. pick the incorrect option
    A question on identifying the grammar (even no. of a's, odd no. of b's)
    2 Q's on Graph theory
    C program output
    Given a program snippet we had to find what's the nature. whether its ht. of tree, depth/count nodes

    mostly revolved around unix,data structures, sql and C

  2. wr do i get d answers :(