• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

I was asked this analytical question in interview (NO GOOGLING)

Status
Not open for further replies.
You can do this for a larger set of balls as long as you increase the amount of scale usages.

Look ma. No hands.

the real question here is how is does the number of scale usages relate to the number of balls?
what is the precise mathematical relation and why?

This isn't too hard - it's identifying that you essentially have a 'third' scale by knowing that anything you don't weigh is still information.


One of the harder versions of this was explained to me in a similar manner, whereby there are actually TWELVE balls (or pennies as it was told to me), and you don't even know if the odd one is lighter OR heavier, but you get three weighs.

This one is particularly tough, but I'm pretty sure it can be done.

are you certain it can be done?
because it seems to me you can calculate the amount of information needed to be certain, and three weighs don't give you that information based on your conditions.

Mirror all of your opponent's moves across the center of the board. Requires you take the first turn and that your first piece is in the center.

bravo sir! did you figure it out yourself?

I got this question at a job interview and really loved it. My line of thinking was basically this:

1) wow there's not a lot of information to base a universal solution on...

2) AHA! that in itself is valuable information! it means there's a universal solution that doesn't require anything else to be predetermined.

3) in other words it's something that works no matter what the other player does.

4) Mirroring would be one way to do that, as well as some others...

--this is where I ran out of time, and the rest was figured out with some guidance by the interviewer, since he saw I was on the right track, so unfortunately I can't claim figuring out the full solution on my own..

5) but this would only be a viable strategy if only one side could benefit from it, so there has to be a critical point where only one player benefits.

6) there is exactly one place on the board that does not have a mirror! occupy that and you've won. Hence you must be first.
 
The man at the top of the stairs guesses that he has the same colour of his hat as the man on the step below, whose hat he can clearly see. Because they have agreed to this earlier, the man below now knows what colour he has.

Going down the stairs, every man is now given ten seconds to either say the colour of the hat on the step below, if this is the same colour as he has been told he has, or say nothing. The man below assumes that he has a hat of the other colour if he has not been told anything after the ten seconds.

When this reaches the bottom man, everyone except the top guy, nine out of ten, should know the colour of their hat. The top guy can never know his hat because the rules state that he cannot see the colour of his own hat and there is no one above him. Therefore this should be optimal.
 
You know I seriously think I'm going to add "I just asked you a ridiculous question in our interview. How do you react?" that might yield interesting results.

Which brings to mind that I was talking to a friend in an executive recruitment firm and she says she often uses the "empathic yawn" trick to test if people are empathetic or not. Anyone ever use that?

I learned that one from Luther.
 
LOL the hardest part was finding out the scale was a balance scale. (Really should have put the picture in the OP since most of use have probably never used one before)

Separate balls into 3 sets of 3.

3A-3B-3C

Weight 3A and 3B. Take the lighter one. If weight is equal take 3c.

Separate balls into 3 sets of 1.

1A-1B-1C

Weight 1A and 1B. Take the lighter one. If weight is equal take 1C.
 
This is a question I used to ask (and will not any more since I am posting it here now). This is the type of the question for which that I am not interested in correct answer, rather the candidate's thought process.

10 men are standing on 10 steps of a staircase. Each person has a hat which could be either blue or red. Nobody knows the color of the hat they are wearing. Each man can see the men and the hat they are wearing on steps below him but not those on the steps above him. Starting with the man at the top and going downward, each man has to guess the color of hat they are wearing (and nothing else) and say it out loud. Everybody can hear what others are saying. What strategy these 10 men could come up with in order to maximize the number of correct answers?

This seems like an odd question because the permitted communication seems to be too limited in contrast with the request. Also, is the guessing process repeated only once? How would they communicate the strategy? Can they move throughout? Lots of open-ended questions.

Assuming they stay where they are, a simple answer would be to have each of the men shout their guess in either a higher or lowered toned voice, with them agreeing upon which tone would equal to what color ahead of time. The first guesser would essentially make a wild guess but clue the next person onto what color their hat is. You basically ensure 9 correct guesses.
 
This is a question I used to ask (and will not any more since I am posting it here now). This is the type of the question for which that I am not interested in correct answer, rather the candidate's thought process.

