This training course schedule can be used a reference for interview review!
1. write C to generate segmentation fault and Stack overflow.
Ans: http://web.mit.edu/10.001/Web/Tips/tips_on_segmentation.html, http://embeddedgurus.com/stack-overflow/2007/06/understanding-stack-overflow/, http://www.devx.com/tips/Tip/14276
2. give example to use function pointer
Ans: K&R-qsort; or in <a modern approach>: function pointer mostly used as an argument for a method, or it can be an element in a struct, say in uCos to realize OOP in C.
or, In concurrency in OS three easy pieces: http://pages.cs.wisc.edu/~remzi/OSTEP/threads-api.pdf
3. which to use in simple embedded systems: arrays or dynamic memory using malloc and why?
Ans: http://thesynchronousblog.wordpress.com/2013/05/20/dynamic-memory-management-in-embedded-systems , http://en.wikibooks.org/wiki/C_Programming/Memory_management, http://stackoverflow.com/questions/1725923/how-bad-is-it-to-use-dynamic-datastuctures-on-an-embedded-system
4. when to use volatile
Ans: http://www.barrgroup.com/Embedded-Systems/How-To/C-Volatile-Keyword, or CMPE 244 preet notes
5. How to use Static/Exten, where do they locate, what's problem of a static large array?
Ans: CMPE 244 note, http://stackoverflow.com/questions/13415321/difference-between-static-auto-global-and-local-variable-in-the-context-of-c-a
6. What is different of preemptive and cooperative RTOS?
7. Why not use RTOS?
Ans: http://www.barrgroup.com/Embedded-Systems/How-To/Preemption-Perils, Get by without RTOS
As mentioned in the 2nd paper, it mentioned: for Time-critical aspect, RTOS is negatively affect due to ISR latency, context switch...
8. Compare macro and function.
9. When to use inline function?
Ans: http://www.gotw.ca/gotw/033.htm, http://stackoverflow.com/questions/132738/why-should-i-ever-use-inline-code
10. difference between malloc and calloc
11. difference between malloc and new
Ans: http://stackoverflow.com/questions/184537/in-what-cases-do-i-use-malloc-vs-new, http://www.geeksforgeeks.org/malloc-vs-new/
12. How do you pass variable number of arguments in “C” and why this is a generally bad idea?
13. Diff between struct and union
14. Diff between func(void) and func()
15. Memory errors: memory leak, OutofMemory, ...
16. try/catch in C++
17. Data structures, focus on linked lists, dynamic arrays, trees and graphs.
Ans: CC150. Hawstein.
18. Remove spaces in a string in C
19. Why cannot use malloc in RTOS? malloc = BAD! (ARM M3 or MSP430 or 18F4550 have NO MMU, so don't support Virtual Memory)
Ans: http://www.rockbox.org/wiki/WhyNoMalloc, http://www.freertos.org/a00111.html, http://www.embedded.com/design/programming-languages-and-tools/4416457/EMB-tm-6-15-13-Dynamic-memory-and-heap-contiguity
20. Write a C program to find big or little endian:
21. When to use virtual deconstructor?
Ans: when use polymorphism, such as factory DP: http://www.programmerinterview.com/index.php/c-cplusplus/virtual-destructors/
From Qualcomm interview:
1. How to find the size of one var type without using sizeof()?
Ans: use offsetof() which: size_t size = (size_t)(1 + ((X*)0));
2. Design Circular buffer without STL.
3. Write C code for convolution. In Baidu, use cuda.
4. what is priority inversion and how it is solved?
http://www.drdobbs.com/jvm/what-is-priority-inversion-and-how-do-yo/230600008, or http://www.embedded.com/electronics-blogs/beginner-s-corner/4023947/Introduction-to-Priority-Inversion
5. phone interview operating systems- priority inversion, ISR & interrupt vector table, order of complexity of sorting algorithms
6. "Difference between const char * and char const *"