C++ CPE study materials
C++ CPE study resources

C++ CPE case studies

C++ CPE · Put your knowledge to work in context.

The CPE – C++ Certified Entry-Level Programmer is an entry-level credential offered by the C++ Institute, an independent certification body. It sits at the start of the C++ track, above no prerequisite and below the CPA (Associate) and CPP (Professional) levels. The C++ CPE case studies are 5 cases and about 3,748 words.

1

Signed Char, Negative Index: A Checksum That Only Fails on x86

A firmware team ships a telemetry gateway that validates every incoming frame with an 8-bit table-driven checksum. Frames are 64 bytes, and the gateway handles about 1,200 frames per hour.

796 words, about 4 min
2

A 32-Byte Header That Copies 8: Array Decay and Wire Structs

A logger writes records to a socket using a 32-byte header. Two functions are involved: On the sending side sizeof(RecHeader) is 8, and the code writes the struct directly with write(sock, &h, sizeof h) before filling length and flags in host byte order.

767 words, about 4 min
3

Macros That Evaluate Twice: Radius Area and Retry Counter

A legacy geometry module has been in production for nine years. Two macros are used across 40 source files: A new feature lets operators enter a radius as base + offset ; the UI passes the expression r + 1 directly to AREA , and reports circle areas that are far too small whenever offset is nonzero, while values entered as a single number are correct.

763 words, about 4 min
4

Double Free at Shutdown: Rule of Three in a Packet Queue

A message bus library defines: Applications build a std::vector<Packet outbox , push temporary packets, and occasionally pass a Packet by value to logPacket(Packet p) . A service that handles about 500 packets per minute has run for months.

713 words, about 4 min
5

The Sort That Crashes at 40 Jobs: Strict Weak Ordering

A scheduling service keeps a std::vector<Job where: Jobs are sorted with: Unit tests with 12 jobs and distinct priorities pass on every platform. In staging, 40 jobs are loaded, six pairs share a priority, and the service segfaults inside std::sort ; the backtrace lands in std:: insertion sort on libstdc++ and in std:: sort5 on libc++.

709 words, about 4 min