10 men are standing on 10 steps of a staircase. Each person has a hat which could be either blue or red. Nobody knows the color of the hat they are wearing. Each man can see the men and the hat they are wearing on steps below him but not those on the steps above him. Starting with the man at the top and going downward, each man has to guess the color of hat they are wearing (and nothing else) and say it out loud. Everybody can hear what others are saying. What strategy these 10 men could come up with in order to maximize the number of correct answers?

Nvm didn't think that through at all.
 
Sorry I should be more clear

I meant this

stock-photo-simple-balance-45809926.jpg
Ohhhhhh

That's quite easy then, imo.

Are You Smart Enough to Work at Google? has some awesome riddles.
 
bravo sir! did you figure it out yourself?

My reasoning went like this:

1) The size of the board is unspecified. It is possible that the board only has enough room for one piece. Ergo, you must be first for your strategy to win every conceivable game.

2) For any given hexagon tessellation that forms a greater hexagon, the total number of hexagons is odd, because of the single hexagon in the center.

3) Once you occupy the center as your first move, the only thing you need to do to win the war of attrition is to mirror your opponent's moves.

(My reasoning wasn't nearly as elegant as that, it was just hunches and some scribbles on paper before I intuited the answer)
 
"I'd ask the business which ball they want because in the end no matter which ball weighs what they get to pick the ball they want. They will probably also pick the wrong ball two or three times, I'll help them get back on course and receive no credit. Does it sound like I'm ready to be the analyst that helps you get promoted so you don't have to interview people anymore?"
 
When I'm interviewing someone I'm personally more interested in the candidate's thought process than the answer. If they can walk me through the thought process and explain why they're thinking how they're thinking, that wins a lot of points even if they're wrong.

I had a coder in a few weeks ago for an interview and I asked him what the Big O complexity was for inserting or searching in a binary search tree. He would just guess and couldn't even explain why he came up with his answer. Tons of points docked there.

Even if their logic is flawed, if they can talk you through their logic it's a positive sign.

I am not even a computer scientist and I know this. Searching should always be on the order of log n assuming a well balanced tree but in a poorly balanced tree it approaches linear. inserting is the same. right?
 
Ah!

You split the balls up into three groups of 3, then put one group on each side of the scale. If they weigh the same, then you know the lighter ball is in the third group (the one not on the scale). If one of those two groups on the scale is lighter, then you know the lighter ball is in that group.

Now you have a group of three balls, of which you know one of them is the lightest. So simply weigh one ball on each side of the scale now for your second use of the scale. If one of them is lighter, you'll know. And if they weight the same, then you know the lighter one is the one not on the scale.
 
Guys the original question has been answered 50 times over, WE HAVE NEW QUESTIONS NOW.

But I was told not to Google it, so I also didn't look in the thread for the solution.

I think I've done the problem in the OP before, though, so it came back to me pretty easily.
 
It's not pertinent.

To what? Why didn't you just post "lol no". Has the same amount of substance.

It actually is pertinent as it gives you a good idea of how people react to a problem that can be solved with simple logic. You also learn how they deal with that under pressure and how well they can communicate a solution to others.

A lot of people may think it's unfair or stupid, but if your job entails lots of troubleshooting or problem solving then it's extremely relevant for them to ask you a logic question. Situation questions like "Tell me about a time when..." aren't worth anything as you can easily bullshit your way through those.
 
Ok here is another game related question/riddle.

The game is played sequentially by two players, lets call them player A and player B. At each round player A picks a number between 1 and 10, and then player B picks a number between 1 and 10 after observing the number picked by player A. These two numbers are then added together, before the second round commences. Player A now picks a number between 1 and 10, and then that number is added to the sum of the previous two numbers. Afterwards, player B picks a number between 1 and 10, and then that number is added to the sum of the previous three numbers. The game then continues in a similar fashion. The objective of the game is to reach the number 50. Therefore, each player wants to be the last one to add a number between 1 and 10 which ensures that the sum of all the numbers equals 50.

So if A first picks 9 and B 10, the sum stands at 19 at the beginning of the second round. And if A then picks 4, the sum stands at 23 before B has to pick a number.

The big challenge is:
Come up with a strategy/plan for player A which ensures that A wins, regardless of any combination of numbers picked by player B.

Edit: Just wanted to say that there exists an unique solution to the problem.
 
Pretty easy: Three batches of three balls. Use the scales, one batch on either side. If even then the lighter ball is in the batch you kept aside. Otherwise you have the batch with the lighter. Repeat using the three balls to find the lighter one.

EDIT: Didn't google or read the thread. Maybe the thread OP should be updated??
 
This is a question I used to ask (and will not any more since I am posting it here now). This is the type of the question for which that I am not interested in correct answer, rather the candidate's thought process.

10 men are standing on 10 steps of a staircase. Each person has a hat which could be either blue or red. Nobody knows the color of the hat they are wearing. Each man can see the men and the hat they are wearing on steps below him but not those on the steps above him. Starting with the man at the top and going downward, each man has to guess the color of hat they are wearing (and nothing else) and say it out loud. Everybody can hear what others are saying. What strategy these 10 men could come up with in order to maximize the number of correct answers?

I've gotten this question before and it's one of my favorites. The answer is 9 correct answers. Here's how:

The person at the top says the color with an odd number. Since he sees 9 hats, there will either be an odd number of red hats or an odd number of blue hats. Let's say the order is RRRBBBBBBB. He will see 2 red hats and 7 blue hats and guess "Blue!" Then the second person will see 1 red hat and 7 blue hats and know that his own hat is red, since he knows the first person saw an odd number of blue hats. He will correctly guess "Red!" The third person will see 7 blue hats and know his own is red because he still sees an odd number of blue hats, meaning his own isn't blue. The fourth person will see 6 blue hats and correctly guess blue since now he sees an even number of blue hats. So on and so forth.
 
My reasoning went like this:

1) The size of the board is unspecified. It is possible that the board only has enough room for one piece. Ergo, you must be first for your strategy to win every conceivable game.

