InterviewStack.io LogoInterviewStack.io

Real-Time Constraints and Interrupt Handling Questions

Meeting timing guarantees in embedded firmware through interrupts, timers, and deterministic scheduling. Covers interrupt service routines, priorities, latency, jitter, and reasoning about hard versus soft real-time requirements. Focuses on the hardware-timing side of real-time behavior rather than general OS scheduling theory.

HardTechnical
66 practiced

A field issue appears where enabling compiler optimizations (-O2) causes sporadic failures in code interacting with an ISR. Describe the step-by-step debugging process to identify whether this is due to reordering, missing volatile, inline expansion, or register allocation. Provide fixes and coding rules to prevent similar problems.

MediumTechnical
67 practiced

Write a small C ISR for a microcontroller that signals an RTOS task to process data. Use FreeRTOS conventions (assume FreeRTOS API is available). The ISR should: 1) clear the peripheral interrupt flag, 2) push a pointer to a buffer into a queue, and 3) request a context switch if a higher-priority task was woken. Show only the ISR function body and required variables/types.

EasyTechnical
76 practiced

Explain the role of the C keyword 'volatile' in code that interacts with interrupts. What guarantees does volatile provide and what guarantees does it not provide? Give an example of a bug that volatile alone cannot fix.

MediumTechnical
75 practiced

Explain ARM Cortex-M NVIC concepts: vector table, priority grouping (PRIGROUP), tail-chaining, and late-arrival. How do tail-chaining and late-arrival behavior improve interrupt handling efficiency? Give a short example sequence where tail-chaining reduces overhead.

HardTechnical
57 practiced

On ARM Cortex-M, write (annotated) assembly snippets or describe the sequence for a manual ISR prologue and epilogue when using separate Process Stack Pointer (PSP) for tasks and Main Stack Pointer (MSP) for exceptions. Explain how stacking of R0-R3, R12, LR, PC, xPSR is handled and how to restore the task context during a PendSV-based context switch.

Unlock Full Question Bank

Get access to all 48 Real-Time Constraints and Interrupt Handling interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.