Phone interview:
1. Please explain "volatile"
2. When is virtual destructor used?
3. What's the difference between mutex and spin lock(failed to answer)
4. Explain atomic
5. Barrier, UMB RMB and memory shield ( I've never heard before)
6. Give a solution when the entrances of the interrupt is not enough in linux.
7. Given a database, data was push into the database continuously, choose a data structure to find the minimum value in the database as soon as possible.
8. What's the difference between hash and tree?
On-site interview:
5 interviewer, each on per hour.
Black brother:
1. An RGB 8bit imagine was encoded in a 1 dimension array, how to transpose.
2. Derive the formula of linear regression.
3. Write the reloaded assignment operator of a string.
4. Memory, where is the heap, where is the program.
Young brother:
1. How is the std::map implemented?
2. The memory mechanism of std::vector and std::list
3. Explain const and static
4. Check whether a list has a loop, find the start point of a loop, check the length of a loop
5. When will a dead-lock occur?
6. Find the k-th max element of a array.
7. what's : const double* (*f[3])(const int * const a);
8. Use stack to implement a FIFO.
9. Three thread, each thread print "a","b","c", use lock to implement "abcabcabc".
10. How to detect edge in a imagine.
11. Given points: A, B, C. Then give D, check wether D is in the triangle of ABC.
12. Give a series of uint32_t, only one is not duplicated, find the none duplicated one with space complexity O(1) and time complexity O(n)
13. Find the max income: {3,1,6,7,5,2,4}.
14. Difference between TCP and UDP.
15. When use inline? What's the difference between inline and macro function?
Smile Brother:
1. Implement memmove(void* dst, void* src, int len){}
2. a binary tree, post order: "b f e g c d a", inorder: "b a d e f c g", find out the tree.
3. Where is the program ran at?
4. Why don't we have a virtual constructor?
5. what is spin lock?
6. Is std::map ordered?
Boss:
1. explain unique_ptr
2. explain move_construct