The C (Basic) test is for anyone who has written C for a few months, whether in a first programming course, for embedded work or to prepare for interviews where C is the expected language, and wants a credential that says they read it accurately. It is built around one skill: looking at a short program and saying exactly what it prints, or whether it has a defined meaning at all. C rewards that precision more than most languages, because so much of its behaviour comes from rules the code does not spell out: integer promotion, the order in which operators bind, the difference between an array and a pointer, and what the standard leaves undefined.
The paper has multiple-choice questions, then a coding problem. Many questions show a complete program and ask what it prints; others ask which lines compile, which expression does a job, or what the standard says about a piece of code. A few ask you to select every correct option, and only the exact set scores.
What each topic examines
- Types and basics. Sizes on a 64-bit system and which type a value needs, integer division and
%with negative operands, integer promotion and the usual arithmetic conversions (including what happens when a signed value meets an unsigned one), octal and hexadecimal constants, and matchingprintfconversions such as%d,%u,%ld,%zuand%fto their arguments. - Operators and control flow. Precedence and associativity (
&,^and|bind more loosely than==), short-circuit evaluation with&&and||, an assignment where a comparison was meant,switchfall-through, andbreakagainstcontinue. - Functions and recursion. Call by value, why a function given an array can still change its elements, how a prototype converts the arguments, and tracing a recursive call to its result. The recursion lesson and the recursion problems are good practice.
- Arrays. Initialisation (elements without a value are zero), indexing and its bounds,
sizeofon an array againstsizeofon a parameter declared as one, and two-dimensional arrays stored row by row. The arrays lesson covers the patterns. - Strings. A string is a
chararray that ends in'\0':strlenagainstsizeof, comparing withstrcmprather than==, exactly whatstrcpyandstrcatwrite, and why a string literal must never be modified. - Pointers.
&and*, pointer arithmetic over an array (it counts elements, not bytes), what*p++increments, the difference of two pointers, and readingconstin a declaration. - Dynamic memory.
malloc,callocandfree, sizing a request withsizeof, how long a block lives, and what a leak looks like. - Structs and enums. Member access with
.and->, structs copied by assignment and when passed by value, designated initializers, and how enumerators get their values. - Scope and storage classes. Block scope and shadowing,
staticlocals that keep their value between calls, which variables are guaranteed to start at zero, and whatexternand a file-scopestaticmean. - The preprocessor. Object-like and function-like
#defines and why their parameters need parentheses, conditional compilation with#ifand#ifdef, include guards, and#includewith quotes or angle brackets. - Bitwise operations.
&,|,^,~and the shifts on unsigned values, and setting, clearing, toggling and testing a single bit. The bit manipulation lesson and its problems use the same tricks. - Undefined behaviour. Recognising the common cases, and telling them apart from code that is merely surprising but well defined, such as unsigned arithmetic wrapping round.
How to prepare
Write small programs and predict their output before you run them. When the prediction is wrong, find the rule that explains the difference instead of moving on: that habit is what the questions measure. Compile with warnings switched on (-Wall -Wextra with GCC or Clang) and read every warning, because many of the traps here, such as an assignment inside a condition or a comparison between signed and unsigned values, are exactly what those warnings report.
The Programming Fundamentals MCQs drill the same kind of reasoning about types, operators and control flow, and the pseudocode questions practise tracing a program by hand. For the coding problem, solve a few easy problems in C from the arrays and strings hubs. Get used to passing an array together with its length, ending every string you build with a terminator, and keeping each index inside the array.
What trips people up
- Treating
sizeofas a length. It is a size in bytes, worked out from the type at compile time. On a pointer, including an array parameter, it is the size of the pointer. - Expecting floor division. C rounds integer division toward zero, so
-9 / 4is -2 and-9 % 4is -1. Python gives -3 and 3. - Forgetting the terminator. Every string function looks for
'\0'. An array that holds the letters but not the terminator is not a string, and passing it tostrlenorprintf("%s")reads past its end. - Reading undefined as "unpredictable". Undefined behaviour does not mean the program prints some random number. It means the standard places no requirement on the program at all, so a question about it is answered by recognising it, not by guessing an output.
- Leaning on what one machine does. Whether plain
charis signed, the order in which function arguments are evaluated, and the exact size oflongdiffer between platforms. The test states its assumptions, and good C does not depend on the rest.
What changes at Intermediate
The C (Intermediate) test assumes everything here and goes further: pointers to pointers and function pointers, the mistakes dynamic memory invites, unions, linkage across several source files, the pitfalls of macros, and library functions such as qsort, with a harder coding round. If this paper's questions feel routine, that is the one to take next.