2) For any given hexagon tessellation that forms a greater hexagon, the total number of hexagons is odd, because of the single hexagon in the center.

3) Once you occupy the center as your first move, the only thing you need to do to win the war of attrition is to mirror your opponent's moves.

(My reasoning wasn't nearly as elegant as that, it was just hunches and some scribbles on paper before I intuited the answer)

interesting thought process!

I started the other way around, and didn't really have a good reason to stick with mirroring besides the fact that I liked it. Only when I realised the importance of the center did my guess justify itself.

In your case I'm not sure why you chose to tile the board, though. It seems, similarly to my line of thinking, to be a helpful step, but not necessarily for the right reasons, because there is no way to know if the number of spaces on the board is even or odd..

The point of the board having no partitions is exactly so you could screw your opponent over by placing a single piece right in the middle of an area that could accommodate two pieces, thus denying him the chance to make that move. (kind of like people who suck at parking ;)
 
In my interview they specified you had to use it, so that's why I say that.

Ooh oke i only read the op.

He said 9 balls a scale and you can use the scale twice.
Not something about you are forced to use it twice.

So my mind first went to split things up divide and conquer style.
The 3-3-3 didn't crossed my mind yet. Can't tell if it would in a real interview.
 
the real question here is how is does the number of scale usages relate to the number of balls?
what is the precise mathematical relation and why?



are you certain it can be done?
because it seems to me you can calculate the amount of information needed to be certain, and three weighs don't give you that information based on your conditions.



bravo sir! did you figure it out yourself?

I got this question at a job interview and really loved it. My line of thinking was basically this:

1) wow there's not a lot of information to base a universal solution on...

2) AHA! that in itself is valuable information! it means there's a universal solution that doesn't require anything else to be predetermined.

3) in other words it's something that works no matter what the other player does.

4) Mirroring would be one way to do that, as well as some others...

--this is where I ran out of time, and the rest was figured out with some guidance by the interviewer, since he saw I was on the right track, so unfortunately I can't claim figuring out the full solution on my own..

5) but this would only be a viable strategy if only one side could benefit from it, so there has to be a critical point where only one player benefits.

6) there is exactly one place on the board that does not have a mirror! occupy that and you've one. Hence you must be first.

http://www.mathsisfun.com/pool_balls_solution.html

here's a purported solution to the 12 balls, 3 weighs problem (not specified lighter or heavier)

still trying to get my head around it in its entirety but it seems logical.
 
Ok here is another game related question/riddle.

