8
May
2012
Posted by James. Comments Off
It is intriguing that some of the most important technological advances in history were made due to chance. For instance, no one ever sat down and planned the invention of Penicillin (the first antibiotic) because it was a discovery – that is, a result of something that was not planned – something that happened accidentally but someone sat up and took note of what was happening in front of them. So really this is a list of things that were never planned.
Read the rest of this entry »
3
May
2012
Posted by James. Comments Off
If I think of a number between 1 and 1000, what’s the minimum number of guesses required if you are given a hint “higher” or “lower” for each guess?
Read the rest of this entry »
3
May
2012
Posted by James. Comments Off
You need to cut a birthday cake into 8 equal pieces. But you can only slice the cake 3 times. How do you do it?
Read the rest of this entry »
3
May
2012
Posted by James. Comments Off
Joe Bloggs wants to hack into someone’s email account: he knows their name and roughly where they come from, and maybe what university they went to. Without any programming, how does he access your password-protected yahoo email?
Read the rest of this entry »
28
Apr
2012
Posted by James. Comments Off
If there is a wind blowing, would a round-trip by plane take more time, less time, or the same amount of time than on a still day?
Read the rest of this entry »
5
Dec
2011
Posted by James. Comments Off
Suppose you lay out a long line of coins, all facing heads up, and number them 1, 2, 3, …
Suppose that you then go and flip over the 2nd, 4th, 6th, 8th, … coins. (You would then have a pattern H T H T H T H T… )
Then you go and flip over the 3rd, 6th, 9th, 12th, … coins. (You would then have H T T T H H…)
And then you go and flip over the 4th, 8th, 12th, 16th, … coins.
And so on.
Which of the coins will remain heads up, and why?
Read the rest of this entry »
10
Nov
2011
Posted by James. Comments Off
The simple approach to trading is to buy some shares and then sell them later.
For instance: I could buy 1000 shares of NVDA (Nvidia Corp.) at $10, wait for the price to ramp up, and later sell the shares at $15, making a hearty $5000 profit (minus transaction fees).
Short selling is the reverse of this process: you sell the shares first and then buy them later.
But how can you possibly sell shares that you don’t have? Well, when you initiate a short sell, your broker borrows the shares from one of its retail customers and sells it on the market. Your account is credited with the proceeds, however you owe them the shares back. At a later point in time, you decide to cover your position by buying the stock, and the shares are returned to the retail customer.
So to continue the previous example, if we short (sell) 1000 shares of NVDA at $10, wait a little while, and then buy to cover the 1000 shares at $15, we make a loss of $5000. So when shorting, we are interested in the price going down rather than up!
I.e. even in bear markets you can make a profit.
8
Nov
2011
Posted by James. Comments Off
I got asked this question during a technical interview for Bloomberg:
You have a piece of hardware that generates random 0’s and 1’s at your request. How would you use it to generate random numbers between 0 and 199 (200 values)?
The obvious problem here is the set of values you’re interested in; had it been 0 to 255, then you only need to bung 8 bits in a byte and you’re done. But in this case we need to be careful and make sure the generator has a uniform distribution.
0 = 00000000 in binary
199 = 11000111 in binary
During the interview, I said that you generate a byte’s worth of random numbers, and if the number is above 199, then simply query the hardware again until you get one below 199. The obvious flaw to this is that you might be unfortunate and have to call the function hundreds of times, theoretically up to an infinite number of times! However, in practice this is a suitable approach, and you are assured of it being a uniform distribution. That answer was accepted.
What’s the chance of having to re-call the function 20 times in a row? About (56/255)^20 = 6.81e-14. That means, if you called the RNG 100,000 times a second, on average this worst-case would happen once in every 5 years.
8
Nov
2011
Posted by James. Comments Off
This question was asked to one of the interns at Citi.
Taking it one step at a time…
At 3:00 the big hand is at 12 and the little hand is at 3.
At 3:15 the big hand will be at 3, and the little won’t be at 3 – it’ll be 1/4 of its way towards the next number.
Therefore the angle between the hands is (1/4) * (1/12) * 360 = 7.5 degrees.
8
Nov
2011
Posted by James. Comments Off
This one was apparently asked by Microsoft in the US to their prospective employees in the early days. It’s designed to assess how the person thinks rather than their being a definitive answer.
These are the ones I thought of:
Rolling it – Manhole covers are heavy, and it might be helpful to be able to roll one across the ground instead of dragging or carrying it, and is potentially more safe.
Manufacturing it – Whatever factory makes manhole covers may well make a range of other round objects, and so its cheaper to use the same machine and be happy with cheaper round ones.
Geometric safety – A circle is the only shape that, given a certain angle and tilt, cannot fall in on the hole it is covering. This is important since manhole covers are heavy, and so difficult to retrieve, but also it’s a lot safer, since one reason you might be removing a manhole cover is to let people down below escape, and you don’t want it landing on your head.
Of course, to my knowledge, manhole covers in the UK seem to be all sorts of shapes, so I’m not sure any argument holds true!