Post

[Interview] Microservices and distributed systems

Interview questions and answers about microservices and distributed systems.

[Interview] Microservices and distributed systems

Note: This article contains mainly LLM generated content, but only such that has been human reviewed. Nonetheless, it is still possible that something wasn’t caught or simply I made a mistake. If you see anything wrong or missing the point, please let me know in the comments.

This article may contain some simplifications (maybe even oversimplifications). Treat it like a cheat sheet with important information, not an exhaustive research paper with all nuances and edge cases.

Resilience Design Patterns

Basic

Resilience patterns make a distributed system degrade predictably instead of failing catastrophically.

In a Spring Boot ecosystem, the practical baseline is:

  • explicit timeouts
  • bounded retries with backoff
  • circuit breakers
  • bulkheads
  • deliberate fallbacks

Standard

A remote call can fail, slow down, return partial data, or recover after a moment.
Resilience help to make sure that a one unhealthy dependency won’t exhaust your threads, connections, and request capacity or in worst scenario cause a cascade.

PatternUse it forMain pitfall
TimeoutBound how long a remote call may consume a resourceHTTP client defaults may be missing or much too high
RetryTransient failures such as brief network errors or 503Retrying non-idempotent writes creates duplicates
Circuit breakerStop calling a dependency that is repeatedly failingTreating it as a substitute for a timeout
BulkheadIsolate capacity between dependencies or workloadsOne shared executor/connection pool for everything
FallbackReturn a safe degraded resultHiding an error or returning misleading/stale critical data
Rate limitingProtect the service under overloadLetting queues grow without bound
CacheReduce dependency load and retain some read availabilityServing data whose freshness requirements are strict