The game is played sequentially by two players, lets call them player A and player B. At each round player A picks a number between 1 and 10, and then player B picks a number between 1 and 10 after observing the number picked by player A. These two numbers are then added together, before the second round commences. Player A now picks a number between 1 and 10, and then that number is added to the sum of the previous two numbers. Afterwards, player B picks a number between 1 and 10, and then that number is added to the sum of the previous three numbers. The game then continues in a similar fashion. The objective of the game is to reach the number 50. Therefore, each player wants to be the last one to add a number between 1 and 10 which ensures that the sum of all the numbers equals 50.

So if A first picks 9 and B 10, the sum stands at 19 at the beginning of the second round. And if A then picks 4, the sum stands at 23 before B has to pick a number.

The big challenge is:
Come up with a strategy/plan for player A which ensures that A wins, regardless of any combination of numbers picked by player B.

Edit: Just wanted to say that there exists an unique solution to the problem.

Player A can always win if he starts with #6.

6 - 17 - 28 - 39 - 50
 
Ok here is another game related question/riddle.

The game is played sequentially by two players, lets call them player A and player B. At each round player A picks a number between 1 and 10, and then player B picks a number between 1 and 10 after observing the number picked by player A. These two numbers are then added together, before the second round commences. Player A now picks a number between 1 and 10, and then that number is added to the sum of the previous two numbers. Afterwards, player B picks a number between 1 and 10, and then that number is added to the sum of the previous three numbers. The game then continues in a similar fashion. The objective of the game is to reach the number 50. Therefore, each player wants to be the last one to add a number between 1 and 10 which ensures that the sum of all the numbers equals 50.

So if A first picks 9 and B 10, the sum stands at 19 at the beginning of the second round. And if A then picks 4, the sum stands at 23 before B has to pick a number.

The big challenge is:
Come up with a strategy/plan for player A which ensures that A wins, regardless of any combination of numbers picked by player B.

This gets more interesting when you forbid the selection of some of the numbers between 1 and 10.
 
Ok here is another game related question/riddle.

The game is played sequentially by two players, lets call them player A and player B. At each round player A picks a number between 1 and 10, and then player B picks a number between 1 and 10 after observing the number picked by player A. These two numbers are then added together, before the second round commences. Player A now picks a number between 1 and 10, and then that number is added to the sum of the previous two numbers. Afterwards, player B picks a number between 1 and 10, and then that number is added to the sum of the previous three numbers. The game then continues in a similar fashion. The objective of the game is to reach the number 50. Therefore, each player wants to be the last one to add a number between 1 and 10 which ensures that the sum of all the numbers equals 50.

So if A first picks 9 and B 10, the sum stands at 19 at the beginning of the second round. And if A then picks 4, the sum stands at 23 before B has to pick a number.

The big challenge is:
Come up with a strategy/plan for player A which ensures that A wins, regardless of any combination of numbers picked by player B.

Edit: Just wanted to say that there exists an unique solution to the problem.

Nifty!

The way to win is to land on 39, because then whatever your opponent says, you can land on 50 the next round. Which means the way to win is to land on 28, because etc etc. Back another step to 17, and another step to 6. Pick 6 to start, and then just make sure your next answer sums to 11 with whatever your opponent just said.
 
Player A can always win if he starts with #6.

6 - 17 - 28 - 39 - 50

Nifty!

The way to win is to land on 39, because then whatever your opponent says, you can land on 50 the next round. Which means the way to win is to land on 28, because etc etc. Back another step to 17, and another step to 6. Pick 6 to start, and then just make sure your next answer sums to 11 with whatever your opponent just said.

Damn, that is cool.
 
Ok here is another game related question/riddle.

The game is played sequentially by two players, lets call them player A and player B. At each round player A picks a number between 1 and 10, and then player B picks a number between 1 and 10 after observing the number picked by player A. These two numbers are then added together, before the second round commences. Player A now picks a number between 1 and 10, and then that number is added to the sum of the previous two numbers. Afterwards, player B picks a number between 1 and 10, and then that number is added to the sum of the previous three numbers. The game then continues in a similar fashion. The objective of the game is to reach the number 50. Therefore, each player wants to be the last one to add a number between 1 and 10 which ensures that the sum of all the numbers equals 50.

