Why Bloomberg?
Number of Islands
I have solved this question before so the interview was a breeze
NOTE: Interview ran my code!!!. There is the notion that bloomberg doesn't run code in interviews, but my interviewer ran mine. Maybe because he wasn't sure of my solution. Fortunately for me I wrote the code as perfect as I could and our test cases passed.
Why Bloomberg?
Given a list of banks with opening times, and a time interval for trading. Determine if you can tradewith any banks during the given interval. E.g
00:00 - 08:00 Bank of America
12:00 - 17:00 Swiss Bank
18:00 - 23:00 Goldman Sachs
06:00 - 10:00 FAIL
Because no bank is open from through out the interval 06:00 - 10:00
13:00 - 17:00 SUCCESS
Because Swiss Bank is open from 13:00 - 17:00
My first solution was to merge all the bank opening time intervals and if our given interval wasn't within any of those merged intervals, then its a fail, successfull otherwise.
Interview asked "can you do better?" then gave a hint: "there's a fixed number of hours in the day"
I then initialised an int array "arr" of length 24. I then went through the bank times. and for every hour "i" a bank was open I set arr[i] = 1. If the range of our given interval in our array wasn't all 1's, then its a fail, successful otherwise.
Why Bloomberg?
Design a stock alert system. A client enters some stock and a thresold they want to receive alerts on. Design a system that notifies the client when this threshold is met.
I wasn't expecting to go through after this round because I felt I didn't do vey well. Interviewer was an engineer that had been with the company for well over a decade. He didn't react much. 9 minutes after the interview concluded I received an email moving me to the next round. I had the next round a few hours later.
Questions Hr/Recruiter asked
Questions from Engineering manager
Result: I received my rejection letter two days later (in the morning). Emotional damage :'{
There were a lot of people who got interviews the same way I did, but none of us made it :'{