16 September 2025

#Microservice

#Microservice

Key Concepts


Topic Sub-Topics (comma separated) Basic Intermediate Advanced Expert
Fundamentals Monolith vs Microservices, Benefits, Challenges, 12-Factor App
Architecture Styles SOA vs Microservices, Layered, Event-Driven, Hexagonal, Serverless
Service Decomposition Business Capability, Subdomain, Strangler Fig, Self-contained Service
API Design REST, gRPC, GraphQL, API Gateway, BFF
Communication REST, gRPC, Messaging (Kafka, RabbitMQ), Event Streaming
Service Discovery Eureka, Consul, etcd, DNS Discovery, Kubernetes
Data Management Database per Service, Shared DB, CQRS, Saga, Event Sourcing
Resiliency Patterns Circuit Breaker, Retry, Bulkhead, Timeout, Fallback
Security JWT, OAuth2, RBAC, Zero Trust, Secrets Management
Observability Logging, Distributed Tracing, Metrics, Health Checks, OpenTelemetry
Deployment Docker, Kubernetes, Sidecar, Adapter, Serverless
Release Strategies Blue-Green Deployment, Canary Release, Rolling Updates, A/B Testing
Workflow & Transactions Saga, Orchestration, Choreography, Compensating Transactions
Testing Unit Testing, Contract Testing, Integration Testing, Chaos Testing
Scalability Horizontal Scaling, Sharding, Caching, Auto-scaling
Cloud-Native Enhancements Service Mesh, Multi-Region, Sharding, API Composition
Governance Versioning, Backward Compatibility, Standards, Policies
DevOps & CI/CD Jenkins, GitHub Actions, ArgoCD, Tekton, GitOps
Performance JVM Tuning, Async I/O, Profiling, Caching
Anti-Patterns Shared DB, God Service, Hardcoded Endpoints, Nano-services

Interview question

1. Fundamentals

  1. What are microservices and how are they different from monoliths in Java projects?
  2. Explain the role of Spring Boot in building microservices.
  3. Why are microservices considered loosely coupled and highly cohesive?
  4. What is the advantage of using embedded servers (Tomcat/Jetty) in Spring Boot microservices?
  5. How do you configure properties in Spring Boot microservices?
  6. What is the significance of application.yml in Spring Boot?
  7. What are the benefits of using microservices for large Java enterprise apps?
  8. How do microservices promote independent deployments?
  9. What challenges exist when moving a legacy Java monolith to microservices?
  10. How does Domain-Driven Design (DDD) help in microservices design?
  11. What is bounded context and why is it important?
  12. How do you choose the right service granularity in Java projects?
  13. What is a self-contained system in microservices?
  14. Compare modular monolith vs microservices in Java.
  15. How do you externalize configuration in Java microservices?
  16. What is the role of Spring Initializr in microservices development?
  17. Why are fat JARs preferred in Java microservices?
  18. How do you secure configuration properties in Spring Boot?
  19. What is the role of profiles (@Profile) in Spring Boot?
  20. How do you bootstrap a microservice ecosystem for a Java enterprise app?

2. Architecture & Design Patterns

  1. What are common design patterns in microservices (e.g., Saga, CQRS, API Gateway)?
  2. Explain the role of API Gateway in a Spring Cloud ecosystem.
  3. What is the strangler fig pattern in migrating Java monoliths?
  4. Explain choreography vs orchestration with Java examples.
  5. What is the role of Spring Cloud in microservice architectures?
  6. Compare layered architecture vs hexagonal (ports & adapters).
  7. What are the drawbacks of distributed monoliths?
  8. How do you handle inter-service communication in Java microservices?
  9. What is the Backend-for-Frontend (BFF) pattern?
  10. How do you apply the Circuit Breaker pattern in Spring Cloud?
  11. What is the Sidecar pattern in microservices?
  12. How do you apply the Bulkhead pattern in Java microservices?
  13. What is service choreography with Kafka in Java?
  14. How do you implement the Strangler pattern in a Java migration project?
  15. What is the Saga pattern in distributed transactions?
  16. How is CQRS implemented in Java with Spring Boot?
  17. Explain repository vs DAO pattern in a microservices context.
  18. What is eventual consistency and how do you achieve it in Java?
  19. How do you handle cross-cutting concerns (logging, security) in Java microservices?
  20. Compare synchronous and asynchronous architecture styles with examples in Java.

