Cracking the Coding Interview: Fourth Edition (308 page e-book / PDF)
Delivered instantly as a PDF via email. For Software Engineers & SDETs
  • 150 programming interview questions and answers
  • 5 proven approaches to crack algorithm questions
  • 10 mistakes candidates make, and how to avoid them.
  • How to prepare for technical and behavioral questions without wasting your time!
"The BEST book for acing your interview. It helped me land my Microsoft job, and it was worth every penny!" - Ravi (Accepted at Microsoft, Amazon and Facebook) 30 Day Money Back Guarantee: Don't love the book? We'll give you your money back! More Info

Saturday, April 24, 2010

Type: Public
On the web:
Employees: 24,300
Employee growth: 17.4%

What started as Earth's biggest bookstore has rapidly become Earth's biggest anything store. Expansion has propelled in innumerable directions. Its main Web site offers millions of books, music, and movies (which still account for most of its sales), not to mention auto parts, toys, electronics, home furnishings, apparel, health and beauty aids, prescription drugs, and groceries. Also, shoppers can download books, games, MP3s, and films to their computers or handheld devices, including Amazon's own portable reader, the Kindle. Amazon also offers services and products, such as self-publishing, online advertising, a Web store platform, and a co-branded credit card. Amazon acquired in 2009.

Key numbers for fiscal year ending December, 2009:
Sales: $24,509.0M
One year growth: 27.9%
Net income: $902.0M
Income growth: 39.8%

Chairman, President, and CEO: Jeffrey P. (Jeff) Bezos
SVP and CFO: Thomas J. (Tom) Szkutak
Senior Manager Business Development: Scott Merlino

Missing number

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.

Denominations of coins

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?

Maximum sum

Given an array all of whose elements are positive numbers, find the maximum sum of a subsequent elements with the constraint that no 2 numbers in the sequence should be adjacent in the array. So, 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)


Explain polymorphism. Provide an example.

Convert a decimal number

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

Array of size n

Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.

Second largest elemen

Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

N red balls

Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that.

Write a function which

Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

Merge Sort

What is the time and space complexities of merge sort and when is it preferred over quick sort?
What is a C array and illustrate how it is different from a list.
Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.
You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)
Given a string, find the first unrepeated character in it? Give some test cases.
Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which aren’t present.
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.
Define Data Abstraction. What is its importance?
What are the 4 basics of OOP?