Thursday, December 11, 2014

Amazon Question telephonic


  1. Consider a snake and Ladder game with N squares and a dice with 6 faces. Given the positions of all ladders, calculate the number of ways to reach from square 1 to square N. Also, calculate the complexity providing the necessary equations. 
  2. Suppose there a trillions of stars, and distance of each star from earth is given, output the closest million stars from earth. 
  3. LRU cache 
  4. Wage optimization problem: Given the wages of N days. Need to maximize the total wage for N days, with the condition that, if you are working on ith day, then you cannot work for next k days.