All specialtiesTechnology · Job interview

Microservices

Microservice questions are really questions about trade-offs. Say what you gain, what you pay, and when you would not do it.

Words → phrases → sentences → speaking

Try SpeakRole ↗
Job interviewMicroservices
V

How would you split a monolith into services without breaking data consistency?

0:18
Interviewer question

Microservices

Interviewers rarely want a list of patterns. They want to hear how you decide: when a service split is worth the cost, and how you keep data consistent without a single database.

Use the same frame every time: the problem, the pattern, the trade-off. If you can also say "I would not do this for a small team", you sound like someone who has seen real systems.

  • ✓Words → phrases → sentences → speaking
  • ✓Answer meaning
  • ✓Language

Common questions and sample answers

How would you split a monolith into services without breaking data consistency?

What the interviewer wants to hear. A gradual approach, clear boundaries and an honest view of consistency.

Sample answer to practise aloud

I would not rewrite everything at once. First I find the business boundaries, for example orders, payments and users, and I move one of them out using the strangler approach: new traffic goes to the new service, and the old code stays until it is not needed. Each service should own its data, so I stop sharing tables. Where a business action touches several services, I use a saga with compensating steps instead of one big transaction. I also accept that some data will be consistent only eventually, so the product team must agree with that.

What is a saga, and when would you use one?

What the interviewer wants to hear. Orchestration versus choreography, and compensating actions.

Sample answer to practise aloud

A saga is a way to run a business process across several services without a distributed transaction. The process is split into local transactions. If one step fails, we run compensating actions for the steps that were already completed, for example refunding a payment. There are two styles. In choreography, services react to each other's events. In orchestration, one coordinator tells each service what to do. I prefer orchestration for longer flows, because the logic is in one place and easier to debug. Every step must be idempotent, because messages can arrive twice.

When do you choose synchronous calls, and when asynchronous messaging?

What the interviewer wants to hear. Coupling, resilience and what the user sees.

Sample answer to practise aloud

I use synchronous calls, like REST or gRPC, when the caller needs the answer to continue, for example to check a price. The cost is coupling: if the other service is slow or down, the caller suffers. I use asynchronous messaging when the work can happen later, or when many services care about the same event, for example 'order created'. It gives better resilience and scaling, but debugging is harder, and the user may see data that is not updated yet. In many systems I combine both: a synchronous call at the edge and events inside.

What is a circuit breaker?

What the interviewer wants to hear. The three states and why it protects the caller.

Sample answer to practise aloud

A circuit breaker protects a service from a failing dependency. It watches the calls. When the number of errors or timeouts becomes too high, the circuit opens, and the next calls fail immediately or use a fallback instead of waiting. After some time, it lets a few test calls through, and if they succeed, it closes again. This stops a slow dependency from using all our threads and spreading the failure to other services. I combine it with timeouts and limited retries. Libraries like Resilience4j make this easy in Java.

How do you find a problem in a request that goes through many services?

What the interviewer wants to hear. Logs, metrics and tracing, and the habit of adding them early.

Sample answer to practise aloud

I rely on three things: logs, metrics and distributed tracing. Every request gets a trace ID at the entry point, and each service passes it on and writes it to the logs. With a tool like OpenTelemetry and a tracing backend, I can see the whole path of one request and where the time was spent. Metrics like latency and error rate per service tell me where to look first. Without this, a microservice system is almost impossible to debug, so I add it from the beginning, not after the first incident.

How to say the key terms

microservices
MY-kroh-SUR-vis-iz
idempotent
eye-dem-POH-tent
eventual consistency
ih-VEN-choo-ul kun-SIS-ten-see
saga
SAH-guh
latency
LAY-ten-see
resilience
rih-ZIL-yens

Useful phrases for answering

  • The main trade-off is…
  • I would start with a modular monolith.
  • Each service owns its data.
  • We accepted eventual consistency here because…
  • It depends on how much failure the business can accept.
  • I would add a timeout and a limited retry.

Common mistakes to avoid

  • Recommending microservices for every problem. A good answer says when a monolith is the better choice, for example for a small team or an unclear domain.
  • Talking about patterns without a failure story. Explain what happens when a service is down.
  • Forgetting data. Many microservice problems are data problems, so say who owns the data.
  • Forgetting people. Services follow team structure, so mention ownership and on-call.

Frequently asked questions

Should I recommend microservices in the interview?

Recommend what fits the case, and show that you understand the cost. Many interviewers expect you to start with a modular monolith and split later.

Which tools should I name?

Name the ones you used, for example Kafka or RabbitMQ for messaging, Kubernetes for deployment and OpenTelemetry for tracing. Do not list tools you only read about.

How do I explain eventual consistency to a non-technical person?

Use an everyday example: a bank transfer that shows as pending for a few seconds. The system is correct, only the screens catch up a moment later.

Reading an answer is not the same as saying it. Practise each question out loud, then compare the meaning and the language of your own answer.

Try SpeakRole ↗

Other topics in this area