# SpaceX Embedded Software Engineer Interview Questions

Interview questions and coding challenges based on skills from public SpaceX job postings.

Not affiliated with or endorsed by SpaceX. SpaceX is a trademark of its owner, used here only to say which postings this page describes.

To ask for a change or removal: support@ohmwork.io

https://ohmwork.io/study-guides/for/spacex-embedded-software-engineer-interview-questions

Start practicing: [Roll Call](https://ohmwork.io/challenge/09-spi-whoami)

## From public job postings

- Firmware in C and C++ for microcontrollers: 5 of 5
- Bringing up and validating new hardware: 4 of 5
- Debugging and root cause analysis: 4 of 5
- Testing, verification and hardware in the loop: 5 of 5
- Fault tolerant, long running devices: 1 of 5
- Closed loop control and state estimation: 1 of 5
- Linux and embedded Linux: 3 of 5, not practiced here
- Networking protocols: 1 of 5, not practiced here
- Radio frequency fundamentals: 2 of 5, not practiced here

### Sources (5)

1. [Aerospace Software Engineer (Starfall)](https://job-boards.greenhouse.io/spacex/jobs/8939698002), Hawthorne, CA, checked November 28, 2026
2. [New Graduate Engineer, Software (Starfall)](https://job-boards.greenhouse.io/spacex/jobs/8854394002), Hawthorne, CA, checked November 28, 2026
3. [Embedded Software Engineer, Satellite Antenna (Starlink)](https://job-boards.greenhouse.io/spacex/jobs/8925605002), Redmond, WA, checked November 28, 2026
4. [Embedded Software Engineer (Starlink)](https://job-boards.greenhouse.io/spacex/jobs/8960569002), Hawthorne, CA, checked November 28, 2026
5. [GNC Engineer, Embedded Controls (Starlink)](https://job-boards.greenhouse.io/spacex/jobs/8784235002), Redmond, WA, checked November 28, 2026

## C and C++ on microcontrollers

5 of 5 jobs

### Which C++ features do teams limit on a small microcontroller, and why?

The ones with a hidden cost in size or timing. Exceptions and RTTI add tables and code, and a throw takes unpredictable time, so many firmware builds turn them off (`-fno-exceptions`, `-fno-rtti`). Allocating with `new` after start up risks fragmentation and a failure with no good recovery, so memory is usually allocated once at start up or held in fixed pools. Classes and templates cost nothing by themselves, but every template instance is more code, and a virtual call is an indirect call through a table. Constructors of global objects run before main(), in an order across files that C++ leaves unspecified.

### Signed integer math surprises people in firmware. Where?

Division rounds toward zero, so `-7 / 2` is -3 and `-7 % 2` is -1: code that splits a signed fixed point reading into whole and fraction parts gets the sign wrong between -1 and 0 unless it works from the magnitude. Signed overflow is undefined behavior, so the compiler may assume it never happens, while unsigned arithmetic wraps by definition, which is why tick counters are unsigned. Types smaller than `int`, such as `uint8_t`, are promoted to `int` before arithmetic, so subtracting two `uint8_t` values can give a negative `int`. The fixed width types from `stdint.h` keep each value's size independent of the compiler.

Practice it: [Readout](https://ohmwork.io/challenge/00-hello)

## Bring-up and validation

4 of 5 jobs

### You flash a new board and nothing happens. How do you tell a dead core from a stuck program?

Attach a debugger over SWD or JTAG and halt the core. If it will not connect, check power, reset, the boot pins and the debug wiring before the code. If it halts, read where it is: a program counter in the HardFault handler means a fault, and the fault status registers say which; a program counter in a loop polling a ready flag, such as an oscillator that never starts, points at that hardware; a program counter still in startup code means main() was never reached. Check too that the vector table and the linker script match the chip's memory map.

### How do you check a new peripheral driver during bring-up?

Start with something the device states about itself: read its ID register and compare it with the datasheet, which proves the wiring, the bus mode and the addressing before any configuration. Then check each write by reading the register back, and capture the bus with a logic analyzer to compare the waveform with the datasheet's timing diagram. Exercise the device at its limits, its fastest rate and its error cases, not only the normal path, and keep the checks as tests to run on every later board.

Practice it: [Roll Call](https://ohmwork.io/challenge/09-spi-whoami)

## Debugging and root cause

4 of 5 jobs

### A failure shows up once a week in testing. How do you find its cause?

Make the firmware record itself: keep a timestamped log of recent events in a RAM buffer that survives a reset, and save the fault registers and the stacked program counter when it fails. Then make the failure happen more often: raise data rates, add load, inject faults and shorten timeouts, to turn a week into minutes. Compare what the failing runs have in common, change one thing at a time, and keep going until the cause explains every symptom. The fix is done when the stress test that failed in minutes runs clean for many times that.

### The firmware ends up in the HardFault handler. How do you find out why?

On a Cortex-M3 or M4, a HardFault is often a bus, memory management or usage fault escalated because its own handler is off. On entry the core pushes R0 to R3, R12, LR, the return address and xPSR onto the active stack, and on a Cortex-M4F with floating point in use also S0 to S15 and FPSCR; the value in LR says which stack and which frame. The stacked return address points at the faulting instruction, or past it for an imprecise bus fault. The Configurable Fault Status Register says what kind of fault it was, and BFAR or MMFAR hold the faulting address when their valid bits are set. Common causes are a wild or null pointer, a stack overflow, an unaligned access the core does not allow, and a jump to an address without the Thumb bit set.

### Log lines from a busy board come out spliced together. What is happening?

Two pieces of code write to the same output at once, usually main and an interrupt handler, or two tasks. `printf` and most output paths keep a line in progress in shared state, so a second writer that cuts in mixes its text into the first. The fix is one writer: handlers and tasks record events into a queue or buffer, and one place formats and prints them. A lock around the console works between tasks, but never in an interrupt handler.

Practice it: [Crosstalk](https://ohmwork.io/challenge/128-crosstalk)

## Testing and hardware in the loop

5 of 5 jobs

### What does hardware in the loop testing catch that unit tests do not?

In hardware in the loop testing the real firmware runs on the real board while a rig simulates its sensors, actuators and physics in real time, closing the loop the way the device's surroundings would. Running the same firmware on a simulated board is the software form of the same idea. It catches what a host unit test cannot see: interrupt timing, peripheral setup, clocks, DMA, and how the parts behave together at real rates. Host unit tests still matter, since they run in seconds and pin down the logic, so they run on every change and the rig runs as often as it can.

### How do you unit test code that writes hardware registers?

Keep the logic apart from the register access. One way is a thin hardware layer of functions the tests replace. Another is to reach each peripheral through a pointer to a struct of its registers, so a test points it at a struct in ordinary RAM and checks what the code wrote. Either way the decisions run on the host in milliseconds, and only the thin layer needs the board or a simulator.

Practice it: [Floor Plan](https://ohmwork.io/challenge/109-floor-plan)

### How do you test what firmware does when a part fails?

Inject the failure on purpose: a sensor that stops answering, returns values out of range or glitches, a bus that hangs, a reply that arrives just after its timeout. For each, check that the firmware notices within its time limit, reports the fault, keeps the rest of the system working and recovers when the part does. Test each timeout just inside and just outside its limit, because an off by one error in a timeout shows only there.

Practice it: [Fallback](https://ohmwork.io/challenge/17-sensor-degraded-mode)

## Fault tolerance

1 of 5 jobs

### How does firmware keep a device running for years with no one to reset it?

Assume every part can fail and plan the way back. Bound every wait with a timeout, check inputs against what is physically possible, and give each fault a defined degraded mode. Run an independent watchdog: the STM32 IWDG runs from its own LSI clock and once started no software can stop it, so a hang ends in a reset unless something still feeds it. Record why each reset happened in memory that survives it, so the next report says, and hold outputs in a safe state until the code that drives them has started.

Practice it: [Night Watch](https://ohmwork.io/challenge/122-night-watch)

### How do you keep stored settings safe from a power loss or a flipped bit?

Store each record with a check value, such as a CRC, and keep two copies with a sequence number. Write a new record over the older copy, so a power loss mid write still leaves one good copy; at boot use the newest copy whose check passes, and fall back to defaults if neither does. In space, radiation can flip bits in memory, which is why flight hardware uses error correcting memory and why critical values are sometimes kept in three copies and read by majority vote.

### A task hangs, but the watchdog never resets the board. Why?

Something that still runs keeps feeding it: a timer interrupt, a high priority task, or a loop that feeds while it waits. A watchdog proves only that its feeder runs. Feed it from a point that runs only when the system does its job, for example a low priority task that feeds only after every monitored task has checked in since the last feed.

Practice it: [Kennel](https://ohmwork.io/challenge/37-kennel) PRO

## Control loops and estimation

1 of 5 jobs

### How do you turn a PI controller into code that runs on a timer?

Feedback comes first: measure, compare with the target and correct by the error every period. Run the loop at a fixed rate from a timer interrupt or a periodic task, with the period dt known. Each tick, read the measurement, compute the error, add the error times Ki times dt to the integral, and set the output to Kp times the error plus the integral, clamped to what the actuator can do. Stop adding to the integral while the output is clamped and the error pushes further into the limit, or it winds up and overshoots when the error reverses. On a Cortex-M4F use `float`, which its FPU computes in hardware, and write constants as `1.0f`; `double` runs in software there and is much slower.

Practice it: [Cruise](https://ohmwork.io/challenge/124-cruise)

### Why does a controller need a state estimate, and what does a Kalman filter add?

Sensors are noisy, delayed and partial: a gyroscope drifts, an accelerometer picks up vibration, and some states are not measured at all. An estimator combines a model's prediction of the state with each new measurement, weighting each by how far it can be trusted. A Kalman filter does this optimally for a linear system with Gaussian noise and tracks its own uncertainty; a complementary filter, high pass on the angle integrated from the gyroscope and low pass on the accelerometer's angle, is a simpler fixed version common on small microcontrollers.

## Also recommended

## Peripheral drivers and DMA

### How do you send a buffer to a UART by DMA, and how do you know it is done?

Select the stream's channel for the UART, give it the data register's address, the buffer's address and the byte count, set the direction to memory to peripheral, and increment the memory address but not the peripheral's. Then let the UART request bytes (on an STM32, the DMAT bit) and enable the stream. The transfer complete flag, or its interrupt, says the last byte has gone to the UART; for the line to have left the pin, also wait for the UART's transmission complete flag. Leave the buffer alone until then.

Practice it: [Conveyor](https://ohmwork.io/challenge/38-dma-uart-tx) PRO

### A UART DMA receive writes every byte to the same place. Why?

The memory increment is off, so each byte lands on the first address of the buffer and overwrites the one before. Check the rest of the setup the same way: the stream and channel the UART's request is wired to, the data width on both sides, the count, and whether circular mode is meant. The count register counts down, so the bytes received so far are the buffer size minus what it reads.

Practice it: [Intake](https://ohmwork.io/challenge/39-intake)

## Boot, reset and updates

### What state are a microcontroller's pins in during reset, and how do you take over pins a bootloader set up?

On an STM32F4 most pins come out of reset as floating inputs, apart from the debug pins, so an external pull resistor decides what a motor driver or a valve sees until firmware runs: choose it for the safe state. When a bootloader has already configured some pins, change only the fields of the pins you own, clearing your field's bits and then setting the new value, because a plain assignment to the register also rewrites every other pin's setting.

Practice it: [As Found](https://ohmwork.io/challenge/102-as-found)

### How do you update firmware in the field without bricking the device?

Never erase the only image that works. Keep two image slots, or a protected bootloader with a way back to a known good application. The bootloader checks the new image's integrity, and its signature when updates must be authenticated, before jumping to it. The new image counts as good only after it has started and passed its own checks; until then a reset or a watchdog bite returns to the previous image. Every step must survive a power loss at any moment.
