Top 3 Job queue Interview Questions
Browse 3 real-world technical and behavioral interview questions about Job queue. Review scenarios, edge cases, and architectural best practices.
You need a work queue with priorities and you are told to build it in Postgres, not Kafka. What does the dequeue statement have to do, and what happens when ten workers run it at once?
The dequeue has to pick the highest-priority ready row, lock it, and mark it claimed in one statement, using FOR UPDATE SKIP LOCKED so ten workers each take a different row instead of queueing behind the same one. The lock only lasts as long as the transaction, so the claim must be written or the transaction held.
A job queue is backed up four hours and half the jobs are now pointless. What do you drain, and what do you drop?
A job queue backlog should be classified into expired jobs, superseded jobs and still-required jobs. Drain the last fully; shed expired work with a record and collapse superseded work by key. Deadlines and collapse keys must be written at enqueue time. It also connects backpressure to the point an interviewer is testing.
Every uploaded image needs six sizes and the thumbnail has to appear immediately. What runs before you return, and what does not?
Thumbnail generation system design should return one displayable image immediately while every durable variant is produced asynchronously. Persist the original, write metadata, show a client-side preview or first small thumbnail, and expose variant readiness so the UI never asks for an image size that is not ready.