21. How do you handle calls between clients and REST API services with increased volumes?
Describe how the API and its callers behave under higher traffic, including the handling of volume increases without changing the contract.
At a high level, I would keep the REST contract stable and scale everything behind it. Clients send HTTPS requests through edge and DDoS protection to an API gateway. The gateway handles AuthN/Z, rate limiting, validation, caching, quotas, and routing. It forwards work to stateless ASP.NET Core services that scale horizontally. Those services use async I/O, Redis, the primary database, and a message broker for background work. This handles larger volumes well, but the trade-off is more infrastructure and operational complexity.
This question asks how I would keep an API working when many more callers start using it. The callers should not need a new contract just because traffic grows. My goal is to protect the service, spread work across more copies, reduce unnecessary database work, and move slow work away from the main request. I also need good visibility when something becomes overloaded or unhealthy. I would explain the design by following the diagram from the clients through the gateway and .NET service, then through data and background-processing paths, and finally back to the callers.
- How large can the traffic increase become?
- Are short traffic spikes or sustained high traffic more important?
- Which operations can be processed asynchronously?
- Must the existing client-facing API contract remain unchanged?
I would start with the main request path. Web, mobile, and third-party clients send HTTPS API requests. The diagram also shows JWT or mTLS as caller security options. Requests first pass through Edge Protection and DDoS protection. This keeps abusive traffic from consuming application capacity. Valid traffic then continues to the API Gateway. The client-facing contract remains the same even when the system scales internally.
The API Gateway is the main traffic-control point. It handles AuthN/Z, which means authentication and authorization, plus rate limiting, request validation, caching, and quotas. Rate limiting stops one caller from consuming too much capacity. Quotas place broader usage limits on callers. The gateway also works with the Identity Provider through OIDC, OAuth 2.0, and JWKS. Token or key information flows to the gateway, and token validation is performed before protected traffic is accepted. The gateway then forwards the request to the .NET API service.
The diagram also shows separate HTTPS gRPC or REST exchanges between the gateway and Internal Services such as User, Billing, and Inventory services. These are supporting service-to-service paths and are not the client response path.
The receiving service is a stateless ASP.NET Core API running on Kestrel. Stateless means one request does not depend on private server state stored in one specific replica. That allows the service to scale horizontally by adding API Instance 1, Instance 2, through Instance N.
Inside the service, the middleware pipeline handles logging, validation, security, and correlation. Controllers or Minimal APIs receive the request. Validation and mapping can use System.Text.Json as shown in the diagram. Business logic uses task-based asynchronous work, which helps the service wait for I/O without holding a thread for the whole wait. Health checks help identify unhealthy instances.
The API service performs asynchronous I/O against the Primary Database through its connection pool. The database returns data back to the API service. The service can also perform cache get and set operations against the Distributed Cache, shown as Redis.
Caching reduces repeated database work for frequently requested data. This is useful when traffic increases because the database often becomes a bottleneck before stateless API instances do. The cache is an optimization, while the primary database remains the main persistent data store shown in the design.
I would not keep long-running processing inside the synchronous client request when it can be moved out. The .NET API service can publish work asynchronously to the Message Broker. The diagram shows RabbitMQ, Kafka, SQS, or EventBridge as broker choices.
Background Workers consume the queued work and handle processing, emails, or integrations. Queue buffering provides backpressure when work arrives faster than workers can process it. This protects the API from being overwhelmed and lets worker capacity scale independently.
For the synchronous path, the .NET API service sends its response back to the API Gateway. The gateway returns the response through Edge Protection and then to the client over HTTPS.
Cross-cutting concerns support the whole design. The diagram shows telemetry with OpenTelemetry, logging, metrics, health checks, logs, traces, and alerts. It also shows timeouts, retries, a circuit breaker, high availability across multiple availability zones or regions, rate limiting, queue buffering, and load shedding. These controls help the system stay useful under higher volume. The trade-off is more moving parts, higher cost, and more operational work, but callers keep the same API contract while the implementation scales behind it.
The benefit is that the public API contract stays unchanged while capacity grows behind it. Stateless ASP.NET Core instances are easy to add, but shared data must live outside one replica. Rate limiting, quotas, and load shedding protect the service, but some excess traffic may not be served immediately. Redis reduces repeated database work, but caching adds another system to operate. Async I/O improves concurrency, while the message broker and workers move long-running work away from the request path. That improves responsiveness, but queues and workers add complexity. Timeouts, retries, and circuit breakers improve resilience, but retries must be controlled so they do not create even more traffic. Multi-AZ or multi-region deployment improves availability but costs more. Observability adds operational work, but it is essential for finding bottlenecks during high volume.
Interviewers ask this to see whether I can scale an API without breaking its callers. They want clear judgment about traffic protection, gateway responsibilities, stateless horizontal scaling, database pressure, caching, and asynchronous work. They also check whether I understand request and response direction, authentication and authorization, resilience, backpressure, and observability. The important skill is deciding where each responsibility belongs and explaining the trade-offs instead of only naming scaling technologies.









