Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Priority and fairness decisions show up in job schedulers, support queues and API rate limits across your company. Some customers complain they are always starved. How do you set principles for prioritisation systems at company scale?

A pure priority queue always serves the highest class first, so under sustained load low-priority customers wait forever; that is starvation, and it is a design choice, not bad luck. At company scale we set a few principles: use ageing, weighted fair queuing or quotas instead of strict priority, tie every priority rule to a written business commitment such as an SLA, measure wait time per class and alert on starvation, give critical work its own capacity pool, and review the rules regularly with product and support so that everything does not become urgent.

Why this question is asked

Prioritisation looks like a local engineering decision: one team picks a queue, another sets rate limits, a third decides which tickets go first. But together these choices decide who gets served when the company is busy, and customers notice. Interviewers ask senior engineers this question to see whether they can turn a recurring technical pattern into principles that other teams can apply, and whether they understand the trade-offs well enough to explain them to product and support leaders. In this answer, we will see why strict priority starves, look at the fairer scheduling techniques, then work through the principles one at a time with an example situation, and finish with how to keep the rules healthy over time.

1Why Strict Priority Starves Customers

A priority queue, a queue that always hands out the most important item next, is perfect when there is spare capacity: everything gets served eventually and the urgent items go first. The problem appears when demand exceeds capacity for long periods. Then the high-priority class alone can keep the workers busy, and the low-priority class is never reached. Its wait time is not slow, it is unbounded.

Consider an example. A support queue serves enterprise tickets before standard tickets. Enterprise tickets arrive at 90 per hour and agents close 100 per hour. Standard tickets get the remaining 10 per hour of capacity but arrive at 40 per hour, so their backlog grows by 30 every hour, forever. The average resolution time across all tickets still looks acceptable, because most tickets are enterprise tickets resolved quickly, which is why starvation often goes unnoticed until customers complain.

2Fairer Techniques: Ageing, Weighted Fair Queuing and Quotas

Ageing raises an item's effective priority the longer it waits, for example by adding one level for every ten minutes. Eventually even the lowest item outranks fresh high-priority work, so the worst-case wait becomes bounded. Weighted fair queuing gives each class a share of capacity instead of absolute precedence: with weights 70, 20 and 10, the scheduler serves classes in proportion to those weights whenever they have work, and a class with no work gives its share to the others. Quotas cap what one tenant or class can consume, such as 1,000 API requests per minute per customer, so one noisy customer cannot crowd out everyone else.

Each technique protects a different thing. Ageing bounds the worst wait, weighted fairness guarantees a share, and quotas protect against a single heavy user. Real systems often combine them, for example per-tenant quotas at the API gateway and weighted queues in the job scheduler.

Scheduling policies compared
PolicyProtectsCost or risk
Strict priorityurgent work latencylow classes starve under load
Ageingbounded worst-case waiturgent work can be delayed slightly
Weighted fair queuinga guaranteed share per classweights need agreement and tuning
Quotas per tenantother tenants from a noisy oneheavy users hit limits and complain
Separate capacity poolscritical work from everything elseidle reserved capacity costs money

3Principle: Make Priority Rules Explicit and Tied to Commitments

The first principle is that every priority class must exist because of something the business has promised. If enterprise customers have a contract that says a first response within one hour, that is a reason for a class with a target of one hour. If nobody can say what promise a class serves, it should not exist. We write the rules down in one place, the classes, their targets, what work goes in each, and who decides, and we publish them to support and product, not only to engineers.

This matters because invisible rules get bent. A team under pressure adds a VIP flag for one customer, then another, and in a year half the traffic is VIP. Documented rules give everyone a shared reference to say no, or to make the change deliberately.

4Principle: Measure Waiting Per Class, Not Only Throughput

The second principle is that we measure what customers feel. For every queue and rate limiter, we publish wait time per class as a distribution, with p50, p95 and maximum, not only the overall average or jobs per second. The maximum and the age of the oldest waiting item are the starvation signals: if the oldest standard ticket is 9 days old while the target is 2 days, an alert fires, even if the average looks fine.

In the support example, a dashboard showing p95 wait per class would have shown standard tickets climbing day after day while the overall average stayed flat. That chart is often the single most persuasive artefact in a conversation with leadership.

