Tüm uzmanlıklarTeknoloji · İş görüşmesi

Mikroservisler

Mikroservis soruları aslında ödünleşim (trade-off) soruları. Ne kazandığınızı, neyle ödediğinizi ve ne zaman yapmayacağınızı söyleyin.

Kelimeler → ifadeler → cümleler → konuşma

SpeakRole’i dene ↗
İş görüşmesiMikroservisler
V

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

0:18
Mülakat sorusu

Mikroservisler

Mülakatçılar nadiren bir kalıp listesi duymak ister. Nasıl karar verdiğinizi duymak isterler: servislere bölmenin maliyetine ne zaman değdiğini ve tek bir veritabanı olmadan veriyi nasıl tutarlı tuttuğunuzu.

Her seferinde aynı çerçeveyi kullanın: sorun, kalıp, ödünleşim. Buna “küçük bir ekip için bunu yapmazdım” da ekleyebiliyorsanız, gerçek sistemler görmüş biri gibi konuşursunuz.

  • ✓Kelimeler → ifadeler → cümleler → konuşma
  • ✓Yanıtın anlamı
  • ✓Dil

Sık sorulan mülakat soruları ve örnek cevaplar

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

Veri tutarlılığını bozmadan bir monoliti servislere nasıl bölerdiniz?

Mülakatçı ne duymak ister. Kademeli bir yaklaşım, net sınırlar ve tutarlılığa dürüst bir bakış.

Yüksek sesle çalışmak için İngilizce örnek cevap

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?

Saga nedir ve ne zaman kullanırsınız?

Mülakatçı ne duymak ister. Orkestrasyon (orchestration) ile koreografi (choreography) ve telafi edici (compensating) eylemler.

Yüksek sesle çalışmak için İngilizce örnek cevap

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?

Ne zaman senkron çağrıları, ne zaman asenkron mesajlaşmayı seçersiniz?

Mülakatçı ne duymak ister. Bağımlılık (coupling), dayanıklılık ve kullanıcının gördüğü.

Yüksek sesle çalışmak için İngilizce örnek cevap

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?

Circuit breaker nedir?

Mülakatçı ne duymak ister. Üç durum ve çağıran tarafı neden koruduğu.

Yüksek sesle çalışmak için İngilizce örnek cevap

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?

Birçok servisten geçen bir istekteki sorunu nasıl bulursunuz?

Mülakatçı ne duymak ister. Loglar, metrikler ve tracing; bunları erkenden ekleme alışkanlığı.

Yüksek sesle çalışmak için İngilizce örnek cevap

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.

Anahtar terimler nasıl telaffuz edilir

microservices
MAY-kro-SÖR-vi-siz
idempotent
ay-dem-PO-tınt
eventual consistency
i-VEN-çu-ıl kın-SİS-tın-si
saga
SA-gı
latency
LEY-tın-si
resilience
ri-ZİL-yıns

Cevap vermek için kullanışlı kalıplar

  • The main trade-off is…Başlıca ödünleşim (trade-off) şu:…
  • I would start with a modular monolith.Modüler bir monolitle başlardım.
  • Each service owns its data.Her servis kendi verisinin sahibidir.
  • We accepted eventual consistency here because…Burada nihai tutarlılığı (eventual consistency) kabul ettik, çünkü…
  • It depends on how much failure the business can accept.Bu, işin ne kadar aksaklığı kabul edebileceğine bağlı.
  • I would add a timeout and a limited retry.Bir zaman aşımı (timeout) ve sınırlı sayıda yeniden deneme eklerdim.

Sık yapılan hatalar

  • Her soruna mikroservis önermek. İyi bir cevap, monolitin ne zaman daha iyi olduğunu da söyler; örneğin küçük bir ekip ya da belirsiz bir alan için.
  • Hata hikâyesi olmadan kalıplardan söz etmek. Bir servis çöktüğünde ne olduğunu anlatın.
  • Veriyi unutmak. Mikroservis sorunlarının çoğu veri sorunudur; bu yüzden verinin sahibinin kim olduğunu söyleyin.
  • İnsanları unutmak. Servisler ekip yapısını izler; bu yüzden sahiplikten ve nöbetçilikten (on-call) söz edin.

Sıkça sorulan sorular

Mülakatta mikroservis önermeli miyim?

Duruma uyanı önerin ve maliyetini anladığınızı gösterin. Birçok mülakatçı, önce modüler bir monolitle başlayıp sonra bölmenizi bekler.

Hangi araçları saymalıyım?

Kullandıklarınızı: örneğin mesajlaşma için Kafka veya RabbitMQ, dağıtım için Kubernetes, tracing için OpenTelemetry. Yalnızca okuduğunuz araçları sıralamayın.

Nihai tutarlılığı (eventual consistency) teknik bilgisi olmayan birine nasıl anlatırım?

Günlük bir örnek kullanın: birkaç saniye boyunca “beklemede” görünen bir banka havalesi. Sistem doğru çalışır, yalnızca ekranlar bir an sonra yetişir.

Bir cevabı okumak ile onu söylemek aynı şey değildir. Her soruyu yüksek sesle çalışın, ardından kendi cevabınızın anlamını ve dilini karşılaştırın.

SpeakRole’i dene ↗

Bu alandaki diğer konular