Source : Heard from Junior , EPIC visit to BIT Mesra
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...
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
Monday, December 24, 2012
Count maximum number of "connected 1" in given matrix
you have a matrix of N x N filled with 1 or 0. you can move only 1 step either right or 1 step down. you need to count maximum number of "connected 1" in given matrix. for example
0 0 1 1
1 1 1 0
1 0 1 0
0 1 0 1
[Start from top left] maximum no. of 1 is 4
[1,0][1,1][1,2][2,2]
Source -: Commented by a user "rakesh"
0 0 1 1
1 1 1 0
1 0 1 0
0 1 0 1
[Start from top left] maximum no. of 1 is 4
[1,0][1,1][1,2][2,2]
Source -: Commented by a user "rakesh"
Labels:Data
Amazon Interview
Thursday, December 20, 2012
Find the minimal required number of white balls to achieve below criteria
You are given C containers, B black balls and an unlimited number of white balls. You want to distribute balls between the containers in a way that every container contains at least one ball and the probability of selecting a white ball is greater or equal to P percent. The selection is done by randomly picking a container followed by randomly picking a ball from it.
Labels:Data
Google Interview
Find the color of the k-th ball (1-index based) that will be destroyed.
Bob is playing with his ball destroyer robot. Initially, Bob has r
red balls, g green balls and b blue balls. The robot
will repeat the following 3-step program until there are no balls
left:
Source : Commented by a user named bob , later i found property of TopCoder , so i have am just sharing it to learning purpose , TopCoder Inc. holds all right on the problem statement .
|
Labels:Data
Interview Question
Monday, December 3, 2012
Given an NxN matrix with unique integers : Find and print positions of all numbers such that it is the biggest in its row and also the smallest in its collumn .
Example
1 2 3
4 5 6
7 8 9
#A reader posted as comment .
Labels:Data
EPIC System
Determine whether a number is colorful or not. 263 is a colorful number because (2,6,3,2x6,6x3,2x3x6) are all different whereas 236 is not because (2,3,6,2x3,3x6,2x3x6) have 6 twice. So take all consecutive subsets of digits, take their product and ensure all the products are different
#A reader posted in Comment
Labels:Data
EPIC System
Subscribe to:
Posts
(
Atom
)