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
Given an array of strings ... find the string which is composed of other strings in the array and is of maximum size. Ex: ["satcatratbat" , "rat", "bat", "cat", "sat", "ratbat", "ratsatcat"]. Output: "satcatratbat"
Source: http://www.quora.com/Shashank-Mani-Narayan/Cracking-The-Code/String-matching-porblem
Labels:Data
DirectI Interview
Saturday, November 3, 2012
Given two set , 1st one is of 1 to n numbers where n is very very large say this set T and other set is very small contains only number {3,5,7} , Now generate all number from set T (bigger) except element in smaller set , with "equal probability" , you have given rand function , also minimize the call to rand function so solve it in most optimal way
Labels:Data
Google Interview
Sunday, October 28, 2012
Subscribe to:
Posts
(
Atom
)