Bloomberg Interview Question

[First round] (1) Implement atoi (2) Simple dynamic programming on array (3) Design a system that listens to updates from multiple stocks and updates listeners that have subscribed to those stocks. [On-site] Find the longest increasing sub-sequence in an array of integers. Run 9 minutes with 2 hourglasses of 4 minutes and 7 minutes.

Interview Answer

Anonymous

Apr 19, 2015

For the Hourglass question: 1. Start with both glasses: 7 and 4. 2. Once 4 minutes are passed: rotate the 4th minute glass. 3. Now 3 minutes are left in 7. The 4th minute glass is running with 3 minutes of 7 minute glass. 4. Once 7 minutes are passed in total, you've 1 minute left in the 4 minute glass. 5. Rotate the 7 minute glass. Once 1 minute of 4 the glass, 1 minute in 7 glass is also passed, rotate the 7 minute glass and let it finish: So: 7(7 minutes) & 4( 4 and 3 minutes) + 7 "rotated" (1 minute) and 4 (1 minute) + 7 "Rotated" (1 minute)

4