-
Interview “signal” matters
assert>std::cout
-
What is
assert?#include <cassert>assert(add(2, 3) == 5);- True → nothing
- False → crash + line number
-
How to disable assert?
- Compile with
-DNDEBUGor#define NDEBUG - Asserts removed (zero cost)
- Compile with
-
Why it’s useful in interviews
- Fewer chars!
- Faster to debug - no manual checking (vs cout)
- Shows correctness mindset (seniority)
-
This C++ Code Change Makes You a Senior Engineer
-
How do you show "signal" in C++ coding interviews?
-
C++ assert vs cout: Which Should You Use for Interviews?
-
The Best Way to Add "Tests" for C++ Code in Interviews
-
How to level up from Junior to Senior in C++ interviews?
- ChatGPT and Gemini