Design an IP blacklist API
SotiSoftware Engineer · OnsiteLast updated
This question evaluates API and backend system design skills for network security and distributed caching, encompassing data modeling for exact IPs and CIDR ranges, cache architecture and invalidation, consistency and failure handling, scaling, and observability.
Design an API and backend service for an IP firewall blacklist system.
The service should allow security administrators or automated abuse-detection systems to add, remove, update, and query blacklisted IP addresses and IP ranges. Firewall gateways and application services should be able to call the API at high throughput to decide whether an incoming request should be blocked.
Focus especially on cache design:
- What APIs would you expose?
- How would you store exact IP addresses and CIDR ranges?
- How would you design the read path so blacklist checks are very low latency?
- How would cache invalidation and propagation work when the blacklist changes?
- How would you handle scale, consistency, failures, and observability?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.