Job interview questions

by on July 1, 2011 at 6:16 am in Education | Permalink

Jane Street Capital: What is the smallest number divisible by 225 that consists of all 1’s and 0’s?

I believe it must end with a zero.  And the next to last digit must be a zero.  Keep on going.  Via Chris Blattman, here are some more, along with a few snarky answers.

Leonid July 1, 2011 at 6:30 am

1100

Ed July 1, 2011 at 6:38 am

probably not divisible by 225…

Leonid July 1, 2011 at 6:39 am

oh duh, forgot to check my work. but now i see the trick!

Andrew' July 1, 2011 at 6:39 am

Nice, but why not 0.1?

MIchael Foody July 1, 2011 at 8:01 am

0

CJ July 1, 2011 at 9:22 am

It’s 225, but you have to write it in binary. The only number in base ten that could be considered fitting is zero.

Craig July 1, 2011 at 10:39 am

Zero abuses the ordinary meaning of “divisible by.” Any number is divisble by 225 if we are willing to play semantic games. For example, 1 divided by 225 is 1/225, or .00444444….. Oh, you meant _evenly_ divisible? Well why didn’t you say so?

Noumenon July 1, 2011 at 6:33 am

I tried adding, then generating a couple numbers (1, 10, 11, 100, 110, 111) before realizing they were getting factorial. Then I took the factorization of 225 (3*5*3*5) and said “we can make the 5′s into 10′s by multiplying by 2×2, giving us 900, then what do we multiply by to get a 111… number divisible by 9?” All numbers divisible by 9 have the sum of their digits divisible by 9, so it would have to have 9 ones, as close to the ones place as possible… 11,111,111,100. Would’ve been an agonizing interview and I might still be wrong!

ecurbCO July 1, 2011 at 6:46 am

Very nice. I gave up on that one.
A lot of the other ones were easy, and were just to see if you could use reasoning outside of text-book questions.
Although we covered Russian Roulette in 8th grade math, fortunately enough…

PLW July 1, 2011 at 9:23 am

My logic exactly.

Rob July 1, 2011 at 6:45 am

Tyler is correct about the last two digits.

225 is divisible by 9, so any number divisible by 225 must also be divisible by 9. Any number divisible by 9 must have digits which sum to 9 (or another number divisible by 9, and so on until you get to 9). The lowest number that meets these criteria is 11111111100 (nine ones followed by two zeros).

Joshua Green July 1, 2011 at 6:45 am

A bit of thought (and number theory) makes this relatively simple. 225 = 9 x 25.  Any multiple of 25 must end in 00, 25, 50, or 75, but only the first is allowed here.  Any multiple of 9 must have digits that sum to a multiple of 9, hence that sum must be one of 0, 9, 18, 27, … .  An integer is a multiple of 225 if and only if it is a multiple of 9 and 25.  Assuming they want a positive integer, the smallest is 11111111100.

OP July 1, 2011 at 6:46 am

0

Jim July 1, 2011 at 9:47 am

10, actually, since the problem stipulates 1′s and 0′s.

RZ0 July 1, 2011 at 6:51 am

Spoiler alert (I think):
.
.
.
.
.
.
11,111,111,100
I note that 225 = 25 x 9.
All products of 25 end in 25, 50, 75 or 00. Therefore the number must end in 00.
All products of 9 have digits that sum to 9. Therefore the number must have nine 1′s.
So the answer would be nine ones followed by two zeros.

k July 1, 2011 at 6:55 am

Well, 225 is 9 x 25, and a multiple of 225 would be 225 x some integer n.
but if we break up the integer n into integers a and b s.t. n=ab, we can do something interesting like 9 x a x 25 x b
25 x b is obvious.
multiples of 9 have digits that add up to 9… so we can see where this is going. we don’t have to find a, nor do we need to.

MM July 1, 2011 at 7:08 am

Wouldn’t it just be 10? The question doesn’t require that the number be evenly divisible by 225.

RR July 1, 2011 at 8:57 am

Exactly. Nothing about positive integers or base-10 is stated. It does ask for ones and zeros so it’s not 1.

Jason Scheppers July 2, 2011 at 10:37 pm

I agree the questioner should have said integer instead of numbers. 10 is good unles you think 01 is valid or decimal point does not count which would make the questions unanswerable.

Erik July 1, 2011 at 7:10 am

My answer: 11111111100. (225*49382716)

