First, they asked me to do a online test on hackerrank.com. There were 16 test cases. I passed 15 of them. I tried lots of time and could not pass the last test case. After a couple of days, they mailed me to do the phone interview. After a couple of hours of the phone interview, they mailed me to do the onsite interview.
In phone interview, they asked structure packing, signal, gdb, soft/hard link, inode and so on. Not difficult, but I failed to answer some of them.
The onsite interview was 1:1 with two interviewers. The first was the technical interview, he asked:
1. Implement power of 10 template without runtime overhead.
2. How to check if a class has a member function. (Failed to answer)
3. Write the syntax to specialise the template function of a template class. (Failed to answer)
4. Explain the implementation of virtual function.
5. Giving the root of a binary tree and a value, find the two nodes of the tree, which the sum of them equals to the value. (I wrote the codes which the complexity is O(nlogn) ).
6. Explain how mmap works. (I thought OS mapped the region in heap, instead, it mapped between heap and stack.)
7. How to compute the size of L1/L2 cache of CPU without read /proc/cpuinfo. (Failed to answer)
The second interviewer asked me why choose the company, a little bit about last project, etc.
After the onsite interview, I was rejected. Fair enough, I failed to answer some questions.