← mercor Interview Insights

mercor·Software Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

Interviewed at Mercor for an Infrastructure Engineer role. The technical portion leaned heavily on Kubernetes internals, specifically around stateful vs stateless workloads. Pretty focused session, not a lot of fluff.

Questions Asked (1)

Q1

Walk me through the differences between a ReplicaSet or Deployment and a StatefulSet in Kubernetes, covering pod identity, storage, ordering behavior, rolling updates, and when you'd actually pick one over the other.

System DesignTechnical Trade-offs
Author's notes

This is one of those questions that sounds straightforward until you're mid-answer and realize you're conflating things.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the core distinction: ReplicaSet/Deployment manage stateless, interchangeable pods, while StatefulSet manages stateful pods with stable identities and storage. Then systematically compare them across pod identity, storage, ordering, and rolling updates, and finish with concrete scenarios for choosing one over the other.

Pro tip: Emphasize that StatefulSet is not just about persistent storage—it's about stable network identity and ordered operations, which are critical for distributed systems like databases and message queues. Mention that Deployments are preferred for stateless services even if they use persistent volumes, as long as identity doesn't matter.

1. Define the core difference

State that ReplicaSet/Deployment are for stateless applications where pods are interchangeable, while StatefulSet is for stateful applications requiring stable identity and storage.

2. Compare pod identity

Explain that StatefulSet pods get stable hostnames (e.g., pod-0, pod-1) and ordinal indexes, while ReplicaSet pods have random names and no stable network identity.

3. Compare storage

Describe how StatefulSet uses volumeClaimTemplates to give each pod its own PersistentVolumeClaim, ensuring data persistence across rescheduling, whereas ReplicaSet pods typically share or have no persistent storage.

4. Compare ordering and rolling updates

StatefulSet creates, scales, and updates pods in order (0 to N-1) and waits for each to be ready; Deployments update pods in parallel with no ordering guarantees.

5. Discuss use cases and trade-offs

Give examples: use StatefulSet for databases (MySQL, Cassandra), message queues (Kafka), or any app needing stable identity; use Deployment for stateless web servers, APIs, or workers. Mention that StatefulSets are more complex and slower to scale.

Key Points to Mention

  • Pod identity: StatefulSet pods have stable hostnames and ordinal indexes; ReplicaSet pods have random names.
  • Storage: StatefulSet uses volumeClaimTemplates for per-pod PersistentVolumeClaims; ReplicaSet pods typically use ephemeral storage or shared volumes.
  • Ordering: StatefulSet ensures ordered creation, scaling, and deletion; ReplicaSet/Deployment have no ordering guarantees.
  • Rolling updates: StatefulSet updates pods sequentially in reverse ordinal order; Deployment updates pods in parallel with configurable surge/unavailable.
  • Use cases: StatefulSet for stateful apps like databases, message queues; Deployment for stateless apps like web servers, APIs.
  • Trade-offs: StatefulSet is more complex, slower to scale, and requires headless service; Deployment is simpler and more flexible for stateless workloads.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.