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

Wednesday, April 28, 2010

Car is traveling

A car is traveling at a uniform speed.The driver sees a milestone showing a 2-digit number. After traveling for an hour the driver sees another milestone with the same digits in reverse order.After another hour the driver sees another milestone containing the same two digits. What is the average speed of the driver?


45 kmph

Father's age

Father's age is three years more than three times the son's age.After three years, father's age will be ten years more than twice the son's age. What is the father's present age?

33 years.

General Questions

1- Why do you like to work with us?

2- What work are you expecting?

3- Tell me about any of your experience

Top command

What is the functionality of a top command?

Top command displays all the Linux tasks running at that particular time. It provides their running time and the resources used.

Array of size

Given an array of size n+1 which contains all the numbers from 1 to n. Find the number which is repeated in O(n) time. How do you proceed with the same with floating numbers from 0 to 1 instead of 1 to n?


The number appearing 2 times is (sum of all the numbers in the array) - (sum of the numbers from 1 to n). For floating numbers multiply it with 100 and proceed.

Two trains enter at the opposite

Two trains enter at the opposite sides of a tunnel of length L with speeds 'V'. A particle enters the tunnel at the same time with a speed 'v' and it vibrates in the tunnel[i.e. if it reaches the end of the tunnel then it comes back]. What is the position of the particle by the time the 2 trains meet?


If v<=2V then the position is (v*L)/(2*V) from the starting point else it is 2*L -(v*L)/(2*V) from the starting point.