So if A first picks 9 and B 10, the sum stands at 19 at the beginning of the second round. And if A then picks 4, the sum stands at 23 before B has to pick a number.

The big challenge is:
Come up with a strategy/plan for player A which ensures that A wins, regardless of any combination of numbers picked by player B.

If the total is 40 or more when a player begins their turn, obviously they win by choosing a number that will add to 50. Therefore you lose by choosing a number that will increase the total to 40 or more. Therefore you can win by forcing the enemy to choose a number that will increase the total to 40 or more. You can do this by setting the total to 39 at the end of your turn.

Therefore if the total is 29 or more when a player begins their turn, they will win by setting the total to 39, which means you can win by setting the total to 28.

Therefore if the total is 18 or more before your turn, you win by setting the total to 28, which means you can win by setting the total to 17.

Therefore if the total is 7 or more before your turn, you win by setting the total to 17, which means you can win by setting the total to 6.

Therefore A wins by setting the total to 6, then 17, then 28, then 39, then 50.

edit: I'M SO SLOOOOOOOOW
 
http://www.mathsisfun.com/pool_balls_solution.html

here's a purported solution to the 12 balls, 3 weighs problem (not specified lighter or heavier)

still trying to get my head around it in its entirety but it seems logical.

was just realizing this method could work, didn't write it down yet but your link proves it indeed does :)

the trick here is eliminating the uncertainty about the ball being heavy/light by using the ones you already know aren't.

it's a cool trick!
 
I've gotten this question before and it's one of my favorites. The answer is 9 correct answers. Here's how:

The person at the top says the color with an odd number. Since he sees 9 hats, there will either be an odd number of red hats or an odd number of blue hats. Let's say the order is RRRBBBBBBB. He will see 2 red hats and 7 blue hats and guess "Blue!" Then the second person will see 1 red hat and 7 blue hats and know that his own hat is red, since he knows the first person saw an odd number of blue hats. He will correctly guess "Red!" The third person will see 7 blue hats and know his own is red because he still sees an odd number of blue hats, meaning his own isn't blue. The fourth person will see 6 blue hats and correctly guess blue since now he sees an even number of blue hats. So on and so forth.

And what if it's BBBBBBBBBB or RRRRRRRRRR?

First guy would say B or R because of odd, second guy would get it right, third guy see's odd and says opposite color, with every other guy also guessing opposite color, no?
 
Is this a digital scale or a balanced scale? If the latter, weigh two sets of 4 the first time.

If they are equal, the 9th ball is the outlier.

If not, the lesser of the two piles has your ball. For the second weigh, divide the balls to 2vs2. The lighter duo will further narrow your choice. Simply remove one ball from each side. If the two are equal, you hold the lower weight ball in the same hand add the lighter side. If the are unequal, the lighter ball is obvious.

If it's a digital scale, only one weighing is necessary. Place all 9 on the scale, and record the weight as each is removed. The one that causes the smallest change in weight from one reading to the next is the culprit.
 
A lot of people advocating a wrong answer in here. The weighing in groups of 3 solution doesn't work. Example: 7 balls weighing 5 units and 2 balls weighting 1 unit. You sort them into 5-5-1, 5-5-5, 5-5-1. You compare the two lighter groups and see them equal, so you discard them and check the heavy group and end up with a 5 ball as your answer instead of a 1 ball. I don't think the problem is solvable with the given information. I'd probably answer that you should do a sanity check by approximating by hand first and depending on what kind of group of candidates you get I'd change what I'd do next.
 
And what if it's BBBBBBBBBB or RRRRRRRRRR?

First guy would say B or R because of odd, second guy would get it right, third guy see's odd and says opposite color, with every other guy also guessing opposite color, no?

The third guy hears what the second guy said. The third guy knows the first guy saw an odd number of blues. The third guy also knows that the second guy concluded that he himself had a blue hat. So the third guy knows that there are an even number of blue hats including his own, but he sees an odd number of blue hats, so he knows his hat is blue.

A lot of people advocating a wrong answer in here. The weighing in groups of 3 solution doesn't work. Example: 7 balls weighing 5 units and 2 balls weighting 1 unit. You sort them into 5-5-1, 5-5-5, 5-5-1. You compare the two lighter groups and see them equal, so you discard them and check the heavy group and end up with a 5 ball as your answer instead of a 1 ball. I don't think the problem is solvable with the given information. I'd probably answer that you should do a sanity check by approximating by hand first and depending on what kind of group of candidates you get I'd change what I'd do next.

