Problem Statement
What distinguishes a real-time operating system (RTOS) from a general-purpose operating system, and what are the trade-offs?
Explanation
A real-time operating system is designed to guarantee that tasks meet timing constraints (deadlines), not just logical correctness. In a hard RTOS missing a deadline is a failure. It typically offers deterministic scheduling, minimal latency, priority inversion protection, and often supports preemption of nearly any code. The trade-offs are that RTOS may sacrifice throughput or flexibility for predictability, may use static memory and simpler APIs, and often run fewer services. For interview answers mention examples (embedded systems, autopilot, medical devices) and contrast with general-purpose OS which target max utilisation, flexibility and feature-richness.
