Skip to content
RED SAGSkills
mediumEmbedded Systems Engineer interview question

Design firmware that receives text commands over UART, like "SET LED 1", and responds reliably.

What the interviewer wants to hear

  • ISR or DMA pushes bytes into a ring buffer
  • A task or main loop assembles lines and parses them
  • Bounded line length and input validation
  • Command table mapping names to handler functions
  • Error responses, timeouts and overflow handling

Model answer

I keep the interrupt side minimal: the UART receive ISR, or DMA with idle-line detection, pushes bytes into a ring buffer and maybe signals a task. A parser task or the main loop pulls bytes and builds a line in a fixed-size buffer until it sees a newline. If the line gets too long I discard it and report an error, so a bad sender cannot overflow memory. I then split the line into tokens and look up the first token in a constant table of command names and handler functions, which keeps parsing clean and easy to extend. Each handler validates its arguments, like range-checking the LED number, and returns OK or a clear error code. I also handle ring buffer overflow by counting dropped bytes, add a timeout for partial lines, and write host unit tests for the parser with good and malformed input.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Embedded Systems Engineer questions