InterviewStack.io LogoInterviewStack.io

Real-Time Systems, RTOS Scheduling & WCET Questions

Building systems with timing guarantees: hard vs. soft real-time, RTOS task scheduling (rate-monotonic, earliest-deadline-first), priorities and preemption, and jitter. Covers worst-case execution time analysis, schedulability, meeting deadlines deterministically, and the concurrency patterns used in real-time and control software.

MediumTechnical
100 practiced

In C, implement a compact ring buffer API suitable for an embedded RTOS where producers may run in ISR context and consumers run in task context. The ring buffer stores uint8_t values. Provide the struct definition and implementations for:

  • bool rb_push_from_isr(ringbuf_t *rb, uint8_t b);
  • bool rb_pop_blocking(ringbuf_t *rb, uint8_t *b, TickType_t timeout);
    Constraints: producer runs in ISR and must not call blocking RTOS APIs; consumer may block; avoid dynamic allocation; target single-core Cortex-M; assume 32-bit atomic read/write for indices. Also briefly explain why your approach is safe.
HardTechnical
97 practiced

Outline how you would model a small real-time scheduling problem using timed automata (e.g., UPPAAL) to prove that deadlines are never missed. Explain which elements to abstract (tasks, interrupts, resource locks), how to model timing constraints and priorities, and strategies to manage state-space explosion.

HardSystem Design
105 practiced

Design a multicore scheduling and resource-management approach for an automotive ECU on a 4-core ARM SoC. Requirements: multiple hard real-time control loops at 1 ms and 5 ms, simultaneous logging/diagnostics tasks, and occasional non-critical ML inference jobs. Explain core assignment, scheduling policy, handling of shared buses and memory bandwidth, interrupt routing, and certification-related considerations.

MediumTechnical
96 practiced

Discuss the differences between fixed-priority preemptive scheduling and dynamic-priority EDF (Earliest Deadline First) on a single-core embedded system. Compare schedulability in overload conditions, implementation complexity, support for aperiodic tasks, and suitability for hard real-time deadlines.

EasyTechnical
73 practiced

List the rules for ISR interaction with an RTOS kernel on a microcontroller. Explain why blocking kernel calls, heap allocation, and long-running computation are problematic inside ISRs, and describe safe patterns to defer work to tasks including examples (deferred queue, task notification, software timer).

Unlock Full Question Bank

Get access to all Real-Time Systems, RTOS Scheduling & WCET interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.