Puzzle CornerSign In
HomeFeedbackBlogResourcesAbout
Starred
Add Question
All (696)
coding (266)
c++ (157)
algorithms (151)
puzzle (134)
CS Fundamentals (83)
oop (55)
arrays (45)
internet (40)
string (34)
math (31)
databases (28)
system (26)
probability (26)
networking (25)
linkedlist (24)
binarytrees (24)
tree (22)
bit manipulation (19)
sorting (11)
stack (10)
bst (9)
java (8)
xml (8)
sql (7)
next in series (7)
traversal (6)
graph (4)
debugging (4)
lateral thinking (4)
palindrome (4)
mysql (4)
prime (4)
general (4)
unix (3)
CGI (3)
duplication (3)
threading (3)
random (3)
search (3)
fibonacci (3)
encryption (3)
joins (3)
hash (3)
queue (3)
asm (3)
design patterns (2)

next »

Random
Explain "passing by value", "passing by pointer" and "passing by reference"[2007-02-26 23:42:21]   
Explain "passing by value", "passing by pointer" and "passing by reference". When will you use one over the other?
linkAuthor:premTags: c++Answer

Array duplication problem[2007-02-26 23:42:17]   
Given an array of length N containing integers between 1 and N,
determine if it contains any duplicates.
linkAuthor:premTags: arrays | duplication6 CommentsAnswer

Streaming problem[2007-02-26 23:42:18]   
Assume your computer is reading characters one by one from a stream (you
don't know the length of the stream before ending). Note that you have
only one character of storage space (so you cannot save the characters
you've read to a something like a strong). When you've finished reading
you should return a character out of the stream with equal probability.
linkAuthor:premTags: algorithms | coding | probability2 CommentsAnswer

monty hall problem[2007-02-26 23:42:18]   
you are presented with three doors (door 1, door 2, door 3). one door has a million dollars behind it. the other two have goats behind them. you do not know ahead of time what is behind any of the doors.

monty asks you to choose a door. you pick one of the doors and announce it. monty then counters by showing you one of the doors with a goat behind it and asks you if you would like to keep the door you chose, or switch to the other unknown door.

should you switch? if so, why? what is the probability if you don't switch? what is the probability if you do.

lots of people have heard this problem.. so just knowing what to do isn't sufficient. its the explanation that counts!
linkAuthor:premTags: probabilityAnswer

Jelly beans problem[2007-02-26 23:42:21]   
You have a bucket of jelly beans in three colors – red, green and blue. With your eyes closed, reach in the bucket and take out two jelly beans of the same color. How many jelly beans do you have to take to be certain of getting two of the same color?
linkAuthor:premTags: puzzle | probability1 CommentAnswer

Coffee can problem[2007-02-26 23:42:19]   
You are initially given a coffee can that contains some black beans and some white beans and a large pile of 'extra' black beans. You then repeat the following process until there is a single bean left in the can

"Randomly select two beans from the can.If they are the same color, throw them both out and insert an extra black bean. If they are different colors, return the white bean to the can and throw out the black."

Prove that the process terminates. What can you say about the color of the final remaining bean as a function of the number of black and white beans originally in the can.
linkAuthor:premTags: probability1 CommentAnswer

Cars On the Road[2007-02-26 23:42:18]   
if the probability of observing a car in 20 minutes on a highway is 609/625, what is the probability of observing a car in 5 minutes (assuming constant default probability)?
linkAuthor:premTags: probabilityAnswer

Lost in a forest[2007-02-26 23:42:18]   
You are lost in a forest, and you are traveling in this road, and come to a T intersection. YOu have a coin which is biased(meaning it does not have a 50-50 distribution of heads-tails, but some other arbitrary combination(could be 70-30) ). How do use this coin in deciding whether to take left or right, with 50% probability?
linkAuthor:premTags: probabilityAnswer

Barbarians[2007-02-26 23:42:22]   
You are travelling in the jungles of Africa, when you are caught by a
tribe of barbarians. They allow you to choose between death or solving
their great challenge. You know what you will choose ;)

You are blindfolded and taken to a room, where you are asked to kneel.
You feel hundreds of circular discs lying in front of you. You are told
that one side of each disc is painted red, and the other, green. There
are exactly 129 discs that currently are red side up. You have to
divide the discs into two groups, such that each group has the same
number of discs showing the red colour. Obviously, no peeking allowed.
linkAuthor:premTags: puzzle | probability5 CommentsAnswer

flipping coins[2007-02-26 23:42:18]   
someone walks into your room and dumps a huge bag of quarters all over the floor. they spread them out so no quarters are on top of any other quarters. a robot then comes into the room and is programmed such that if it sees a head, it flips it to tails. if it sees a tail, it throws it in the air. the robot moves around randomly forever. will there be a convergence in distribution of heads vs. tails?
linkAuthor:premTags: probability1 CommentAnswer

painfully easy[2007-02-26 23:42:18]   
I flip a penny and a dime and hide the result from you. "one of the coins came up heads", i announce. what is the chance that the other coin also came up heads?
linkAuthor:premTags: probability1 CommentAnswer

Wanna Play?[2007-02-26 23:42:20]   
I offer to play a card game with you using a normal deck of 52 cards. the rules of the game are that we will turn over two cards at a time. if the cards are both black, they go into my pile. if they are both red, they go into your pile. if there is one red and one black, they go into the discard pile. we repeat the two card flipping until we've gone through all 52 cards. whoever has more cards in their pile at the end wins. i win if there is a tie. if you win, i pay you a dollar. how much would you pay to play this game?
linkAuthor:premTags: puzzle | probabilityAnswer


next »




Created by Premchand Jayamohan