Monday, April 8, 2013
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
Thursday, March 14, 2013
Assume your daily prices of a stock are 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 an algo that finds the strategy that has the highest pay off. Don't generate the all possible strategies and compare.
Labels:Data
FaceBook Engineering Team
Tuesday, March 12, 2013
Monday, March 4, 2013
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
'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
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
Wednesday, January 23, 2013
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
Subscribe to:
Posts
(
Atom
)