RTOS & Real-Time Concepts · Interview question

How does FreeRTOS combine priority and round-robin scheduling?

A strong answer

It layers them: priority is the primary decision and round-robin is the tiebreaker. The scheduler always runs a task from the highest-priority level that has any Ready tasks, a priority-3 task always preempts and beats a priority-2 task, and preemption is immediate when a higher-priority task becomes Ready. Only when multiple tasks sit at that highest occupied ready priority does round-robin come into play: those equal-priority tasks share the CPU by time-slicing, each getting one tick before the scheduler rotates to the next. So you can think of it as "priority decides which level runs; round-robin shares the CPU among the ready tasks within that level." Lower-priority levels get the CPU only when all higher levels are empty (their tasks blocked or suspended). This combination gives you deadline-ordered responsiveness from priorities plus fair sharing among genuine peers, and it's configurable, you can disable time-slicing so equal-priority tasks run until they block. The design takeaway is to use distinct priorities to express ordering and reserve a shared priority for tasks you truly want to treat as equals.

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

Preemptive vs Round-Robin Scheduling

How the scheduler chooses: priority preemption (urgent runs first), round-robin time-slicing among equal priorities, and cooperative scheduling, plus the starvation and fairness tradeoffs.

More Preemptive vs Round-Robin Scheduling questions

Browse all 472 interview questions