Anything with an unbounded or unpredictable worst-case time is the enemy. Dynamic memory allocation: malloc/free timing varies with heap state and fragmentation can fail unpredictably, so hard real-time uses static or pool allocation instead. Unbounded or data-dependent loops: if a loop's iteration count depends on input with no fixed cap, it has no WCET, you bound everything. Priority inversion: unbounded blocking on a shared resource, fixed with priority-inheriting mutexes and short critical sections. Long interrupt-disabled windows or large critical sections: they delay high-priority work, so you keep them short and bounded. Hardware timing variability: caches, branch prediction, and deep pipelines make the same code take different times depending on machine state, which is why hard real-time often favors simpler, more predictable cores or disables/locks caches on critical paths. Garbage collection: unpredictable GC pauses make most managed languages unsuitable for hard deadlines. And hidden offenders on the critical path: logging, flash writes, network stack processing, DVFS frequency changes, and contention all add jitter. The avoidance strategy is consistent: keep the hard-real-time path free of unbounded operations, prefer static allocation, bound every loop and critical section, use priority inheritance, account for interference in schedulability analysis, and leave CPU margin so jitter doesn't push you over a deadline. The throughline is "make the worst case knowable and bounded," which is exactly what determinism means.
RTOS & Real-Time Concepts · Interview question
What kinds of things destroy determinism, and how do you avoid them?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
Hard vs Soft Real-Time
Real-time is about meeting deadlines deterministically, not being fast: hard vs firm vs soft by the cost of a miss, worst-case execution time, schedulability, and what destroys determinism.