Amazon Interview Questions
- 1of 1 vote
AnswersFind if a binary tree is bst
- anonym October 10, 2011 in -| Report Duplicate | Flag | PURGE
Amazon Flipkart Groupon Software Engineer / Developer Trees and Graphs - 0of 0 votes
AnswersHere is a tree. It's a binary tree but in no particular order. How do you write this tree to a file so that it can be reread in an reconstructed exactly as shown?
- Kartik February 24, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding Algorithm - 0of 2 votes
AnswersUse SIMPLE LOGIC for Converting this string str="aaabbccc" into str="3a2b3c".
- Anonymous September 23, 2013 in United States
###Note:###
I gave 3 diff solutions to interviewer with loops,conditions etc.,But he wanted a real OPTIMAL SOLUTION..lets see who ll write!!!!!| Report Duplicate | Flag | PURGE
Amazon Developer Program Engineer - 3of 5 votes
AnswersGiven two singly linked list, find if they are intersecting. Do this in single iteration. Also find the intersecting node in O(n) time and O(1) space. By intersection I mean intersection by reference not by value
- dm December 05, 2012 in India| Report Duplicate | Flag | PURGE
Amazon Microsoft Software Engineer / Developer Linked Lists - 0of 2 votes
AnswersThere are 2 arrays of integers.You have to add the those integers and keep it in 3rd array.there is one condition, if the sum is a 2 digit number, split that number into single digiit and other condition is if any of the array integer is left then print that number
- Ajay April 05, 2016 in India for amazon.in
I/P:
int[] a = {1,2,3,4,5,6}
int[] b = {2,3,4,5,6,7,8}
o/p:
{3,5,7,9,1,1,1,3,8}| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Arrays - 4of 4 votes
AnswersYou are given a large set of integers, which are not sorted. Figure out a method to retrieve the largest 1000 elements, in O(n) run time
- varunumesh77 March 12, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm Data Structures - 1of 1 vote
AnswersThere is a given linked list where each node can consist of any number of characters :- For example
- vibsy October 25, 2012 in India
a-->bcd-->ef-->g-->f-->ed-->c-->ba.
Now please write a function where the linked list will return true if it is a palindrome .
Like in above example the linked list should return true| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Software Engineer in Test Data Structures - 0of 0 votes
AnswersWrite function compress(char* strSource)
- Interviews January 29, 2012 in India
it should do the following .
repeating chars in sequence should be replaced with char & count, in case count is 1 no need to add any integer.
Example - AAAABBBCXYZEEEEPPPPPKKABC
should be A4B3CXYZE4P5K2ABC.
you are supposed to iterate the array only once, and modify the same input parameter, do not create any new string.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 1of 1 vote
AnswersGiven a number in an array form, Come up with an algorithm to push all the zeros to the end.
- kiranpm86 February 24, 2014 in India
Expectation : O(n) solution| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Algorithm Arrays C++ Coding - 0of 0 votes
AnswersGiven an array of N integers with +ve & -ve numbers. Find the maxproduct of 3 numbers ? & Test Cases
- ariesgirl069 February 28, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Algorithm - 4of 4 votes
AnswersGiven a array of size n. Divide the array in to two arrays of size n/2,n/2. such that average of two arrays is equal.
- gowthamganguri August 29, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Arrays - 0of 0 votes
AnswersWrite a program which returns true if the given string contains the consecutive repeated substring .Ex-adabcabcd
- kehkelunga August 19, 2012 in United States
here abc is consecutive repeated substring.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 3of 3 votes
AnswersConsider an array of integers wherein each element is +1 or -1 its preceding element. Given a number, find the first occurence of this number (index) in this array without using linear search.
- nilukush June 04, 2013 in India for World Wide Operations
For example, consider the array :
4 5 6 5 6 7 8 9 10 9 10 (each element in this array is +1 or -1 its preceding element)
Input : 10 (find first occurence of 10 without using linear search)
Output : 8| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm Arrays - 0of 0 votes
AnswersIf an array is having integers/Char/special Char... Ex: "PST456DA85M2A!!23++46", find out the sum of integers. ****Note: If we find consecutive digits in array we need to treat it as number, let say 456, we need to treat it as [ four hundread and fifty six]. Write a program to get the output by summing 456+85+2+23+46..also this needs to be done in lessnumber of iterations..
- Unknown August 29, 2012 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Arrays - 1of 1 vote
AnswersGiven a dictionary of strings [ strings are in sorted order] you have to find the precedence of characters according to the dictionary..
- Anton April 21, 2012 in India
eat
bxy
e is ranked above b according to the dictionary.| Report Duplicate | Flag | PURGE
Google Amazon Software Engineer / Developer Algorithm Data Structures Trees and Graphs Brain Teasers - 0of 0 votes
AnswersYou are given an array, you have to replace each element of the array with product of the rest element. Example: {1,2,3}==> {6,3,2}
- neelabhsingh February 20, 2015 in India for Hyderabad| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 2of 2 votes
AnswersHow to find in a binary tree, whether all leaves are at same level or not, and return a boolean value after identifying this.
- seth June 04, 2013 in India| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - 9of 9 votes
AnswersGiven an array of integers, find all combination of four elements in the array whose sum is equal to a given value X.
- sai September 04, 2012 in India
For example, if the given array is {10, 2, 3, 4, 5, 9, 7, 8} and X = 23, then your function should print “3 5 7 8″ (3 + 5 + 7 + 8 = 23).| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a number,find the next higher number using the same digits in the number. Eg- 15432, Soln- 21345.
- Puzzle November 19, 2011 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWrite a method that takes in a positive integer, return the number of 2s between 0 and the input number.
- J@sper November 26, 2015 in United States
If the input value given is 13, it should return 2 as the number 2 and 12 are between 0 and 13.
If the input value given is 21, it should return 3 as the number 2,12 and 20 are between 0 and 21.| Report Duplicate | Flag | PURGE
Amazon Jr. Software Engineer Java - 2of 2 votes
AnswersWrite program for the following case
- APV July 25, 2015 in India for Amazon Wireless
Reverse string (string is stored in an array)
Input:- "This is an example"
Output:-sihT si na elpmaxe| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer String Manipulation - 0of 2 votes
Answers###Print numbers between 45 to 4578 without repeating digits.###
- Anonymous September 24, 2013 in India
Ex: 45-ALLOWED;55(repeatng digits)(-NOT ALLOWED. Frnd tld ths 2 me.he tried diff concepts but interviewer wanted an OPTIMAL ONE..LETS C WHO WRITE THIS WITH SIMPLE LOGIC..| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test - 0of 0 votes
AnswersAn operation "swap" means removing an element from the array and appending it at the back of the same array. Find the minimum number of "swaps" needed to sort that array.
- Anirban October 27, 2012 in India
Eg :- 3124
Output: 2 (3124->1243->1234)
How to do it less than O(n^2) ?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersFind the longest
- grave August 05, 2012 in India
subarray which consists of numbers that can be arranged in a continuous sequence.
For ex- {4,5,1,5,7,6,8,4,1}
output-{5,7,6,8,4}.Find the longest.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Coding - 0of 0 votes
AnswersYou have three baskets. Basket # has apples,Basket # 2 has oranges, and Basket #3 has oranges and apples.
- Junior Ranking July 10, 2007
THe baskets are mislabled.After how many tries will you be able to figure out which baskets have the correct items.| Report Duplicate | Flag | PURGE
Amazon Kalido Software Engineer / Developer Brain Teasers - 2of 2 votes
AnswersWrite a method that multiplies two integers without using multiply operator
- S.Abakumoff February 25, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm