Monday, April 8, 2013
Given a root of a tree, and an integer k. Print all the nodes which are at k distance from given elment
Labels:Data
Amazon Interview
| Reactions: |
Tuesday, March 19, 2013
How would you design a logging system for something like Google , you should be able to query for the number of times a URL was opened within two time frames.
i/p : start_time , end_time , URL1
o/p : number of times URL1 was opened between start and end time.
Some specs : Database is not an optimal solution A URL might have been opened multiple times for given time stamp. A URL might have been opened a large number of times within two time stamps. start_time and end_time can be a month apart. time could be granular to a second.
Labels:Data
Google Interview
| Reactions: |
Thursday, March 14, 2013
Assume you daily prices of a stock 3 7 4 10 11 8 5 4 8 . You can only buy 1 share or sell 1 share a day, but you can only sell if you own the stock. You can't hold more than 1 share. write me an algo that finds me the strategy that has the highest pay off. Don't want the generate all possible strategies and compare.
Labels:Data
FaceBook Engineering Team
| Reactions: |
Tuesday, March 12, 2013
We're playing a game. Cards numbered from 1-10 are placed in a hat. whatever card is drawn is the paid out amount. how much should i charge you to play this game? If you can redraw by placing the first card back into the hat, what is the new price?
Labels:Data
FaceBook Engineering Team
| Reactions: |
Monday, March 4, 2013
You have N guards in a line each with a demand of coins.You can skip paying a guard only if his demand is lesser than what you have totally paid before reaching him.Find the least number of coins you spend to cross all guards
Labels:Data
Dynamic Programming
| Reactions: |
Monday, February 25, 2013
Implement LookAndSay function. For example, first, let user input a number, say 1. Then, the function will generate the next 10 numbers which satisfy this condition: 1, 11,21,1211,111221,312211... explanation: first number 1, second number is one 1, so 11. Third number is two 1(previous number), so 21. next number one 2 one 1, so 1211 and so on...
Source : Heard from Junior , EPIC visit to BIT Mesra
Labels:Data
EPIC System
| Reactions: |
'K' number of char arrays of different length are given, find Cartesian product of them in optimal way & give complexity.
Source : commented by user yen
Labels:Data
Facebook Interview
| Reactions: |
Given n, output the numbers from 0 to 2^n-1 (inclusive) in n-bit binary form, in such an order that adjacent numbers in the list differ by exactly 1 bit.
Source : Heard from Rahul, CSE, BITS ,2K10
Labels:Data
Facebook Interview,
Gray Code
| Reactions: |
Wednesday, January 23, 2013
Find the largest contiguous rectangle having all 1's in matrix of size m*n ; Matrix have only 0 and 1 .
Labels:Data
Google Interview
| Reactions: |
Monday, January 21, 2013
Find the sum of all the multiples of 3 or 5 below 1 billion.
Since i dont want to stop hacking , i decided to post simple problem to start off the new year , Happy hacking , give its try !!!
PS: 1 billion is big no. its equal to no. of user facebook have ;)
Labels:Data
1st Post of 2013
| Reactions: |
Subscribe to:
Posts (Atom)






