Embedded systems interview questions for robotics roles

The embedded interview questions Indian robotics employers ask: C fundamentals, interrupts, protocols, RTOS, power and debugging, with answer notes.

Reference
RE-1275
Published
Read
8 min

About the author · Sources, testing and AI policy

Engineer explaining a microcontroller board during a technical interview in a lab

Embedded interviews test whether you understand what the machine is doing, not whether you memorised definitions. The same twelve topics come up again and again, and most candidates lose marks on the follow-up question.

This is a working list of the questions Indian robotics and embedded employers actually ask freshers and one-to-three-year engineers, with the answer each question is really looking for and the follow-up that usually follows.

C and C++ fundamentals

What does volatile do? It tells the compiler that a variable can change outside the program’s control, so every read and write must actually happen. It is used for hardware registers and variables shared with an interrupt. It does not make an operation atomic, and it is not a substitute for a mutex.

What is the difference between static at file scope and inside a function? At file scope it gives internal linkage, so the symbol is invisible to other translation units. Inside a function it gives the variable a lifetime equal to the program and keeps a single copy across calls, while keeping the name local.

Why is sizeof a struct larger than the sum of its members? Alignment padding. A 32-bit member must sit on a four-byte boundary, so the compiler inserts gaps. Reordering members from largest to smallest usually reduces the size.

What is the difference between a const pointer and a pointer to const? A pointer to const cannot change the data it points at; a const pointer cannot change which address it holds. Reading the declaration from right to left resolves it.

Stack or heap on a microcontroller? Prefer the stack and static allocation. The heap fragments, its failure mode is late and hard to debug, and many safety standards discourage dynamic allocation after initialisation.

// set, clear, toggle, test - the four that come up most
reg |=  (1u << 3);   // set bit 3
reg &= ~(1u << 3);  // clear bit 3
reg ^=  (1u << 3);   // toggle bit 3
if (reg & (1u << 3)) { /* bit 3 is set */ }

Expect a follow-up: “write a function that sets bits n through m without touching the others.” They are checking masks and shifts, not cleverness.

Interrupts and timing

What are the rules for an ISR? Keep it short, do not block, do not call non-reentrant library functions, mark shared variables volatile, and defer heavy work to the main loop or a task. Clear the interrupt flag or the ISR will fire again immediately.

How do you debounce a button? Either sample it every few milliseconds and require several stable readings, or use a timer and a state machine. A delay inside an ISR is the wrong answer because it blocks everything else.

What is the difference between polling and interrupts? Polling checks a flag repeatedly and wastes cycles; interrupts respond to an event and add latency and concurrency risk. Polling is fine for slow, predictable inputs; interrupts suit fast or sporadic events.

How do you measure a pulse width? Capture the timer value on both edges, using input capture hardware, then subtract. Do the subtraction in a way that survives timer overflow by using unsigned arithmetic.

Communication protocols

QuestionKey points they want
How does I2C work?Two open-drain lines, pull-ups, 7-bit address plus read/write bit, acknowledge per byte, clock stretching
What causes I2C to hang?Bus stuck low, missing pull-ups, address conflict, a slave holding SDA, no timeout
What are SPI modes?CPOL and CPHA define clock idle level and sampling edge; both devices must match
How do you debug a UART link?Check baud, TX to RX crossover, common ground, framing settings, and look at the line with a scope
Where does RS-485 help?Differential signalling over long distances in noisy environments

A frequent trap: “your I2C sensor works alone but fails when the motor runs.” The expected answer mentions pull-up values, shared ground, cable length, noise coupling and a bus timeout with recovery.

Analogue and power

What limits ADC accuracy? Reference voltage stability, input impedance, sampling time, resolution, noise and grounding. A 12-bit ADC with a noisy reference is worse than a clean 10-bit one.

Why does the microcontroller reset when the motor starts? The motor draws a surge, the supply dips below the brownout threshold, or ground noise couples into the reset pin. Bulk capacitance, separate motor supply and a star ground are the standard answers.

How do you choose a buck converter? Input range, output current with margin, efficiency at the actual load, switching frequency, and thermal performance. Add input and output capacitors as the datasheet requires, not as an afterthought.

RTOS questions

What is priority inversion? A high-priority task waits for a resource held by a low-priority task, which is itself pre-empted by a medium-priority task, so the high-priority task waits far longer than expected. Mutexes with priority inheritance reduce the effect.

