Yesterday I failed another interview. This time with Bloomberg. Hopefully I will soon be looking back on this from the wasted hours of my new job and wonder how I might have imagined what I would be doing at the then present time. Finding a job just takes time and persistence.
Anyway, these are some of the questions I remember which I was faced with almost as soon as I sat down:
- Given an integer, how could you find out whether it was odd or even?
- What properties does a Java Object object have?
- Write a function that returns the factorial of a given integer.
- Tell me what is wrong with this C code? (The code has a dangling pointer error in it).
- Given an 8bit integer, how would you count the number of binary “ones”?
- Given 8 coins, one of which is heavier than the others, how do you find the heavy coin using only two weighs of a old fashioned balance?
- Describe a binary tree. What can it be used for? How long does it take to search? Why does it take this long?
- Describe a hash table.
- Given a list of words, how would you find which words contained an anagram of themselves within that list?
- Given a list of words, how would you find the 25 most common words in that list?
I struggled answering questions 2, 4, 5, 9 and 10. I guess that’s why they didn’t want me. Still it was definitely interesting. I’ll have to research more about these questions and see if I can come up with some decent solutions.