← Back to blog

C programming interview questions and answers

C programming interview questions and answers — cover from Greenroom, the AI mock interviewer

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)

Memory management

C interview topics — pointers, memory, storage classes, arrays
C interviews live and die on pointers and memory — know them cold.

Storage classes & keywords

Classic gotchas

The core truth: C interviews are pointer-and-memory interviews. The candidate who can draw the memory layout and explain exactly what a pointer holds — not just recite syntax — passes every time.

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.

C interviews reward reasoning about pointers and memory out loud. Greenroom runs spoken technical interviews that follow up on your reasoning. Free to start.