# Amazon interview questions

Posted on :11-02-2016
Latest Amazon Interview Questions -1

Q1. Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array.

i) 3 2 7 10 should return 13 (sum of 3 and 10)
ii) 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

Q2. Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number.

Q3. What are the 4 basics of OOP?

Q4. Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You cant pass the value k to any function also.

Q5. How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

Q6. Define Data Abstraction. What is its importance?

Q7. You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount),
find the minimum number of coins required to get the exact amount. What is the method called?

Q8. Explain polymorphism citing an example

Q9. Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.

Q10. Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which are not present.

Latest Amazon Interview Questions -2

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

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

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

Q4. 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.

Q5. 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.

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

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

Q9. 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

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

FreshersLive - No.1 Job site in India. Here you can find latest 2021 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail...