Api Gateway hard
You are using 'Distributed Tracing' to debug latency. The trace starts at the Gateway but 'dies' before reaching the backend; the backend logs show a new Trace ID. What is the standard Gateway configuration required to fix this?
- A The Gateway must enable 'Packet Inspection' to find the Trace ID buried deep in the TCP segment payload.
- B The Gateway must be configured to 'Propagate Context Headers' (like W3C `traceparent` or Zipkin `X-B3-TraceId`) from the incoming client request to the outgoing upstream request.
- C The Gateway must share its internal CPU clock with the backend services via NTP to ensure ID synchronization.
- D Distributed tracing only works if the Gateway and all backends share the same physical server.
Answer: B. The Gateway must be configured to 'Propagate Context Headers' (like W3C `traceparent` or Zipkin `X-B3-TraceId`) from the incoming client request to the outgoing upstream request.
Tracing is a relay race. Each hop must 'Pass the Torch' (the ID). If the Gateway doesn't copy those specific headers to the new request it makes to the backend, the backend assumes this is a brand-new transaction and generates a fresh ID, breaking the end-to-end visualization.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- Your Gateway communicates with backends via HTTP/1.1 connections. A slow backend service causes 'Head-of-Line Blocking'. How does switching to HTTP/2 as the Gateway-to-Backend transport mitigate this?
- What is the primary architectural role of an API Gateway in a microservices environment?
- Why is 'Stateless Token Validation' (e.g., using JWTs) significantly more scalable at the Gateway level than 'Stateful Validation' (e.g., using Opaque/Reference Tokens)?
- Your Gateway is configured to cache any URL ending in `.css` or `.jpg`. An attacker tricks a victim into visiting `https://api.com/v1/profile/info/style.css`. How can this lead to an 'Account Takeover'?
- An API is receiving a sudden surge of 10,000 requests per second from a single IP address. How does an API Gateway preserve the stability of the backend services?
- How can an API Gateway help prevent 'Double Charging' in a payment system when a mobile client retries a failed request due to a poor connection?