Hudson·Software Engineer·Technical Phone Screen
- What does the inline keyword actually mean in C++, and what does it guarantee versus what it only hints at?
- Walk through exactly why inlining a function can increase binary size, and describe a scenario where a non-inlined call gives better latency than an inlined one.
- What does the new keyword do under the hood, and can you describe what malloc is actually doing at the implementation level?
- Does the OS get involved every time you call new or malloc? How would you avoid touching the OS on a latency-sensitive hot path?
- Roughly how much slower is heap allocation compared to stack allocation, and why?
- Compare templates and inheritance as tools for polymorphism. When would you choose one over the other?
- What are the differences between std::map and std::unordered_map, including worst-case complexity for each?
- How does an unordered_map actually locate the right bucket for a given key?
- What is a segmentation fault and what is actually happening at the hardware and OS level when one occurs?
- If you bind a reference to a dereferenced null pointer, when exactly does the crash happen and why?
“I started talking about inlining as a performance hint and the interviewer immediately pushed back asking what it actually guarantees at the language level.”