Real-Time Constraints and Interrupt Handling Questions

Interrupts and hard timing in embedded firmware. Covers the interrupt mechanism (vector tables and their relocation, interrupt controllers such as the Cortex-M NVIC, GIC, APIC and PIC, priorities, nesting and its stack cost, tail-chaining, NMIs, and Cortex-M exception and fault handling, including decoding the stacked registers after a HardFault, capturing crash diagnostics across a reset, and MemManage and BusFault handling with the MPU), writing short and re-entrant interrupt service routines, deferring work out of the ISR (including RTOS ISR-safe APIs and priority-aware deferred queues), sharing data between ISRs and main code (volatile, masking, critical sections, and ISR-safe ring buffers), hardware timers for periodic events, and measuring and bounding interrupt latency and jitter. Includes polling versus interrupt-driven I/O, interrupt storms, DMA with interrupt thresholds for sustained data streams, and multicore interrupt routing. Excludes RTOS scheduling theory and schedulability analysis, general concurrency primitives and lock-free algorithms, serial-bus or peripheral driver protocols, and general-purpose OS interrupt handling such as kernel softirqs and bottom halves.

MediumTechnical
56 practiced

A noisy sensor line floods the CPU with interrupts, the main loop starves and the watchdog resets the device. How do you confirm it is an interrupt storm, stop the damage, and prevent a repeat?

HardSystem Design
80 practiced

An embedded system has a sensor ISR that must respond within 50 microseconds, a comms ISR with a 200 microsecond budget, and low-priority housekeeping interrupts, with nesting allowed. Lay out your priority assignment, masking approach and worst-case nesting depth, and say where long work goes.

HardTechnical
69 practiced

Technical deep-dive: Describe how tail-chaining and lazy stacking (floating-point stacking) interact on an ARM Cortex-M with FPU enabled. What hazards exist when an ISR that uses FP registers preempts another FP-using context, and how can you mitigate stack and latency costs while preserving correctness?

EasyTechnical
76 practiced

Explain the difference between a hardware interrupt and an exception (fault) on a CPU such as ARM Cortex-M. Give examples of exceptions and describe how their handling and semantics differ from asynchronous external interrupts.

HardTechnical
55 practiced

An ISR frees a buffer back to a custom pool and nulls the pointer, while the main task checks the pointer and then processes the buffer. Interrupts cannot be disabled for long. What can go wrong, and how would you redesign ownership of the buffer so it is safe?

c
volatile uint8_t* buf;
void ISR_free(void) { pool_free(buf); buf = NULL; }
void main_task(void) { if (buf) process(buf); }

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.