All jobs / Embedded / hardware / RTOS
Embedded / hardware interview question · 3–5 years
A low-priority task holds a lock a high-priority task needs. What do you name?
The strongest answer
Priority inversion — I want inheritance or a ceiling, or I redesign the lock, I do not raise everything to max
Why it works
Exactly. Name it, then inheritance/ceiling/redesign. Max-priority-everything is a busy-loop OS.
What a good answer covers
- Name inversion.
- Inheritance, ceiling, or redesign.
- Do not flatten every priority.
- Do not sleep-turn-take.
Answers that fall short
- Close, but not the strongest: I make every task priority 1
Flat priorities hide the deadline. - Weak: I add sleeps so they take turns
Sleeps are jitter. - Red flag: I disable the scheduler in the low task forever
Scheduler-off is a lock you cannot see.
Who gets asked this
More RTOS questions
- One task corrupts another’s stack. What do you add besides “be careful”?
- You have a 2 ms control deadline. What number do you present?
- A low-priority logger never runs. What do you check before “buy a faster MCU”?
- Two teams share one firmware, each has added mutexes, and you have now had two hangs that reproduce about…
- What does a staff engineer pin on the wall for a control product?
- When do you reach for a mutex, and when for a binary semaphore?
- When do you pick an RTOS over a main-loop, and when not?
- A UART interrupt needs to hand a byte to a task through an RTOS queue. What must the ISR do differently?