In priority-based job queues, starvation occurs when low-priority tasks never get executed because higher-priority tasks continuously arrive and are processed first. The solution is 'aging,' where a task's priority increases the longer it waits—low-priority tasks become normal after 30 minutes, urgent after 2 hours, and eventually the highest priority, ensuring fairness in task processing.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
#systemdesign #softwarearchitectAdded:
This question helps the interviewer to check how much do you know about design flaws. So, let's understand this in the next 40 seconds. This is day 15 of 30 days 30 interview question where I talk about frequently asked questions by big tech companies. Suppose you have an app that does three or four jobs. For example, one is report generation, second is it sends order confirmation emails, and third is payment refund.
Okay? So, now if you are aware, you don't do these jobs at the time the request comes because that will hold the request for a long time and the request will time out. So, what you do is you push these requests to a queue and let the background worker do the job. And then we let the user you know what, the job is done, enjoy. But if you notice, not all jobs are of the same priority.
For example, over here, payment refund is of high priority. And let's take order confirmation for normal priority.
And report generation for, you know, low priority. So, you need to tag these jobs with their priority. And then the worker picks these jobs from the queue based on the priority. But there's a problem with this. For example, someone initiated a report generation. It was of low priority. And she's waiting since 6 hours. But as her job was low priority, it didn't move up the queue. This is called starvation. Then how do you fix it? Well, the fix is aging. The longer the task waits, the more important it becomes. For example, a low task with that waits for 30 minutes becomes normal after 30 minutes. And after 2 hours, it becomes urgent. And after a certain point of time, it becomes the most urgent task on the queue. So, this introduces fairness in the system. So, now you know what is starvation. To know more, follow me. Until next time. Thank you. Bye. Ciao.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











