There were two rounds. I got rejected after the second. The first round was quite basic where they gauge your understanding of the C language. It starts off my some questions such as explain what malloc does. Then it goes into more detail like how would you malloc over a PCI-e. Then there were some terms and they ask you if you know what it means and explain them. Terms such as traceroute, ifconfig, ping, wireshark, ip, etc. You might also be asked some other basic questions around unix such as what does fork do, what would kill -11 do, what does select do, what will happen if I type this and so on.
After this they moved to some code. The first of this was involving two strings inside the main function. Something like this:
int main( int argc, char* argv[] ){
char* string1 = "string";
char string2[] = "string";
}
Then you'll be asked to modify a certain position in each string, say index 1. You might get thrown off by string1 since it's a string literal and therefore is read-only. You can't modify it. String2 will work fine in this case.
After this I was asked to write a palindrome function in C. This should be easy. I was also asked to write a Python script that reads in a file containing numbers separated by spaces on multiple lines. Treat the first number in each line as column1 and so on. I was asked to add all the numbers in column3. This should be easy again.
Make sure you can easily write code in a command line editor such as Vi or Emacs. Also make sure you know how to compile C code and run python script from the terminal. You should also have the basic knowledge of how to debug a file using GDB on the command line in case you get a segfault.
The second round was more thorough:
I was asked first to write up a stack API that a client would use. The client should be given the freewill to add any type of data that he/she wants. For example, they can push 1byte of data at a time or 1MB of data. The interviewer gave me three requirements that had to be fulfilled. I don't quite remember these off the top of my head. As you design your API you will be asked to demonstrate how the push and pop will be coded. Also, be open to changing your design as the interviewer will thrown in more conditions. I felt for this part you should be aware of size_t, and void *. These came in handy when writing the function signature.
The second hour of this interview was to compare to version strings. Here's how the docstring of the function looked like:
/*
vercmp compares two software version strings and returns the following:
if v1 > v2 : return 1
if v1 == v2 : return 0
if v1 < v2 : return -1
input strings are in the form "1.0.3", "2.10", "6.0.0.3", etc...
"1.0" is considered bigger than "1"
*/
int vercmp( char * v1, char * v2 ) {
}
I think the only way to do this is to keep track of the periods in each string and compare the corresponding numbers.