I recently changed jobs and I'll soon join opensignal in London. So I've done a few interviews for various companies and I'll write a bit about the kind of questions I had.
##Fizzbuzz I've got variants of the fizzbuzz problem. Most frequently: how to reverse a given string. So yeah, apparently this test is actually used and usefull.
Algorithms and complexity
I've got some questions about pure algorithms and theoretical CS.
- How to implement an LRU cache (map + linkedlist)
- How to check a given binary tree is a binary search tree. (to test knowledge about recursion I suppose).
- Given a set of
npoints in a 2d maps, give a function to pick the
kclosest to the origin. This can be done in
O(n). I had a solution using a heap and I was given hints to design a function similar to quicksort which does the trick too.
- Given an array of integer, output another array where every elements is the product of all the other elements. This can be done in
O(n)by computing two array of cumulative products (one from the right and another from the left).
- Count harmonic slices in an array.
I actually only got one question about general design: how to represent a jigsaw puzzle and how to solve it.
These were little programs I had to write and then we discussed about them.
- UI to browse gists of users using the github api. It was required not to exceed 4 hours (or mention if it took more time).
- A reusable component for an infinite view (like facebook feed).
- A live coding session (through skype) of 2 hours about designing a wrapper around a custom api.
Quite a few questions more general topics:
- me: carrier plan, what do I look for.
- technical: general discussion about tools and languages. Languages and paradigm I'm interested in and why.
An interesting experience all in all, and will be useful when I'll be on the other side in the future. Hiring is hard but very interesting.