C is the language that exposes whether you actually understand how a computer works. Interviews for systems, embedded, and core engineering roles lean on it heavily, and the questions cluster around pointers and memory — the two things that separate people who know C from people who've only used it. Here are the C programming interview questions that actually get asked, with answers.
Pointers (the core)
- What is a pointer, and what is a pointer to a pointer?
- Difference between an array and a pointer.
- What is a dangling pointer, a wild pointer, and a null pointer?
- What is pointer arithmetic?
- What is a function pointer and where is it used?
Memory management
mallocvscallocvsreallocvsfree.- Stack vs heap memory.
- What is a memory leak, and how do you avoid one?
- What is a segmentation fault and what causes it?
Storage classes & keywords
- auto, register, static, extern — what each does.
- What does
constmean, andvolatile? - Difference between
#defineandconst. - What is the difference between a structure and a union?
Classic gotchas
- Why does
i = i++have undefined behavior? - What's the difference between
++iandi++? - What happens when you access an array out of bounds?
How to prepare
C rounds are explanation-heavy: "what does this print and why?" Practise reasoning about memory out loud. Greenroom runs spoken technical interviews that follow up on your reasoning. Pair it with our C++ and OS guides.
Frequently asked questions
What are the most common C interview questions?
Common C questions focus on pointers (pointer to a pointer, array vs pointer, dangling/wild/null pointers, pointer arithmetic, function pointers), memory management (malloc/calloc/realloc/free, stack vs heap, memory leaks, segmentation faults), storage classes (auto, static, extern, register), keywords like const and volatile, structures vs unions, and classic gotchas like undefined behavior in i = i++.
What is the difference between an array and a pointer in C?
An array is a contiguous block of memory whose name refers to its first element, with a fixed size known at compile time; a pointer is a variable that stores an address and can be reassigned. Arrays decay to pointers in many contexts, but sizeof on an array gives the total bytes while sizeof on a pointer gives the pointer size, and you can't reassign an array name.
What is the difference between malloc and calloc?
Both allocate memory on the heap. malloc(size) allocates a single block of the given number of bytes and leaves the contents uninitialized, while calloc(n, size) allocates memory for n elements of the given size and initializes all bytes to zero. calloc is slightly slower because of the zeroing but is convenient when you need zero-initialized memory.
How should I prepare for a C interview?
Master pointers and memory management, since C interviews center on them, and be ready to reason about memory layout and undefined behavior rather than just recite syntax. Practise explaining 'what does this print and why' out loud, ideally with a voice-based mock interview that follows up, because C rounds are explanation-heavy and verbal.