Procedure I used: Multiply by 4 to reduce the number of non-binary digits, get 900. Remember that a number is divisible by 9 if the sum of its digits is 9. Note that I need two zeros on the end. Write nine ones followed by two zeros.

Mercy Vetsel July 1, 2011 at 7:14 am

1,000,110

Solved it in 2 minutes in Excel. Must be a binary number, so just try them all:

A1 B1 C1
1 =dec2bin(A1) =mod(B1,255)

Copy down and on line 70 the first answer appears. Ok, so I’m sure this ruins the mathematical beauty of the question, but when the numerical solution is so easy, why fool around with the math?

-Mercy

Mercy Vetsel July 1, 2011 at 8:07 am

Oops! It looks like I don’t get the job. I’m not sure why I read 255.

But my approach still works. Using the correct divisor of *225*, the number is indeed 11,111,111,100. And the DEC2BIN approach is a cute way of solving the problem.

Also, my approach still works even if you don’t have an arithmetic trick like the sum of the digits .

Quick! What about 522? 101,111,011,110
252? 111,101,111,100

If God wanted us to do math, he wouldn’t have invented computers.

-Mercy

JCL July 1, 2011 at 12:18 pm

that was a good trick to generate a list of 1&0 numbers. but if was the “lazy” solution, even if you took 5sec to do it in excel. i like seeing the logic of people here too

Dean Sayers July 1, 2011 at 2:59 pm

I read it as 255 originally too. Must be all that hexadecimal game-training as a kid…

ad*m July 1, 2011 at 7:26 am

11100001(binary) = 225 (decimal). 225/225 = 1.
The question did not specify base-10.

Marie July 1, 2011 at 8:11 am

That was my thought. There was no base 10 stipulation made anywhere in the question.

q July 1, 2011 at 12:24 pm

Yeah, I know. When someone asks me what 1+1 is, I immediately think: “What kind of fool does he take me as? It must be 10.”

Justin Bassett July 1, 2011 at 8:45 am

This is the answer I would have given. Work smarter, not harder.
I wonder what an interviewer would think of it?

Justin Bassett July 1, 2011 at 8:46 am

Also, why not just 1 (base 225)? The numbers are the same size and you save yourself the effort of a binary conversion

Neal July 1, 2011 at 10:11 am

“What a smartass.”

John Mansfield July 1, 2011 at 9:28 am

Maybe it’s a question to weed out those people who need base-10 specified for them.

Jim July 1, 2011 at 7:42 am

225 decimal == 11100001 binary. All 1′s and 0′s and divisible by 225, it is all just a matter of what base you use.

Noumenon July 1, 2011 at 7:55 am

So do you get extra points, or different tracks, for going with the easier (computer) or cleverer (binary) solutions? If you knew all three answers, which would you give?

David Krych July 1, 2011 at 8:11 am

The binary answer is clearly what they’re going for (ALL “brain teaser” questions given in interviews are ways of seeing if you can think outside the parameters of the question). But if you came up with the base-10 answer as well, that would be bonus points.

Noumenon July 1, 2011 at 9:38 am

I thought maybe the binary shortcutters went to management and the “knows facts about divisibility” people went to workhorse math nerd jobs.

Alex July 2, 2011 at 12:47 pm

Knowing Jane Street, they would want to hear the decimal answer (seeing as it has one that is reasonably easy to get to). Now, if you told them the binary answer as well, I’m sure they wouldn’t count it against you.

Doc Merlin July 1, 2011 at 8:56 am

11,111,111,100
How in base 10:

225=9*25
Digits of integers divisible by 9 must add up to 9
so the smallest integer thats 1′s and 0′s thats divisible by 9 is 111111111, now the smallest integer divisible by 25 that is 1′s and 0′s is 100. We multiply these two numbers together, tadah.

If you want to just go binary you can, but this is more fun.

Doc Merlin July 1, 2011 at 8:57 am

Well, crap, someone on the thread beat me to it.

John Hall July 1, 2011 at 8:57 am

How about 111*111*100

Matt July 1, 2011 at 9:04 am

That’s one of the easiest finance interview questions I’ve ever seen…

Larry Headlund July 1, 2011 at 9:42 am

For the Goldman-Sachs question I would say:

If I had eight balls I wouldn’t be sitting here.

And I would be perfect for Goldman-Sachs.

corporate_serf July 1, 2011 at 9:48 am

The goldman sachs question was a bit of social engineering. Didn’t ask 9 balls, which is what the algorithm can do, but 8, in an effort to mislead.

Facebook question is standard computer science, generalized to 5-way trees

IVV July 1, 2011 at 10:11 am

No, it takes three weighs for 8 balls instead of 2 weighs for 9 balls. 8 is 2 cubed, while 9 is 3 squared. So, for 8 balls, you divide the group into two groups of four each, weigh them, then divide the heavier group into two groups of two balls, weign them, then finish with weighing each ball of the heavier duo.

For 9 balls, you divide the balls into three groups of three balls each, weigh two of the groups, keeping the heavier group for the second weigh. If the two groups you weigh are equal, keep the unweighed group for the second weigh. You similarly weigh two balls from the chosen group. The heavier ball is the heavier ball, and if the scales are balanced, then the unweighed ball is the heavy one.

IVV July 1, 2011 at 10:16 am

Wait, clever, with 8 balls you need two weighs.

You do the same thing with the nine-ball method. Weigh 3 balls vs. 3 balls, with 2 balls on the side. Then, you weigh the 2 balls against each other if the scales balance in the first weigh.

corporate_serf July 1, 2011 at 10:59 am

bingo.

that’s why it’s a trap

gregasaurus July 1, 2011 at 11:55 am

Facebook question is also social engineering/nerd snipe, at least as stated in the article.

Answer: One race, 25 horses on the track. The top 3 finishers are the fastest. There is no constraint given with respect to how many horses fit on a track.

Michael Cain July 1, 2011 at 1:58 pm

Yes, the more interesting version of this question explicitly limits each race to five horses. In which case, seven races.

forager July 1, 2011 at 9:56 pm

Break the 25 horses up into 5 nodes of 5 horses each and then determine the ranking of the horses within each node (5 races). Then race all of the top ranked horses against each other to determine the fastest horse (6 races).

You can exclude the bottom two horses from race 6 and all the horses in their nodes because they clearly aren’t in the top 3. Now, there are 5 possible horses to fill the second and third positions. Either the 2nd or 3rd horses from the winning node, the 1st or 2nd horses from the 2nd place node, or the 1st horse from the 3rd place node.

Race these 5 horses against each other, and you know the top three horses (7 races).

dirk July 1, 2011 at 9:49 am

All the Sailer fans keep telling me that employers can’t ask these questions because they are racists. So what gives?

ad*m July 1, 2011 at 12:17 pm

Plausible deniability is possible with these questions. The argument is about disparate impact by structured tests, and the employer can deny that is what is going on here.

You are referring to Griggs vs Duke Power http://supreme.justia.com/us/401/424. Griggs vs Duke Power applies to companies, but does not apply to SWPL ‘learning’ institutions such as Harvard etc. – prospective employees pay Harvard which then legally does the smartness tests that the employers are forbidden to do.

‘Markets in everything’

corporate_serf July 1, 2011 at 12:55 pm

harvard can evaluate quants?

dirk July 1, 2011 at 4:24 pm

The article claims these questions are being asked directly by the companies not Harvard. Is the article wrong or does Griggs vs Duke Power not apply to all these companies for some other reason?

Cliff July 1, 2011 at 9:52 am

I am surprised so many people knew that multiples of 9 have digits that sum to 9 (or a multiple). Never heard that one before, seems a pretty useless fact?

IVV July 1, 2011 at 10:02 am

You should have watched more Square One TV growing up.

http://www.youtube.com/watch?v=Q53GmMCqmAM

careless July 2, 2011 at 7:55 pm

So I’m not the only one who had that song in his head through these comments.

Neal July 1, 2011 at 10:19 am

“How would you market a telescope in 1750 when no one knows about orbits, moons, etc.?”

LOL, nobody knows about orbits and moons 75 years after Newton’s Principia?

“Suppose you had eight identical balls. One of them is slightly heavier and you are given a balance scale. What’s the fewest number of times you have to use the scale to find the heavier ball?”

The algorithm does work, and the answer is two times. Split into 3, 3, 2. Weigh 3 vs 3. If same, weigh 1 vs 1 and pick heavier. If different, throw away lighter 3, 2. Split heavier three into 1, 1, 1. Weigh any two. If same, unweighed is heavier. If different, heavier is heavier.

