The interview problem

Practice prompt

Design automated certificate rotation for 100,000 service instances using mutual TLS. Rotate ordinary workload credentials and migrate from trust root R0 to R1 without interrupting healthy traffic. Some workloads are disconnected from the control plane. Explain the difference between planned rotation and responding to a compromised authority.

Original system-design practice, not a reported company interview. Fleet sizes, deadlines and rollout protocol are illustrative design assumptions. Primary reference retrieved September 27, 2026; publication date not stated; interview date not applicable.

1. Separate identity, authorization and trust

A workload certificate proves an identity through a validated chain and possession of its private key. Authorization still decides whether that identity may perform the requested operation. Rotation must preserve intended identities and policy boundaries; accepting any certificate signed by a trusted CA is insufficient.

Assume six-hour workload certificates, a target renewal interval of three hours with jitter, and clocks kept within two minutes of the reference time. These are design choices, not universal recommendations. Private keys belong to isolated workload instances or their trusted local proxy. Do not copy one fleet-wide private key into every container.

Track three separately versioned artifacts: the serving certificate and key, the trusted CA bundle, and authorization policy. Their lifecycles interact but are not interchangeable. Rotating a leaf certificate is not the same operation as adding or removing a root. Stopping issuance does not revoke certificates already issued.

2. Build a renewable identity path

platform identity / workload attestation
                  ↓
     regional identity issuer → protected signing authority
                  ↓
       local identity agent / isolated proxy
                  ↓
        atomic certificate-and-key installation
                  ↓
       mTLS handshake → identity authorization

versioned trust-bundle controller → agents → validator snapshots
                               ↘ fleet acknowledgments / probes

Use attestation to bind an eligible workload to its allowed identity. Limit issuer privileges by environment and trust domain. Keep signing authority access narrowly scoped and audit issuance decisions without recording private keys. A workload must not be able to request an arbitrary peer's identity merely by providing its name.

The local agent obtains credentials and bundles through an authenticated bootstrap path. Existing service credentials must not be the only recovery mechanism: an expired workload needs a controlled way to re-attest through platform identity. Conversely, expiration must not open an unauthenticated enrollment shortcut.

SPIFFE provides a useful identity model and Workload API for obtaining short-lived X.509 identity material and trust bundles. The orchestration, acknowledgments and rollout gates below are proposed design choices; they are not guarantees supplied automatically by that API.

3. Rotate leaf credentials atomically

Renew well before expiry with randomized timing, bounded retries and increasing backoff. Generate or obtain a new key through the approved identity mechanism. Verify key/certificate correspondence, identity, validity period and chain before installation. Never install a new certificate alongside the previous private key by accident.

Build an immutable TLS configuration snapshot and atomically switch new handshakes to it. Existing connections may still use a prior authenticated context. Measure the library's actual behavior: replacing files on disk does not prove that the process reloaded them, and replacing credentials does not necessarily terminate existing connections.

Retain the previous still-valid configuration briefly if it is safe and useful for rollback. Do not roll back to a compromised identity key or deliberately extend an expired credential. If renewal fails, alert on remaining validity and restore the identity path before the deadline. After expiry, fail authentication for new handshakes rather than disabling certificate verification.

4. Expand trust before changing issuance

For a planned root migration, first distribute bundle generation G1 containing both R0 and R1. Each acknowledgment must identify the workload instance, validator process and loaded bundle generation. An acknowledgment that a file was downloaded is weaker than proof that the active validator uses it.

Exercise both directions of mTLS with synthetic clients and servers under each chain. A server's trust update does not prove that every client trusts its new certificate. Include gateways, batch clients, recovery environments and newly launched instances in the membership model.

Only switch eligible serving cohorts to R1 after their communication peers can validate it. Instances that cannot satisfy the gate must be drained or isolated from the cohort, not quietly treated as updated. New admissions must load an acceptable bundle before receiving traffic. An old machine image must not reintroduce an R0-only validator after the gate passes.

Then stop all R0-backed issuance, including intermediate CAs and forgotten regional issuers. Record a verified cutoff. Wait until old-chain credentials and relevant cached authentication state have been retired before removing R0 from active validators. If any issuer can still mint a usable old chain, the expiration bound based on the cutoff is invalid.

5. Work through the overlap window

At 09:00, begin distributing the dual-root bundle. By 10:00, all admitted validators have acknowledged G1 and passed probes; unreachable instances have been excluded. At 10:00, switch issuance to R1 and verify that R0 issuance has stopped everywhere. For this example, issuance records verify that the latest encoded notAfter among all usable R0 leaves is no later than 16:00. Do not infer this ceiling from six-hour lifetime and cutoff alone: an issuer clock ahead of reference time or a pre-issued future-dated leaf can move it later.

With a maximum two-minute slow validator clock and no additional expiry grace, that leaf might still be accepted until nearly 16:02 reference time. This bound assumes the stated clock bound is enforced and that no extra library tolerance is enabled. A skew alert is therefore part of the rollout gate, not merely a dashboard decoration.

Suppose authenticated connections have a hard 30-minute maximum age. An old-chain connection admitted near 16:02 could remain until nearly 16:32. Drain old authenticated contexts and require full reauthentication before declaring old identity use retired. In this example, reject old-root resumption no later than 16:02, including tickets derived from earlier resumed sessions, so a new connection cannot restart the 30-minute window indefinitely. TLS session resumption can preserve prior authentication without presenting a fresh certificate; rotate or invalidate relevant ticket/session state and verify implementation behavior. Without a bound on that state, the 16:32 reasoning is incomplete.

At or after 16:32, with those conditions verified, remove R0 through another acknowledged bundle rollout. The migration is not globally complete when the controller publishes G2; completion requires admitted validators to apply it. A workload that missed G1 cannot safely be returned to service simply because its old certificate has not yet expired.

6. Size renewal and failure recovery

With 100,000 instances renewing every three hours on average, steady issuance is 100,000/10,800≈9.26 certificates per second. At an illustrative average 1.2 attempts per successful renewal, plan for about 11.11 attempts per second before headroom. Real capacity planning also includes startup bursts and signing-service latency.

If 20,000 instances need recovery over ten minutes, that adds about 33.33 successful renewals per second. Adding the steady load and applying the same attempt multiplier gives (33.33+9.26)×1.2≈51.11 attempts per second. This is a recovery scenario, not a measured peak; admission limits, queues and backoff must keep it from becoming a synchronized storm.

A 20 KB bundle sent once to 100,000 instances transfers about 2 GB in decimal units, excluding protocol overhead and retries. Bandwidth is usually less difficult than ensuring the right processes have actually adopted the bundle. Measure oldest loaded generation, remaining certificate validity and probe outcomes, rather than relying only on a high aggregate success percentage.

7. Distinguish availability incidents from compromise

An issuer outage can be tolerated while cached certificates remain valid, subject to authorization and trust policy. Maintain redundant issuance infrastructure and test recovery from an expired workload. Lengthening certificate lifetimes buys outage tolerance but increases exposure after key theft. Short lifetimes increase operational pressure and do not themselves guarantee prompt revocation.

A suspected R0 compromise changes the objective. Continuing to trust R0 during a leisurely overlap allows an attacker with its signing capability to mint new credentials. Prefer rapid trust removal, connection/session invalidation and isolation, accepting an availability impact where necessary. Do not label a planned zero-interruption migration protocol an emergency containment procedure.

A stolen leaf key may justify identity or issuer-and-serial denial at enforcing proxies while replacements roll out. This only helps where the denial is actually applied. Standard certificate-status mechanisms likewise require explicit distribution and checking behavior; do not assume every service validates revocation by default. Track remaining exposure across long-lived connections and disconnected validators.

A stale issuer can invalidate the entire expiry calculation. A stale validator can accept a removed root after the control plane declares success. Fence issuers, bound configuration freshness where justified, and quarantine unreachable members. If the design permits indefinitely disconnected members to keep serving, it cannot promise a bounded global trust-removal deadline.

8. Test the migration and its rollback boundary

Test all four old/new client-server certificate pairings under old-only, dual and new-only bundles. Assert both expected handshake outcomes and authorization decisions. Inject expired leaves, wrong identities, missing intermediate chains, mismatched keys, clock skew, issuer outage and missed bundle updates.

Run long-lived and resumed connections through trust removal to verify the declared cutoff. Restart an old image and bring an offline workload back after the migration. Test that it re-attests and loads current trust before admission. Observe certificate fingerprints, issuer generations and errors without collecting private material.

Before removing R0, a non-security rollout failure may allow stopping R1 issuance while the dual bundle still accepts both chains. After R0 removal, blindly restoring an old leaf can break authentication. During compromise, restoring R0 trust may restore attacker access. State the safe rollback point for each phase, with a separate incident procedure for compromised material.

9. Trade-offs and follow-ups

A proxy centralizes credential reload and enforcement but adds infrastructure and a trust boundary. Application-native TLS avoids that hop but spreads compatibility requirements across libraries. Cross-signing can support some migrations, but creates additional chain-selection and trust-path cases that must be tested; this solution assumes explicit dual-root bundles.

Follow-ups: What happens if one region misses the issuance cutoff? How do you prove an acknowledgment came from the active validator? How does session resumption affect root removal? Can a disconnected workload safely serve forever? What is the recovery path after every local certificate expires? When is downtime the correct security trade-off?

10. Self-review rubric

  • Separate certificate identity, trust bundles and authorization.
  • Install matching keys and certificates atomically.
  • Expand trust before issuing under the new root.
  • Include peer direction, membership changes and stale issuers.
  • Calculate expiry, clock and connection-state bounds explicitly.
  • Verify session-resumption behavior rather than assuming fresh validation.
  • Distinguish planned migration from emergency compromise response.
  • Test stale workloads and define phase-specific rollback limits.

Sources and related practice

SPIFFE Concepts, publication date not stated; retrieved September 27, 2026. Primary reference for workload identity, X.509-SVIDs, trust bundles and renewable credentials. The rollout protocol, timelines and capacity examples are original design practice.

RFC 8446: TLS 1.3, published August 2018; retrieved September 27, 2026. Primary protocol reference for PSK session resumption; operational invalidation gates here must be implemented and tested in the chosen TLS stack.

Continue with distributed configuration rollout and customer network boundaries.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.