TRT
Sign in
mediumAdvanceddesign

Draw the full architecture of a Kubernetes Controller / Operator using `client-go` (`Reflector`, `DeltaFIFO`, `SharedInformer`, `Indexer`.

Trace the 6 components in `sample-controller`, explain the `dirty`/`processing` workqueue sets, contrast in-cluster garbage collection (`ownerReferences`) with external cleanup (`finalizers`), and explain why mutating `Indexer` pointers corrupts shared memory.

TRT practice prompt — not a verified question from a named employer.

The Runtime Theory Team2 min read

A strong answer

A strong candidate frames Draw the full architecture of a Kubernetes Controller / Operator using client-go (Reflector, DeltaFIFO, SharedInformer, Indexer. around the exact memory layout, compiler semantics, and hardware execution model covered in [Controller Internals: SharedInformer (Reflector, DeltaFIFO, Indexer), Workqueue Deduplication, and.]. Trace the 6 components in sample-controller, explain the dirty/processing workqueue sets, contrast in-cluster garbage collection (ownerReferences) with external cleanup (finalizers), and explain why mutating Indexer pointers corrupts shared memory.

You write a custom Kubernetes Operator that provisions cloud databases whenever a PostgresCluster CRD is created or updated. A naive engineer writes an Edge-Triggered event handler: onModify(oldObj, newObj) { updateDatabase(newObj.Spec); }. Three bugs hit in production: (1) While updateDatabase() is blocked for 20 seconds waiting for AWS RDS, the watch event callback is stalled; (2) If updateDatabase() fails with a transient network error, that event edge is lost forever and the database stays permanently out of sync with newObj.Spec; and (3) If a user edits the CRD 5 times in 1 second, the handler fires 5 conflicting concurrent API calls!

When engineers encounter this bottleneck in production, a surface-level API description rarely explains what went wrong. In real workloads, every line of code executes against concrete hardware constraints: fixed-width memory cells, CPU cache lines, kernel descriptor tables, network socket buffers, or accelerator memory buses. Without a clear mental model of the client-go SharedInformer (Reflector -> DeltaFIFO -> Indexer -> Workqueue) and Level-Triggered Reconciliation, debugging degrades into guesswork—tuning timeouts, adding retries, or scaling instances blindly while the underlying architectural flaw remains untouched.

In a production interview, always connect the specification rule to its concrete runtime consequence: state what lives on the stack versus the heap or static storage segment, how the compiler or operating system validates alignments, lifetimes, and error codes, and what happens under adversarial or boundary inputs (such as zero-length buffers, integer overflow, concurrent mutation, or partial I/O). Backing your explanation with a small trace of register/memory state transitions immediately separates senior systems engineers from candidates who only memorized syntax.

What the interviewer is listening for

  • Mastery of core invariant: Trace the SharedInformer pipeline (Reflector -> DeltaFIFO -> Indexer -> ResourceEventHandler -> RateLimitingWorkqueue).
  • Mastery of core invariant: Explain how the Workqueue's dirty and processing sets coalesce rapid events and serialize per-key Reconcile calls.
  • Mastery of core invariant: Write idempotent Level-Triggered Reconcile loops using DeepCopy(), ownerReferences, finalizers, and loop-free Status updates.
  • Hardware and ABI awareness: Explaining how sizes, alignments, calling conventions, or kernel boundaries behave on real 64-bit targets rather than relying on implementation-defined assumptions.
  • Defensive engineering: Naming the exact compiler flags (-Wall -Wextra -Werror), static analyzers, or runtime sanitizers (-fsanitize=address,undefined,thread) that verify correctness in CI.

Common mistakes

  • Explaining only surface syntax without tracing the underlying memory addresses, ownership lifetime, or kernel/user-space state transitions.
  • Assuming undefined behavior (such as signed overflow, uninitialized reads, strict-aliasing violations, or dangling pointers) will "just work" because it passed an unoptimized -O0 debug build.
  • Ignoring return codes, partial reads/writes, alignment padding, or cleanup paths when an allocation or syscall fails midway through a function.

This answer walks

Practice follow-ups

  1. 01What happens if an Operator's `Reconcile` loop updates `obj.Status` (or adds a timestamp annotation) on **every single reconcile pass** even when nothing changed?
  2. 02What is the difference between **Cascading Deletion via `metadata.ownerReferences`** (handled automatically by Kubernetes's built-in Garbage Collector controller for child in-cluster resources like.

Not started

Sign in to save your learning progress.

Sign in to save