The C (Intermediate) test is for people who write C beyond exercises: systems and embedded code, a university course in operating systems or compilers, or interviews for roles where C is the working language. It assumes the basics are settled and asks what happens at the edges — when a pointer is passed by value, when realloc moves a block, when a macro expands into something its author did not mean, and when the standard stops promising anything at all.
The paper is multiple-choice questions, then coding problems answered in C. Most questions show a short, complete program and ask exactly what it prints. Others show a fragment and ask what is wrong with it, whether it compiles, or which of several statements the standard guarantees; a few ask you to select every correct option. Programs assume C17 on a 64-bit Linux system, and any question that depends on sizes or struct layout names the model it uses.
What each topic examines
The questions are spread across twelve topics, and your result breaks the score down by them.
- Types and basics. The usual arithmetic conversions when signed meets unsigned, the promotion of small integer types before arithmetic, what
sizeofmeasures, comparing floating-point values, and whatvolatiledoes and does not promise. - Operators and control flow. Truncating division and the sign of
%, short-circuit evaluation with side effects, the comma operator, precedence traps such as&against==, andswitchfall-through. - Functions. Function pointers and tables of them,
qsortcomparators that are correct for every input, variadic functions withstdarg.h, reading declarations that mix pointers and functions, and what C leaves open about argument evaluation. - Arrays. When an array decays to a pointer and when it does not, array parameters, designated initialisers, pointer arithmetic on
aand on&a, and passing two-dimensional arrays. Array problems and matrix problems solved in C are good practice. - Strings. What
strncpy,snprintf,strchrandstrrchractually do, sizing a buffer with room for its terminator, and why plaincharis a poor type for raw bytes. Work through string problems without a string class to lean on. - Pointers. Pointers to pointers,
conston either side of the*,*p++and its relatives,void *, and walking NULL-terminated arrays of pointers. A linked list written in C exercises most of it. - Dynamic memory.
malloc,calloc,reallocandfree, how each one fails, growing a buffer by doubling,memmoveagainstmemcpy, and what byte-wise functions do to an array ofint. - Structs, unions and enums. Padding and alignment, what
offsetofdoes and does not guarantee, what struct assignment copies, bit-fields, unions and enumeration constants. - Scope and storage classes.
staticlocals, shadowing,externdeclarations against definitions, internal and external linkage across files, and which objects start at zero. - The preprocessor. Parenthesising macros, arguments evaluated twice, the
#and##operators, X-macros, include guards and conditional compilation. - Bitwise operations. Setting, clearing, toggling and testing bits, isolating the lowest set bit, power-of-two checks, extracting bytes and which shifts are undefined. The bit manipulation lesson and its practice problems cover the idioms.
- Undefined behaviour. Recognising it — signed overflow, unsequenced side effects, dangling pointers, type punning through casts, pointers past the end of an array — and knowing what an optimising compiler may do once it is there.
How to prepare
Write and run small programs rather than only reading rules. When you are unsure what an expression does, predict the output, then compile it with warnings on (-Wall -Wextra) and compare. Build the same programs with -fsanitize=address,undefined: the sanitizers report out-of-bounds access, use after free and signed overflow at the line where they happen, and seeing a report for code you believed was fine is the fastest way to learn where the edges are.
Learn the contracts of the library functions you use, not just their names. For each function in string.h and stdlib.h, know what it returns on failure, whether it always writes a terminator, what its return value counts, and whether it allows its source and destination to overlap. Most memory and string questions come down to one of those four facts.
Practise reading declarations from the name outwards until a pointer to a function returning a pointer reads as easily as an int. Do the same with macros: expand them by hand, textually, before deciding what they compute.
For output prediction in general, the Programming Fundamentals questions include C programs to trace. For the coding section, solve a few sorting problems in C with qsort and your own comparator, and time yourself, since there is no library container to fall back on.
What trips people up
Mixing signed and unsigned. A size_t loop counter that counts down, or a comparison between an int and an unsigned, silently changes meaning. Know which operand converts to which type, and when.
"It worked when I ran it." Undefined behaviour often produces the answer you expected, until the optimisation level, the compiler or the input changes. The test asks what the standard says, so a program that happens to print something on one machine is not the same as one that is defined to print it.
Trusting a function's name. strncpy is not a safe strcpy, realloc is not guaranteed to grow a block in place, and memset does not set elements. Each does exactly what its specification says and no more.
Assuming one platform. Plain char is signed on x86 and unsigned on ARM Linux, long is 8 bytes on 64-bit Linux and 4 on 64-bit Windows, and struct padding follows the ABI. Questions that depend on such a choice name it; your own code should not depend on it at all.
C++ habits. C and C++ share a syntax but not every rule. If you mostly write C++, read up on where they part ways, especially around initialisation, implicit conversions and sequencing.
How it differs from C (Basic)
C (Basic) checks the language a few months of use teaches: types, operators, loops, functions, arrays, simple strings and single pointers, read in short programs. Intermediate takes those as given. Its pointer questions are about pointers to pointers and const, its string questions about the library's exact contracts, and it adds what Basic leaves out — managing memory, struct layout, linkage across files, the preprocessor, bit manipulation and undefined behaviour. If you are deciding between languages rather than levels, C++ (Intermediate) covers the same ground with the C++ object model and library on top; all skill tests are listed on one page.