16. Short Q&A Prompts

Senior drills to demonstrate depth, production realism, and crisp trade-off articulation.

  • Explain G-M-P scheduling and how a blocking syscall is handled.

  • Channels vs mutexes: when to prefer each and why?

  • Show a bounded concurrency pattern (channel or x/sync/semaphore).

  • Define the Go memory model's happens-before relation with a small example.

  • Identify and fix a typed-nil error pitfall.

  • Design idempotent write APIs with Idempotency-Key and dedup storage.

  • Prevent cache stampede: lock, TTL jitter, refresh-ahead, single-flight.

  • HTTP server hardening: which timeouts prevent slowloris and why?

  • Tune http.Transport pools and timeouts for a busy downstream.

  • gRPC reliability: deadlines, retries, backoff, and message size caps.

  • Transactional Outbox: why it solves dual writes; outline the relayer.

  • Detect and prevent goroutine leaks; where to check ctx.Done().

  • Explain scheduler preemption and when to chunk CPU-heavy loops.

  • sync.Map vs map+RWMutex: trade-offs and use cases.

  • JSON performance: streaming, pooling, and codegen approaches.

  • Histograms: pick buckets for a 200ms p99 SLO.

  • JWT validation with JWKS rotation and kid cache.

  • Conditional requests with ETag and 304 handling.

  • Loop var capture in goroutines; show the correct pattern.

  • Design a multi‑region active‑active data model and conflict resolution.

  • Choose between a weighted semaphore and a bounded queue; justify backpressure.

  • Explain Minimal Version Selection (MVS) and its impact on dependency upgrades.

  • Container memory tuning: when to use GOMEMLIMIT vs GOGC.