5Principle: Separate Capacity for Critical Work

Reordering a single queue only decides who waits; it does not create capacity. For work where a missed deadline is very costly, such as payment settlement or incident response, we give it a separate pool: dedicated workers, a separate thread pool, a reserved share of database connections, or a separate cluster. This is the bulkhead idea, named after the walls that stop one flooded compartment from sinking a ship. The critical class then cannot be hurt by a surge elsewhere, and it does not need to steal capacity from everyone else by jumping the queue.

The cost is that reserved capacity is sometimes idle. We size it from the critical class's peak load and accept the idle time as insurance, which is easier to justify when the commitment it protects is written down.

Step throughDeciding how to handle a new priority request
  1. Which written commitment does it serve?
    YesContinueNoDecline or escalate to the owners
  2. Is the work critical enough to need isolation?
    YesGive it its own capacity poolNoUse a weighted share in the shared queue
  3. Set target wait and an alert per classp95 and oldest item
  4. Add it to the next periodic review

4 steps in order. Play them, or step through them one at a time.

6Principle: Review the Rules Regularly

The last principle is to expect priority creep. Over time every team argues that its work is urgent, and if every request becomes priority one, priority means nothing and the old starvation returns in a new form. So we review the classes every quarter with product, support and engineering together: we look at the wait-time data, the complaints, and the commitments, and we remove or merge classes that no longer serve a promise.

As a senior engineer I would also turn these principles into reusable building blocks, a shared scheduler library with weighted queues and ageing, a standard rate limiter with per-tenant quotas, and a standard wait-time dashboard, so that doing the fair thing is the easy path for each team rather than a policy document they must reimplement.

7Follow-up questions

How do you convince the team that owns the enterprise queue to give up strict priority?

With data and with their own commitments. I show the wait-time chart for standard customers next to their targets, and then propose weights that still meet the enterprise SLA with a margin, measured on last month's traffic. When the enterprise commitment is still met, the objection usually becomes about risk, which we handle with a trial on part of the traffic.

When is strict priority acceptable?

When the high class is small and bounded, for example health checks or administrative commands that are a tiny fraction of traffic. Then it cannot consume all capacity. Even then, a cap on its share is a cheap safety net.

What if a customer pays for higher priority?

Then that is a written commitment, and it should translate into a guaranteed share or a target wait time, not into unlimited precedence. A paid tier with a weight and a target is sellable and measurable; a paid tier that can starve others creates the next round of complaints.

8Conclusion

In this answer, we saw that strict priority queues starve lower classes whenever demand exceeds capacity, and that averages hide it. We replaced strict priority with ageing, weighted fair queuing and quotas, and set principles for the whole company: priority rules are written down and tied to business commitments, wait time is measured per class with alerts on starvation, critical work gets its own capacity pool, and the rules are reviewed regularly with product and support to prevent priority creep. Shared libraries and dashboards make those principles easy for teams to follow.

What to say in the interviewAbout 80 seconds aloud

Open with

I would start by explaining that starvation is a property of strict priority, not a bug in one service. If the high class alone can keep capacity busy, the low class waits forever, and averages hide it because most work is served quickly.

Then, if they want more

So the first principle is to stop using pure priority for anything that runs near capacity, and use ageing, so waiting raises an item's priority, weighted fair queuing, so each class gets a guaranteed share, or quotas per tenant, so one heavy customer cannot crowd everyone out.

Second, every priority class must be tied to a written commitment, such as an SLA for first response, documented in one place that product and support can read, with a named owner. Third, we measure wait time per class, p95 and the age of the oldest item, and alert on starvation, not just throughput.

Fourth, truly critical work like payments gets its own capacity pool, a bulkhead, instead of jumping a shared queue. And fifth, we review the classes quarterly with product and support, because priority creep turns everything urgent.

To make this stick I would provide a shared scheduler and rate limiter library and a standard dashboard, so teams get fairness by default rather than by reading a wiki page.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Priority and fairness decisions show up in job schedulers, support queues and API rate...": https://scrivio-interview-library.netlify.app/java/algorithms-and-data-structures/5694cf39d0/