Frequently Asked RTOS Interview Questions and Answers
Frequently Asked RTOS Interview Questions and Answers
com/in/uttam-basu/
Frequently
Asked RTOS
Interview
Questions and
Answers
Linkedin
Owner UttamBasu
Linkedin www.linkedin.com/in/uttam-basu/
Type - Short
1. What is an RTOS?
An RTOS (Real-Time Operating System) is designed to process data and respond within a
strict time constraint, making it predictable and reliable for embedded applications.
2. Explain hard and soft real-time systems.
Hard real-time systems must meet deadlines strictly. Soft real-time systems allow occasional
deadline misses.
3. What is task scheduling?
It is the mechanism by which an RTOS decides which task to run next, based on priorities or
other criteria.
4. What is preemptive scheduling?
In preemptive scheduling, a higher-priority task can interrupt a lower-priority task to ensure
timely execution.
5. What is cooperative scheduling?
Tasks voluntarily yield control, so the system depends on tasks behaving correctly.
6. What is a context switch?
The process of saving the state of one task and loading the state of another.
7. What is a semaphore?
A signaling mechanism used for synchronization between tasks.
8. Types of semaphores?
Binary semaphore and counting semaphore.
9. What is a mutex?
A mutual exclusion object that allows only one task to access a resource at a time.
10. Difference between semaphore and mutex?
Mutex has ownership and is used for mutual exclusion; semaphore is for signaling and
synchronization.
11. What is priority inversion?
A lower-priority task holding a resource blocks a higher-priority task.
12. How to prevent priority inversion?
Using priority inheritance protocols.
13. What is deadlock?
A situation where two or more tasks wait indefinitely for each other's resources.
14. What is starvation?
A task waits indefinitely due to being continuously preempted by higher-priority tasks.
15. What is a task or thread?
A basic unit of execution in an RTOS.
16. What are task states in RTOS?
Ready, Running, Blocked, Suspended.
17. What is inter-task communication (ITC)?
Mechanisms like message queues, semaphores, mailboxes used for data exchange.
18. What is a mailbox?
A method to send messages between tasks.
105. Explain the difference between scheduling latency and interrupt latency.
Scheduling latency is the time to switch tasks; interrupt latency is the time from interrupt to
ISR execution.
106. What is the minimum stack size per thread?
It depends on the function calls and local variables used; estimated during design/testing.
107. What is a tick interrupt?
A timer interrupt that triggers the RTOS scheduler at fixed intervals.
108. What is a dormant task?
A task that has been created but is not ready, running, or waiting — essentially idle or
terminated.
109. What is a lightweight RTOS?
An RTOS designed for minimal footprint and low-power devices, such as FreeRTOS.
110. What is a non-preemptible section?
A code section where preemption is disabled to protect shared resources.
111. What is a cyclic executive system?
A non-RTOS method where tasks are called in a fixed sequence, often in time slots.
112. What is cooperative scheduling’s biggest risk?
A task may hog CPU time, causing missed deadlines.
113. How do you profile an RTOS application?
Using trace tools to analyze task execution, timing, CPU usage, and events.
114. What is an alarm in RTOS?
A timed action or callback invoked after a specific delay.
115. What is job scheduling in real-time systems?
Assigning processor time to jobs (task instances) based on deadlines and priorities.
116. What is a reentrant ISR?
An ISR that can be interrupted and safely re-entered without data corruption.
117. What is the heap used for in RTOS?
Dynamic memory allocation at runtime (if used).
118. What’s the difference between an idle thread and an idle loop?
An idle thread is managed by the RTOS; an idle loop is manually implemented.
119. Can tasks call ISRs?
No. ISRs are triggered by hardware and managed by the CPU interrupt controller.
120. What is shared memory communication?
Tasks use common memory regions to exchange data, with synchronization mechanisms.
121. What is worst-case execution time (WCET)?
The maximum time a task may take to execute under worst-case conditions.
122. Why avoid delays in ISRs?
Delays block lower-priority interrupts and increase system response times.
123. What is tick granularity?
The smallest unit of time the scheduler can measure or act upon.
124. What is a round-robin with priority scheduling?
Equal-priority tasks share time slices, but higher-priority tasks preempt them.
125. What is an exception handler?
A function invoked when a software exception (e.g., divide by zero) occurs.
7|Page Uttam Basu
Uttam Basu www.linkedin.com/in/uttam-basu/
11 | P a g e Uttam Basu
Uttam Basu www.linkedin.com/in/uttam-basu/
13 | P a g e Uttam Basu