tezvyn:

How would you design the backend check for a report quota?

Source: Wikipedia: Disk quotabeginner

Tests reliable quota enforcement without race conditions. A strong answer uses atomic counts or DB constraints, validates at the service layer, and surfaces a clear 4xx. A red flag is a non-atomic SELECT-then-INSERT pattern.

This tests whether you enforce business limits reliably under concurrency, not just check a number. A strong answer covers four things: placement in a service gate rather than the client; correctness via DB constraints, atomic increments, or locking; UX that returns a clear 4xx instead of a generic failure; and lifecycle edge cases like downgrades or async generation. The red flag is a naive SELECT COUNT then INSERT that creates race conditions and overages.

Read the original → Wikipedia: Disk quota

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

How would you design the backend check for a report quota? · Tezvyn