Manoel Galdino July 1, 2011 at 8:40 pm

But I was wondering: How do you know that difference is statisticaly significant? There is measurement error, right? Is this to think out-of-the-box? If so, in the wrong way?

corporate_serf July 1, 2011 at 9:54 am

also, the google question there was pure combinatorics. I have heard better trick questions from tech companies. One game theoretic question was so good I started using it for finance (option theory) type positions (has a martingale solution as well).

Noah Yetter July 1, 2011 at 9:59 am

IMHO, solving this in your head is the Wrong Answer. Here’s an off-the-cuff solution in Python:

#!/usr/bin/python
i = 0
while True:
i += 450 #only even multiples could possibly work
v = True
for j in str(i):
if j not in ["0","1"]:
v = False
break
if v:
break
print “i=”+str(i)

output:
i=11111111100

Noah Yetter July 1, 2011 at 9:59 am

sigh, comments box ate the indenting which of course matters in Python…

gregasaurus July 1, 2011 at 11:59 am

Funny, I took the same solution approach but used java. Much prettier & surely faster to write in python.

IVV July 1, 2011 at 10:00 am

“Zero. Zero divided by 225 is zero. Or, are you asking for the smallest nonzero natural number resulting in a quotient that is, itself, a nonzero natural number?”

Neal July 1, 2011 at 10:21 am

Sorry about that, not meant to be a reply.

Tomasz Wegrzanowski July 1, 2011 at 10:59 am

This one is really easy. 225=25*9.

Divisibility by 25 means ending with 00/25/50/75, so it obviously ends with 00.

Divisibility by 9 means repeated sum of digits modulo 9 is 9. So there must be nine 1s (or eighteen etc.).

The smallest number like that is 11_111_111_100 (9 ones, 2 zeroes).

That was one minute without a computer, did I get the job ;-p ? (was this for computer programmers or something?)

Swedo July 1, 2011 at 11:00 am

Answer consists of all 1’s and 0’s (a).

One has to multiply 225 by 4 to get the two last digits to 00 (b):

225 * 4 = 900

Hence, the answer is divisible by 900, and by 9.
Divisibility by 9 gives: every digit in the answer, added together, must be divisible by 9 (c).

(a), (b), (c) gives 11111111100, since it is also the lowest possible number.

Answer: 11111111100

NV July 1, 2011 at 11:15 am

My answer is 11111111100. The logic: to be divisible by 225 the number must be divisible by 25 and 9. Testing for divisibility by 9 is simple – the sum of the digits should be divisible by 9. Since the numbers are made of only 1′s and 0′s and divisibility by 25 will require ending in 0, the first number to try is 1111111110. Divisible by 9 but when divided by 25 leaves a fraction of 0.4. Add another 0 at the end and you now have a number divisible by both 25 and 9.

Nylund July 1, 2011 at 1:28 pm

The easiest way to come up with the answer is to blog the question and let readers do the work.

This technique also has the advantage of working for every question listed.

JD July 1, 2011 at 4:04 pm

The engineering answer is 1000

250 * 4 + uncertainty margin

TD July 1, 2011 at 6:28 pm

Google: You are climbing a staircase. Each time you can either take one step or two. The staircase has n steps. In how many distinct ways can you climb the staircase?

Fibonacci.

DK July 1, 2011 at 6:47 pm

I really like the 225 in binary form (my first gut reaction to save time) but these interviews are usually so moronic that the interviwers would probably call it a wrong answer. Not unlike so many professors who grade incorrectly because they cannot contemplate another to the ambiguous questions they pose. Or [some] stupid IQ tests (name the odd one out: cow, hen, pig, sheep).

Manoel Galdino July 1, 2011 at 8:43 pm

I tried some of the answers posted here in R and they didn’t work or were bigger than my guess: 1,000,000,000

Mark Dionne July 2, 2011 at 3:13 pm

25 / 225 = 0.1111111…

but then

.025 / 225 = 0.000111111111…

so there is no limit: you can keep adding more zeros after the decimal point

Mark Dionne July 2, 2011 at 3:28 pm

Oops, misread the problem…

Bill N July 4, 2011 at 8:55 am

The racehorse question has no valid solution because it ignores performance variation. Apply the questioner’s reasoning to programming leads to “race conditions” and deadlocks. The sad state of software engineering makes a lot more sense now.

Comments on this entry are closed.

Previous post:

Next post: