Interview Q&A · C

C Interview Questions & Answers

All 202 C interview questions — fundamentals, types, functions, pointers, memory, arrays and strings, structs, the preprocessor and build model, file I/O, advanced idioms, processes and threads, plus coding tasks — with correct, up-to-date answers. This bank holds 202 questions across 19 topics and 13 topic groups. Every answer is written for current C versions, and each topic links to matching course lessons where they exist.

202 questions answered19 topics13 topic groups
Pick a topic

Every topic below links to its own page with all of its questions in one place.

Read the answer

Answers are checked against current language behaviour; old-guide claims are corrected.

Jump both ways

Each topic points to the matching course lesson, and lessons point back here.

C Fundamentals

16 questions across 2 topics — What C is, how source becomes a binary, standards and the program lifecycle.

Data Types & Operators

18 questions across 2 topics — Sizes, signedness, promotions, const/volatile/static and control-flow traps.

Functions & Storage

18 questions across 2 topics — Prototypes, pass-by-value, recursion, scope, linkage and storage duration.

Pointers Deep Dive

12 questions across 1 topic — Addresses, arithmetic, const positions, double pointers and dangling bugs.

Dynamic Memory

12 questions across 1 topic — malloc/calloc/realloc/free, heap bugs, layout and leak-free discipline.

Arrays & Strings

20 questions across 2 topics — Decay, sizeof traps, multidimensional layout and safe string handling.

Structs, Unions & Enums

12 questions across 1 topic — Layout and padding, unions, bit-fields, enums and opaque pointers.

Preprocessor & Build

12 questions across 1 topic — Safe macros, headers, linkage, libraries and faster builds.

File I/O, Errors & CLI

12 questions across 1 topic — Robust file handling, errno discipline, getopt and crash-safe writes.

Advanced C Idioms

14 questions across 1 topic — restrict, function pointers, qsort, generic containers and portable C.

Processes & Threads

12 questions across 1 topic — fork/exec, pthreads, data races, mutexes, condvars and atomics.

Tricky Outputs & Coding Tasks

24 questions across 2 topics — Prediction gotchas plus implement-it-now favorites in idiomatic C.

Scenarios & Rapid Fire

20 questions across 2 topics — Judgment calls from real desks, plus one-line revision for the night before.

Recommended resourcesAffiliate links · may earn us a commission

Classic DSA interview booksThe reference books interviewers themselves learned from — great next to the visualizers.See the books Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits