Microservice design
21 questions in 7 subtopics.
Service decomposition
What makes a good service boundary? Give two signs that an existing split between services is wrong.You are asked to extract the billing module from a Spring Boot monolith into its own service. Describe the steps, including data, and how you keep the system working during the move.An organisation has 300 microservices for 25 teams, many with one or two endpoints, and incidents frequently involve chains of 8 or more calls. How would you assess and improve the decomposition?Bounded contexts and data ownership
Why is a shared database between microservices considered a problem? What is the database-per-service principle and what does it cost?Two teams both need a Customer model: sales needs contact preferences and the sales owner, billing needs payment terms and tax ids. How would you model this with bounded contexts, and who owns which data?Data ownership between teams is unclear: three services write to the same customer address table and incidents keep happening. How would you resolve ownership in the organisation?Your company is reorganising from teams aligned to channels (web, mobile) to teams aligned to business domains. About 150 services must get new owners, and some do not fit any new team. How do you handle service ownership through the reorganisation?Synchronous vs asynchronous communication
Compare synchronous REST calls and asynchronous messaging between services. For an order placement that must check stock and later notify the warehouse, which parts would you make synchronous and which asynchronous?A checkout endpoint calls five services synchronously and its p99 latency is three seconds; availability is lower than any single service. Explain why and how you would improve it.Your company must choose whether its next-generation platform is primarily event-driven or request-driven. How do you frame the decision for the executive team and the engineering organisation?API composition
In a Spring Boot composer service, write the approach to call three downstream services in parallel with a 500 ms budget and return what is available. Which Java and Spring tools would you use?A mobile home screen needs data from the profile, orders, recommendations and loyalty services. Compare client-side calls, API composition in a gateway or BFF, and a precomputed read model.Shared libraries
Your services depend on a shared "common-domain" library with entity classes and DTOs. Every change forces 20 services to upgrade together. What would you change?You are setting up a platform team that will provide shared Spring Boot starters to 40 teams. What should go into starters, how do you version and support them, and how do you avoid becoming a bottleneck?Ten years ago your company built an internal framework on top of Spring. Today it lags behind Spring Boot releases, blocks upgrades and only two people understand it. What would you do?When not to use microservices
A start-up with 6 engineers plans to build its first product as 12 microservices on Kubernetes. As a senior engineer, what would you advise?Describe a modular monolith with Spring Boot: how you would enforce module boundaries and when you would split a module into its own service.After seven years of microservices, your company's cloud costs and incident rates are high and delivery is slow. Leadership asks whether to consolidate. How would you assess the cost of microservices and decide where to consolidate?Microservice characteristics and benefits
What are the defining characteristics of a microservice, and what benefits are microservices supposed to bring? Give a cost that comes with each benefit.Two years after splitting a monolith into 25 microservices, a company deploys less often than before: releases need coordination across services, a shared database still exists, and incidents take longer to diagnose. How do you check whether the expected benefits of microservices are being realized, and what do you change?A new CTO asks you to explain, for the board, why the company adopted microservices and whether it was worth it. You have data on delivery speed, incidents and cloud costs before and after. How do you build an honest assessment of the benefits and costs?No question matches these choices.