Skip to content
Jarviix

60-day SSE plan · Day 42 of 60

Rate Limiter (Token Bucket) • WhatsApp-like Chat • Binary Search on Answer • Tech: Kafka

Day42

60-day SSE plan

Rate Limiter (Token Bucket) • WhatsApp-like Chat • Binary Search on Answer • Tech: Kafka

Algorithm

DSA

Medium

Binary Search on Answer — Capacity to Ship Packages (LC 1011)

Minimize ship capacity so all packages ship within D days using feasibility check.

Example

Input: weights=[1,2,3,1,1], D=4 → Output: 3

Where it shows up

Capacity planning, throughput sizing, SLO budgeting.

Low-level design

LLD

Rate Limiter (Token Bucket)

Requirements

  • Per-user limits with rate & capacity.
  • Thread-safe tryAcquire(); refill over time.

Expectations

  • UML for TokenBucket & RateLimiterService.
  • Concurrency-safe Java implementation + tests.

Where it shows up

API gateways, throttling abusive clients.

High-level design

HLD

WhatsApp-like Chat

Requirements

  • 1:1 + group messaging, delivery/read receipts, offline sync.
  • Real-time delivery via WebSockets; scalable fan-out.

Expectations

  • APIs, WebSocket fan-out, message broker, storage model.
  • Multi-region strategy, exactly-once UX via idempotency keys.

Where it shows up

Consumer chat apps, support chat in products.

Today's deep-dive

Tech

Kafka

Write a producer & consumer; demonstrate consumer groups and rebalancing; handle offsets safely.

Where it shows up