3. Communication

  1. How do microservices communicate using REST in Spring Boot?
  2. How do you implement synchronous calls using RestTemplate vs WebClient?
  3. What are the pros/cons of synchronous REST vs asynchronous messaging?
  4. What is Feign Client in Spring Cloud?
  5. How do you handle retries and timeouts in Feign clients?
  6. Explain circuit breaker with Feign + Resilience4j.
  7. How do you propagate request headers across services?
  8. What is gRPC and can it be used with Java microservices?
  9. How do you implement Pub/Sub messaging using Kafka in Java?
  10. What is a dead-letter queue in Kafka?
  11. How do you ensure idempotency in message processing?
  12. What is Spring Cloud Stream?
  13. How does backpressure work in Kafka consumers?
  14. How do you secure inter-service communication in Java?
  15. What is distributed event streaming?
  16. How do you implement request-response over Kafka?
  17. Compare RabbitMQ and Kafka in Java microservices.
  18. How do you implement fan-out communication in Kafka?
  19. What is correlation ID and how do you implement it in Java microservices?
  20. How do you monitor message delivery in Kafka?

4. Service Discovery

  1. What is service discovery in microservices?
  2. How do you use Netflix Eureka with Spring Boot?
  3. What is client-side vs server-side discovery?
  4. Compare Eureka, Consul, and Zookeeper.
  5. How do you configure Eureka client in Spring Boot?
  6. What is Ribbon and how does it work with Eureka?
  7. Why was Ribbon deprecated and what replaces it?
  8. What is Spring Cloud LoadBalancer?
  9. How do you integrate service discovery with Kubernetes?
  10. How do you secure service discovery in production?
  11. How do you handle stale instances in service registry?
  12. What is DNS-based discovery in cloud environments?
  13. What are the benefits of Consul over Eureka?
  14. How do you achieve multi-region discovery in Java?
  15. What happens if a service registry goes down?
  16. How do you scale service registries?
  17. What is the difference between service discovery and API Gateway routing?
  18. What is health check integration with discovery?
  19. How do you refresh service registration dynamically?
  20. How does Kubernetes service discovery differ from Spring Cloud Eureka?

5. Data Management

  1. Why is ?database per service? recommended in microservices?
  2. What are the challenges with shared databases?
  3. How do you implement distributed transactions in Java microservices?
  4. What is the Saga pattern and how is it implemented in Java?
  5. What is event sourcing and how can it be implemented in Java?
  6. What is the CQRS pattern and its use in microservices?
  7. How do you maintain data consistency across services?
  8. How do you implement distributed caching in Java?
  9. What is API composition in microservices?
  10. How do you use Spring Data JPA in microservices?
  11. What is optimistic locking vs pessimistic locking?
  12. How do you handle schema evolution in microservices?
  13. What is polyglot persistence?
  14. How do you ensure transactional boundaries in microservices?
  15. What are compensating transactions?
  16. How do you replicate data across services?
  17. What is eventual consistency and how to achieve it with Kafka?
  18. What is database sharding?
  19. How do you monitor database performance in microservices?
  20. What is distributed caching with Redis in Java?

6. Resiliency & Fault Tolerance

  1. What is fault tolerance in microservices?
  2. How do you implement circuit breakers in Java microservices?
  3. Compare Netflix Hystrix and Resilience4j.
  4. How do you implement retries with exponential backoff in Spring Boot?
  5. What is bulkhead pattern and how is it used?
  6. How do you configure timeouts in Spring Cloud?
  7. What is fallback in Resilience4j?
  8. How do you prevent cascading failures in microservices?
  9. What is rate limiting and how is it implemented?
  10. How do you handle service unavailability in Java?
  11. How do you test resiliency in microservices?
  12. What is the fail-fast principle?
  13. How do you isolate thread pools in Resilience4j?
  14. What is adaptive throttling?
  15. How do you handle retries in Kafka consumers?
  16. What is chaos engineering?
  17. How do you build self-healing microservices?
  18. What is service degradation?
  19. How do you monitor circuit breaker metrics?
  20. What is the difference between fault tolerance and high availability?

