LAUNCHING SOON

Master backend interviews
with real code.

The only platform built for backend engineers. Practice API design, database schema, distributed systems, and caching challenges — then write and execute real code in Go, Python, or Java.

Join the waitlist for early access. No spam, ever.

acebackend.com/challenges/rate-limiter-api-gateway
Problem

Rate Limiter for API Gateway

MEDIUMAPI DESIGN

Design and implement a sliding window rate limiter for an API gateway that handles 1M+ requests per minute across multiple clients. Your implementation must be goroutine-safe and support configurable rate limits per client.

Constraints
  • Must support sliding window algorithm
  • Thread-safe for concurrent access
  • O(1) time complexity for Allow()
  • Memory efficient — handle 10K+ clients
SolutionGo ▾
func NewRateLimiter(rate int, window time.Duration) *RateLimiter {
    return &RateLimiter{
        rate:    rate,
        window:  window,
        clients: make(map[string]*slidingWindow),
    }
}

func (rl *RateLimiter) Allow(clientID string) bool {
    rl.mu.Lock()
    defer rl.mu.Unlock()

    sw, exists := rl.clients[clientID]
    if !exists {
        sw = &slidingWindow{timestamps: []time.Time{}}
        rl.clients[clientID] = sw
    }

    // Your implementation here...
}
Test Results
Basic rate limit — 100 req/s2ms
Sliding window accuracy4ms
Concurrent goroutine safety1ms
Window expiration cleanup3ms
3/4 passed · 10ms total

What you'll practice

Real backend engineering challenges, not another algorithm grinder.

{ }

API Design

REST/gRPC contracts, idempotency, versioning, pagination

DB

Database Design

Schema modeling, indexing strategies, query optimization

>>

Caching Strategies

Cache invalidation, eviction policies, distributed caching

:::

Distributed Systems

Consensus, consistency models, partition tolerance

</>

Microservices

Service decomposition, saga patterns, circuit breakers

///

Concurrency

Thread safety, goroutines, async patterns, race conditions

Write real code. Get instant feedback.

Every challenge runs in a sandboxed environment. Choose your language, solve the problem, and see results in seconds.

Go
Python
Java
Sandboxed Docker execution
Memory & CPU limits
3-second timeout
No network access

Why AceBackend?

Not another algorithm grinder

LeetCode has 3000+ algorithm problems. You don't need another one. AceBackend focuses on what backend interviews actually test: API design, system architecture, and production-grade code.

Real code, not whiteboard diagrams

Other system design platforms let you draw boxes and arrows. Here, you implement the actual rate limiter, build the cache layer, and write the database queries.

Backend-specific curriculum

Structured learning paths from fundamentals to advanced distributed systems. Each challenge builds on the last, with clear progression from junior to senior level.

Production-inspired scenarios

Every challenge is inspired by real engineering problems at companies like Stripe, Uber, and Netflix. Not abstract puzzles — real systems you'll build in your career.

Be the first to know.

Join the waitlist for early access. We're launching with 30 hand-crafted backend challenges across all difficulty levels.