The setup is that only one of the balls has an odd weight.
 
A lot of people advocating a wrong answer in here. The weighing in groups of 3 solution doesn't work. Example: 7 balls weighing 5 units and 2 balls weighting 1 unit. You sort them into 5-5-1, 5-5-5, 5-5-1. You compare the two lighter groups and see them equal, so you discard them and check the heavy group and end up with a 5 ball as your answer instead of a 1 ball. I don't think the problem is solvable with the given information. I'd probably answer that you should do a sanity check by approximating by hand first and depending on what kind of group of candidates you get I'd change what I'd do next.

The question states that there is only one ball that is lighter than the rest. That is enough information.
 
The third guy hears what the second guy said. The third guy knows the first guy saw an odd number of blues. The third guy also knows that the second guy concluded that he himself had a blue hat. So the third guy knows that there are an even number of blue hats including his own, but he sees an odd number of blue hats, so he knows his hat is blue.

There we go, was forgetting each guy heard the others :)
 
How the fuck is this pertinent to any particular skill set that doesn't involve scales or balls? What a shitty question to ask a potential employee.

The theory behind these questions is that, if you're hiring for a job that involves constant decision-making and problem-solving, it's important to know how people think about problems. You're looking for skills like estimating, simplifying, identifying necessary and unnecessary information, and thought experimentation.

You may think these are stupid skills to test for, or that questions like this aren't effective ways to identify them, or that this PARTICULAR question is a bad way to identify them, but that's definitely the theory.

edit: The Nim question (adding numbers) is really more of a recursion test, from my perspective.
 
Ok here is another game related question/riddle.

The game is played sequentially by two players, lets call them player A and player B. At each round player A picks a number between 1 and 10, and then player B picks a number between 1 and 10 after observing the number picked by player A. These two numbers are then added together, before the second round commences. Player A now picks a number between 1 and 10, and then that number is added to the sum of the previous two numbers. Afterwards, player B picks a number between 1 and 10, and then that number is added to the sum of the previous three numbers. The game then continues in a similar fashion. The objective of the game is to reach the number 50. Therefore, each player wants to be the last one to add a number between 1 and 10 which ensures that the sum of all the numbers equals 50.

So if A first picks 9 and B 10, the sum stands at 19 at the beginning of the second round. And if A then picks 4, the sum stands at 23 before B has to pick a number.

The big challenge is:
Come up with a strategy/plan for player A which ensures that A wins, regardless of any combination of numbers picked by player B.

okay to insure your victory you need to be the one that makes the value add up to 39, to ensure that you need to have the value that adds up to 28 to ensure that you need to place the value that adds up to 17 to ensure that your first value must be 6.
 
The theory behind these questions is that, if you're hiring for a job that involves constant decision-making and problem-solving, it's important to know how people think about problems. You're looking for skills like estimating, simplifying, identifying necessary and unnecessary information, and thought experimentation.

You may think these are stupid skills to test for, or that questions like this aren't effective ways to identify them, or that this PARTICULAR question is a bad way to identify them, but that's definitely the theory.

I'd probably fail an interview that asked something like this, simply because I'm bad at thinking aloud. Having to explain my thought process as it happens tends to cause it to break down.
 
Suppose you have 9 balls and one of the balls is lighter in weight than the others. You also have a simple weight machine. You get two tries to use the machine and your goal is to find the lighter ball.

First measure: 3 and 3
- if they equal, the lighter ball is in the 3rd set

Second measure: 1 and 1 from the set identified in the first measurement
- if they equal, the light ball is the one you didn't measure.

What stock Microsoft interview question would you like to waste my time with next?
 
In your case I'm not sure why you chose to tile the board, though. It seems, similarly to my line of thinking, to be a helpful step, but not necessarily for the right reasons, because there is no way to know if the number of

I'm not sure why I made that step either, I just wanted to visualize the optimal layout and circles tessellate like hexagons.

It was just to help me get an image on the process.
 
Status
Not open for further replies.
Top Bottom