Mutex or semaphore? A mutex protects a shared resource and has an owner, so it supports priority inheritance. A semaphore signals events between tasks or from an ISR and has no owner.

Why must an ISR not call a blocking RTOS function? The ISR runs in interrupt context and cannot block. Use the interrupt-safe variants, such as those ending in FromISR, and defer the work to a task.

How do you keep a control loop at a fixed rate? Use a periodic delay until the next deadline rather than a delay after the work, so the execution time does not accumulate into drift.

Debugging questions

The board works on the bench but fails in the field. How do you investigate? Look for power quality, temperature, vibration, grounding, cable length, moisture and EMI. Reproduce the environment before changing code.

How do you find a firmware crash that happens once a day? Capture the reset reason, log a heartbeat and a task watermark, enable the watchdog, and use a debugger or trace. Do not add prints to an interrupt at high frequency; that changes the timing you are trying to observe.

When do you use a logic analyser instead of a scope? A logic analyser decodes protocols across many channels and long time windows. A scope shows analogue reality: ringing, slow edges, noise on a line.

How do you read a datasheet efficiently? Start with the absolute maximum ratings, then the pin description, then the timing diagrams for the interface you use, then the errata. The errata sheet is where projects are saved.

Robotics-specific questions

How do you control motor speed? PWM into a driver, with a current or speed loop around it. Explain the difference between open-loop voltage control, closed-loop speed with an encoder, and closed-loop torque or current control.

What does a PID controller do? Proportional responds to present error, integral removes steady-state offset, derivative damps overshoot. In practice you add filtering, output limits and anti-windup on the integral term.

Why does a robot drift even with encoders? Wheel slip, unequal wheel diameter, encoder resolution, and an unmodelled bias. Odometry alone always drifts; an absolute reference such as a lidar or marker corrects it.

How would you stop a robot safely if the controller hangs? Do not rely on software. Use a hardware watchdog, a safety relay or contactor, and a circuit that removes drive power when a heartbeat stops or an E-stop is pressed.

How do you choose between a microcontroller and a Linux computer? Hard real-time control and low power favour a microcontroller. Vision, planning and networking favour Linux. Many robots use both and split the work.

How to answer when you do not know

Interviewers expect gaps. What they mark is how you handle them. Say what you do know, state the assumption you would test, and describe how you would find the answer: datasheet, scope, minimal test program, or a colleague.

Never invent a register name or a timing figure. A wrong confident answer is worse than “I would check the datasheet, and my guess is X because Y.”

A short preparation plan

  • Rewrite your project bullets as problems you solved, with one number each.
  • Be able to draw the block diagram of your project from memory.
  • Revise bit manipulation, volatile, pointers and struct padding.
  • Revise the four protocols and what breaks them.
  • Prepare one debugging story with a real fault and a real fix.
  • Prepare one failure story where you were wrong and changed approach.
  • Know the current rating, voltage and interface of every part on your board.

Related: robotics engineer interview questions, robotics resume for freshers, robotics jobs for freshers, embedded systems career in India, ESP32 FreeRTOS.

What topics are asked most in embedded interviews in India?

C fundamentals such as volatile, pointers and bit manipulation; interrupts and debouncing; I2C, SPI and UART; ADC and power; RTOS concepts; and debugging a real fault. Robotics roles add motor control, PID and odometry.

Do freshers need RTOS experience?

It helps for firmware roles but is rarely mandatory. Understanding tasks, queues, mutexes and priority inversion is enough to answer well, and one project using FreeRTOS makes it credible.

How do I answer a question I do not know?

Say what you do know, state your assumption, and describe how you would verify it. Interviewers mark reasoning and honesty, not omniscience.

Is C or C++ more important for embedded roles?

C remains the core for microcontrollers. C++ is increasingly expected for larger firmware and robotics software, especially with ROS 2. Learn C thoroughly first.

How long should I prepare for an embedded interview?

Two to three weeks of focused revision is usually enough if you already have a project. Spend most of it on your own project and the fundamentals, not on trivia.

Firmware questions are only half the interview; see the mechanical design questions too.

Interview questions follow the projects you list, so read the internship guide before the interview.

Sources and further reading

Pass it onWhatsAppLinkedIn

Keep reading

Continue learning

The Build Note

One short email when something is worth your bench time.

A new build sheet, a part price that moved, or a mistake worth avoiding. No daily drip, no recycled news.

One short email when a build or a price is worth your time. Unsubscribe in one click.