Top 10 Microservices Interview Questions Every Fresher Should Know

Top 10 Microservices Interview Questions Every Fresher Should Know Work through these 10 questions out loud. Open any question for the full model answer, the trap to avoid, and the follow-up a panel usually asks.

  1. Saga pattern — choreography vs orchestration?

    Order saga: reserve inventory → charge payment → ship. Failure at payment triggers release inventory compensation. Orchestration clearer for complex flows with visibility....

    Full answer

  2. Explain the transactional outbox pattern.

    OrderService @Transactional saves Order and OutboxEvent(type=ORDER_CREATED, payload=json). OutboxProcessor @Scheduled polls FOR UPDATE SKIP LOCKED, sends to Kafka, updates...

    Full answer

  3. Kafka consumer groups, offsets, and delivery semantics?

    @KafkaListener with AckMode.MANUAL — ack after DB save. Consumer group order-service scales to partition count max. Idempotency key in message header dedup table. Monitor...

    Full answer

  4. One microservice is down and others are failing. How do you prevent this?

    Cascade failure happens when callers block waiting. Use Resilience4j circuit breaker — open circuit fails fast with degraded response. ```java @CircuitBreaker(name = "catalog",...

    Full answer

  5. What is the Backend-for-Frontend (BFF) pattern?

    Mobile BFF /mobile/home aggregates user profile + feed + notifications in one round trip. Web BFF different field selection. BFF handles OAuth BFF cookie pattern. Domain...

    Full answer

  6. Load shedding and backpressure in microservices?

    Tomcat max queue + reject policy returns 503 with Retry-After. WebClient timeout + circuit breaker stops calling slow dependency. Kafka consumer pause partitions when...

    Full answer

  7. How do you handle API failures when calling another microservice?

    Use Resilience4j with Spring Boot 3: timeout, circuit breaker, bulkhead. Never retry POST payments without idempotency key. ```java @CircuitBreaker(name = "billing",...

    Full answer

  8. How do you implement retry logic for failed REST calls?

    ```java @Retry(name = "inventory", fallbackMethod = "inventoryFallback") public StockLevel fetchStock(String sku) { return restClient.get().uri("/stock/{sku}",...

    Full answer

  9. Explain CAP theorem in the context of microservices.

    When a network split isolates nodes, you cannot have both perfect consistency and every node answering. Example: order service during partition — either reject writes (CP) or...

    Full answer

  10. How would you design a rate-limited REST API?

    API gateway or filter applies token bucket per API key — Redis stores tokens with TTL. Exceeding limit returns 429 + Retry-After. Different tiers per plan. Log rejections for...

    Full answer

Microservices Interview Questions and Answers · Top 50 Microservices Interview Questions and Answers (2026 Edition) · Top 40 Microservices Interview Questions | Must-Prepare before interview. · Microservices Interview Questions Every Fresher Must Know

All interview question lists · Interview guides · Home · Support the platform