Leaky Bucket:Smooth Bursts Into a Steady Drain
Queue work into a bucket that leaks at a constant rate — overflow is dropped or the caller waits. Smooth output, not a stored burst of tokens.
Read MoreBrowse the full archive. Use topics in the sidebar to explore by tag.
Queue work into a bucket that leaks at a constant rate — overflow is dropped or the caller waits. Smooth output, not a stored burst of tokens.
Read MoreStop the Email×SendGrid / SMS×Twilio subclass grid by letting OrderNotifier hold a MessageSender so channels and vendors vary independently.
Read MoreBuild the LPS prefix table, then scan the text once — on a mismatch the pattern jumps using already-matched prefix, so the text index never retreats.
Read MoreStop walking Order line items with get(i) on a leaked ArrayList so a switch from list to a SKU tree does not rewrite OrderProcessor.
Read MoreRefill tokens at a steady rate, spend one per request, and allow a burst up to bucket capacity — then reject or wait.
Read MoreBuild Stripe-region and Razorpay-region checkout families in Java so gateway, webhook parser, and money type vary together without OrderProcessor naming the concretes.
Read MoreGrow a min-heap of crossing edges from a seed until every vertex is in the tree — a Dijkstra-shaped frontier for an MST, not distances from a source.
Read MoreReplace a hard-coded fraud-inventory-payment-notify sequence with a Handler chain in Java so a new checkout step is a class you splice in, not a next-type you edit.
Read MorePlace keys on a ring so adding or removing a node remaps only its neighbors — not every key — with virtual nodes to even the load.
Read MoreReplace a growing DRAFT / PAID / REFUNDED / VOID switch in process, refund, and void with OrderStatus objects that own legal transitions, so OrderProcessor stops being the state machine.
Read More