Firmware interviews in the AI era: what is changing and how to prepare
Assistants now write a working ring buffer, a CRC or a state machine in seconds. That changes what an interviewer learns by watching you type one. Many teams are adjusting, though not all in the same way, and no company's policy is universal. This article describes the direction of the change as a reasoned expectation, not as measured data, and it is honest about what you should confirm for each interview.
What probably stays the same
Fundamentals are still examined: pointers, bit operations, volatile, interrupts, memory layout, and why a structure costs what it costs. If you cannot say why a ring buffer needs one empty slot, you cannot tell whether a generated one is right. Tools raise the value of that knowledge rather than replacing it.
What probably shifts
Producing code is cheaper. Judging it is not. Expect more questions of the form "here is code, what is wrong with it?", more discussion of how you would test it, and more weight on explaining your reasoning aloud. The scarce skill is telling a correct answer from a plausible one.
Plausible code fails in a small set of places in firmware:
- Shared with an interrupt: a read-modify-write that an ISR can interrupt, or an index that is not wrapped.
- Edge inputs: zero, the maximum, exactly the capacity, a huge length.
- Undefined behaviour: shifting by the type's width, signed overflow, writing past the end.
- Hardware that is not memory: write-1-to-clear flags, read-to-clear status registers, DMA data behind a cache.
Learning this for work or an interview? Lessons 1 and 2 of DSA for Firmware are free, with labs and C exercises. Start Lesson 1
A bug hunt you can run
Here is the kind of code an assistant produces quickly. It reads fine and passes a short test. Its full check is below it.
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#define NSLOT 8
typedef struct { uint8_t slot[16]; unsigned in, out; } fifo_t; /* 16 bytes so the demo can show the overrun safely */
/* reads fine: NSLOT slots, one kept empty so "full" and "empty" differ */
static bool put_bad(fifo_t *f, uint8_t x)
{
if (f->in + 1 == f->out) return false;
f->slot[f->in] = x;
f->in++;
return true;
}
static bool put_ok(fifo_t *f, uint8_t x)
{
unsigned nx = (f->in + 1) % NSLOT;
if (nx == f->out) return false;
f->slot[f->in] = x;
f->in = nx;
return true;
}
/* keep pushing into an empty fifo until it says full (or we stop at 12) */
static int accepted(bool (*put)(fifo_t *, uint8_t), unsigned *write_index)
{
fifo_t f = { {0}, 0, 0 };
int n = 0;
while (n < 12 && put(&f, (uint8_t)n)) n++;
*write_index = f.in;
return n;
}
int main(void)
{
unsigned ib, io;
int nb = accepted(put_bad, &ib), no = accepted(put_ok, &io);
printf("short test, 3 pushes: both fine\n");
printf("pushes accepted before full: bad=%d ok=%d (a correct 8-slot ring accepts 7)\n", nb, no);
printf("next write index: bad=%u (past slot %d!) ok=%u\n", ib, NSLOT - 1, io);
return 0;
}
short test, 3 pushes: both fine pushes accepted before full: bad=12 ok=7 (a correct 8-slot ring accepts 7) next write index: bad=12 (past slot 7!) ok=7
Compiled with -Wall -Wextra -Werror and run under AddressSanitizer + UBSan.
The first version never reports full when the head is at the end and the tail at the start, because it compares the next index without wrapping it, so the write position runs off the end of the array. The demo above uses a 16-byte array only so that overrun can be printed instead of crashing. The three-push test cannot see that. The test that finds it pushes more times than the ring has slots. That is the habit to show in an interview: before trusting the code, decide which input would break it.
How to say it
A short structure works for any bug: symptom, cause, fix, proof. For the example: the ring accepts too many bytes (symptom); the full check does not wrap the index (cause); take the next index modulo the ring size and use that one value for both the check and the store (fix); push more than eight bytes and confirm the count is seven and the order holds (proof). Practise saying it in under a minute.
Preparing without knowing the rules
- Ask the recruiter whether tools are allowed, and which. Policies vary and change.
- If tools are allowed, ask for the failure cases and the invariants, not only the function, and then check the answer yourself. Do not accept a confident explanation of how a register works; confirm it in the manual.
- If tools are not allowed, the same review habit shows up as checking your own code out loud.
- Practise on your own code: run it under the AddressSanitizer and UndefinedBehaviorSanitizer with zero, maximum and capacity inputs.
- Admit gaps openly, then describe how you would close them. Reviewers trust that more than a smooth guess about hardware.
For a list of core questions to rehearse, see firmware interview questions with answers, and for what to study first, what to learn and in what order.
The course covers this in a lesson on reviewing code you did not write, with exercises where each function has a hidden bug and tests that fail until you find it. Start with lesson 1.
DSA for Firmware teaches it one real bug at a time.
- 28 lessons, each starting from a real firmware bug.
- 110 C exercises with tests, and a reference solution for every one.
- Lessons 1 and 2 are free. No sign-up.