7. Security

  1. How do you secure REST APIs in Spring Boot?
  2. What is OAuth2 and how is it implemented in Spring Security?
  3. What is JWT and how do you use it in microservices?
  4. Compare session-based vs token-based authentication.
  5. How do you implement Single Sign-On (SSO) in microservices?
  6. How does Keycloak integrate with Java microservices?
  7. What is mTLS (mutual TLS) and why is it used?
  8. How do you store and manage secrets in Java apps?
  9. What is role-based access control (RBAC)?
  10. What is attribute-based access control (ABAC)?
  11. How do you handle API Gateway security in Spring Cloud?
  12. How do you rotate secrets and keys?
  13. What is zero-trust security model?
  14. How do you handle CSRF in microservices?
  15. What is rate limiting for security?
  16. How do you secure Kafka topics?
  17. What is API throttling?
  18. How do you perform penetration testing for Java microservices?
  19. What are OWASP top risks for microservices?
  20. How do you implement security monitoring in microservices?

8. Observability

  1. What is observability in microservices?
  2. Difference between monitoring and observability?
  3. How do you implement centralized logging in Java microservices?
  4. What is ELK/EFK stack?
  5. How do you implement distributed tracing with Sleuth?
  6. What is Zipkin and how is it integrated?
  7. What is Jaeger and how is it different from Zipkin?
  8. What is OpenTelemetry and how does it work?
  9. How do you trace a request across services?
  10. How do you implement correlation IDs?
  11. How do you implement health checks in Spring Boot?
  12. What is Micrometer in Spring Boot?
  13. How do you integrate Prometheus with Spring Boot?
  14. What is Grafana and how do you use it with Prometheus?
  15. How do you implement custom metrics in Spring Boot?
  16. How do you set up alerts for microservices?
  17. How do you debug slow API calls in distributed systems?
  18. What is log aggregation?
  19. How do you handle log correlation in async flows?
  20. What are golden signals in observability?

9. Deployment (Docker & Kubernetes)

  1. Why are containers used in microservices?
  2. How do you Dockerize a Spring Boot microservice?
  3. What is a Dockerfile and how is it written for Java apps?
  4. What is the difference between ENTRYPOINT and CMD in Docker?
  5. How do you configure environment variables in Docker?
  6. What is Kubernetes and why is it used with microservices?
  7. What is a Kubernetes pod?
  8. What is a deployment in Kubernetes?
  9. What is a Kubernetes service?
  10. How do you expose microservices using Ingress?
  11. What is ConfigMap in Kubernetes?
  12. What is a Secret in Kubernetes?
  13. What is a sidecar container?
  14. What is Istio and what problems does it solve?
  15. How do you implement service mesh in Kubernetes?
  16. What is rolling update in Kubernetes?
  17. How do you implement blue-green deployment in Kubernetes?
  18. What is canary deployment?
  19. How do you handle scaling in Kubernetes?
  20. How do you secure microservices in Kubernetes?

10. Testing

  1. How do you test microservices in Java?
  2. What is unit testing in Spring Boot?
  3. What is integration testing with Spring Boot Test?
  4. How do you use TestContainers in microservices testing?
  5. What is contract testing and why is it important?
  6. How do you use Pact for consumer-driven contracts?
  7. How do you mock dependencies in unit tests?
  8. What is WireMock and how do you use it?
  9. How do you test asynchronous flows?
  10. What is chaos testing?
  11. How do you load test microservices?
  12. How do you use JMeter for performance testing?
  13. How do you use Gatling for load testing?
  14. What is resilience testing?
  15. How do you test API Gateway routes?
  16. How do you test security in microservices?
  17. What is fault injection testing?
  18. How do you automate tests in CI/CD?
  19. What is canary testing?
  20. What is end-to-end testing in microservices?


Related Topics