Riverbed Phone Interview Experience

In Jan 2014, Riverbed interviewed me for a Software Engineer position in Platforms Group. They were looking for low level software dev experience (kernel dev, drivers and such but not all the way down: board bring up etc). I was interviewed by manager of the group and questions were fairly standard. Due to my interview nerves, I bungled it.

Verbal:
- How much do you know about linux kernel programming?
- Can you explain how an interrupt works?
- Difference between s/w interrupt and hardware interrupt?
- In a user space, if a timer expires, does it generate a hardware interrupt?

Programming Questions:
1. Write a program to determine endianness of a system.
A. Its quite standard program.

2. Given that malloc() and free() gives and frees memory on a 32-bit aligned boundary, write following routines:

void *my_malloc(size_t size); 
void *my_free(void *my_ptr);
my_malloc should return memory on 128 bit boundary. my_free to free that memory.
A. An excellent/detailed answer can be found on Stackoverflow. I noticed that many questions were from Stackoverflow (more on that later). Only two things are important in this question: (a) How to ensure 128 bit boundary. (b) How to return original pointer address when freeing it.

Read all answers on SO's post and there will be lot of clarity. The trick for (b) is to allocate more memory in my_malloc() than input param 'size' and move the pointer ahead to store the original address returned by malloc(). So, my_malloc() returns 128bit aligned pointer while the original address returned by malloc is "behind" the pointer returned by my_malloc(). Apparently, its a standard trick in embedded world.

3. Given two sorted linkedlists, return a new (or merge them in to one) that is sorted and contains both list nodes.
A. This is also fairly standard question. I solved it using double pointers and perhaps did not provide complete solution (we ran out of time). In general, its good to practice and become a two star programmer.

I wasn't too happy with my performance, but fortunately, got called for onsite interview. More on that in next post.

Labels: , , , , ,