Skip to content
Veltoryx Technologies
ProLesson 15.2Advanced26 min readUpdated 31 October 2026

Interview Mastery: Architect, Failure Scenarios & Trade-Off Decisions

Master 75 staff-level questions covering Solution Architecture, Tech Lead decisions, real production failure edge-cases, and architecture trade-offs.

Staff Engineers and Solution Architects are not evaluated on whether they know how to write code. They are evaluated on their ability to navigate complex architectural trade-offs, balance business velocity against reliability, and design self-healing systems that survive failure.

This lesson covers 75 advanced questions across Solution Architecture, Production Failure Scenarios, and Architectural Decision Matrices.

01Category 5: Tech Lead & Solution Architecture (Questions 76 - 100)

Q76: When should an organization choose a Modular Monolith over Microservices?

Answer: When a domain is nascent, product-market fit is still evolving, the engineering team is small (< 15 engineers), or cross-domain boundaries are unclear. A Modular Monolith provides strict architectural encapsulation (Java packages, separate Gradle modules, strict public API interfaces) within a single deployment artifact, avoiding network latency, distributed data complexity, and operational overhead until organizational scaling necessitates physical decoupling.

Q77: What are the telltale warning signs of a "Distributed Monolith"?

Answer:

  1. All microservices must be deployed together in a lockstep release window.
  2. Changes to a database schema in one service require simultaneous code changes across 5 other services.
  3. High latency resulting from deeply nested synchronous HTTP call chains (A -> B -> C -> D -> E).
  4. Sharing a single database across multiple services.
  5. Inability to run a single service locally without launching 30 other services.

Q78: How do you establish correct Bounded Context boundaries in a legacy domain?

Answer: Use Strategic Domain-Driven Design (Event Storming):

  1. Gather business domain experts and software engineers.
  2. Identify all business domain events (OrderPlaced, InvoiceIssued, ParcelShipped).
  3. Identify the business aggregates that produce and handle those events.
  4. Group aggregates with high cohesion and shared ubiquitous language into bounded contexts.
  5. Create a Context Map documenting upstream/downstream relationships (Partnership, Customer/Supplier, Conformist, Anti-Corruption Layer).

Q79: How do you handle Cross-Cutting Concerns across 50+ microservices without creating shared library hell?

Answer:

  1. Sidecar Pattern / Service Mesh: Offload network routing, mutual TLS (mTLS), distributed tracing header propagation, and telemetry collection to a sidecar proxy (such as Envoy) rather than embedding thick client libraries.
  2. Standardized Starters: Provide lightweight, backward-compatible Spring Boot starters (e.g. veltoryx-observability-starter, veltoryx-security-starter) that auto-configure standard filters without forcing business logic dependencies.

Q80: What is the Database-per-Tenant vs Schema-per-Tenant trade-off in Multi-Tenant SaaS?

Answer:

  • Database-per-Tenant: Highest isolation and security; easiest compliance (HIPAA, GDPR); simple backup/restore per customer. Drawbacks: higher infrastructure cost, connection pool overhead across hundreds of tenant databases.
  • Schema-per-Tenant: Good balance; separate schemas within a shared database engine.
  • Shared Database / Shared Table (Tenant ID Column): Lowest cost and easiest pooling; highest risk of noisy neighbors and catastrophic cross-tenant data leaks if queries omit WHERE tenant_id = :id.

Q81: How do you design a Zero-Trust Microservices Network?

Answer:

  1. Never assume traffic inside the internal network perimeter is safe.
  2. Require Mutual TLS (mTLS) for every inter-service TCP connection with short-lived, automatically rotated X.509 certificates.
  3. Enforce Identity-Based Authorization: verify both the caller identity (SPIFFE ID / Service Account) and the end-user identity (JWT token relay).
  4. Restrict network egress and ingress using Kubernetes Network Policies.

Q82: How do you manage secrets (database passwords, API keys) across a fleet of microservices?

Answer:

  1. Never hardcode secrets in source code, configuration files, or Docker images.
  2. Store secrets in an enterprise secrets manager (HashiCorp Vault or AWS Secrets Manager).
  3. Inject secrets into containers dynamically via memory-mounted volumes (tmpfs) or Spring Cloud Vault integration.
  4. Enforce automated 30-day secret rotation without service downtime.

Q83: What is the difference between Orchestration and Choreography in complex business workflows?

Answer:

  • Choreography: Each microservice reacts to events and publishes new events without a central coordinator. Best for simple 2-to-3 step workflows. Vulnerable to cyclical dependencies and difficult to audit at scale.
  • Orchestration: A centralized workflow engine commands participant microservices explicitly and tracks state in an immutable state machine. Best for complex, mission-critical transactions (e.g. loan approval, multi-stage order fulfillment) requiring explicit SLAs and compensation handling.

Q84: How do you design an API Gateway for high availability (99.999% SLA)?

Answer:

  1. Deploy multiple Gateway instances across a minimum of 3 Availability Zones with Kubernetes Pod Topology Spread Constraints.
  2. Front Gateway pods with an Elastic Network Load Balancer (NLB) with active multi-zone IP health checking.
  3. Keep the Gateway stateless: zero in-memory session state.
  4. Cache JWKS public keys locally in memory with a 24-hour fallback so Gateway routing continues if identity providers experience outages.
  5. Implement localized token-bucket rate limiting using Redis Cluster with Sentinel failover.

Q85: What is the Anti-Corruption Layer (ACL), and when should you reject adopting it?

Answer: An ACL translates foreign domain models into clean local models. You should adopt it when integrating with legacy systems or third-party vendors. You should reject adopting it when two internal services belong to the same team and agree on a shared ubiquitous model, or when adopting a Conformist relationship with a standardized industry protocol where translation adds unnecessary overhead.

Q86: How do you prevent "Entity Anemia" in microservice domain models?

Answer: In anemic domain models, entities are merely bags of getters and setters, and all business logic lives in giant Procedural Service classes. Combat this by practicing Tactical DDD: encapsulate business validation, state transitions, and business invariants directly inside Domain Entities and Aggregates (order.cancel(), account.debit(amount)), keeping Service classes strictly focused on orchestration and transaction boundaries.

Q87: What is an Aggregate Root in Domain-Driven Design?

Answer: An Aggregate is a cluster of associated domain objects (entities and value objects) that are treated as a single unit for data changes. The Aggregate Root is the only entity through which external objects are permitted to interact with the aggregate. External code must never hold direct references to internal child entities, guaranteeing that all business invariants are consistently enforced.

Q88: How do you design an asynchronous event-driven microservice system that avoids cascading message storms?

Answer:

  1. Enforce Bounded Queues and consumer backpressure.
  2. Implement Dead-Letter Queues (DLQ) with maximum retry thresholds (e.g. 3 retries with jittered backoff) to isolate poison pill messages.
  3. Use Consumer Concurrency Throttling to prevent downstream database saturation.
  4. Monitor consumer group lag in Prometheus.

Q89: What is the role of an Ingress Controller vs an API Gateway?

Answer:

  • Ingress Controller: Typically operates at the Kubernetes infrastructure boundary (L4/L7), managing TLS termination, path-based routing into the cluster, and external DNS mapping.
  • API Gateway: Operates at the application boundary (L7), managing application-level authentication, JWT claims validation, dynamic rate limiting, response aggregation, request transformation, and protocol translation.

Q90: How do you handle file uploads in a microservices architecture without exhausting service memory?

Answer: Never stream large file bytes through microservice APIs or the API Gateway. Instead, adopt the Direct-to-Object-Storage Pattern:

  1. Client requests a pre-signed upload URL from the microservice (POST /api/files/presign).
  2. Microservice validates authorization and generates a temporary, cryptographically signed AWS S3 / Cloud Storage URL with a 5-minute expiry.
  3. Client uploads the file bytes directly to object storage via HTTP PUT.
  4. Storage webhook notifies the microservice that upload completed, keeping application servers completely free of file streaming overhead.

Q91: What is the Strangler Fig migration pattern's biggest risk, and how do you mitigate it?

Answer: Data synchronization drift between the legacy database and the new microservice database. Mitigate it by establishing a strict Single Source of Truth for each migrated feature, streaming changes asynchronously via Change Data Capture (CDC), and running daily automated reconciliation jobs to compare datasets and alert on divergences.

Q92: How do you ensure backward compatibility when changing an internal event schema?

Answer:

  1. Never remove or rename existing fields in event payloads.
  2. Add new fields as optional/nullable.
  3. Use a centralized Schema Registry with strict compatibility modes (BACKWARD or FULL) to reject incompatible producer commits during CI/CD.
  4. Implement the Tolerant Reader Pattern on all consumers: ignore unknown fields during deserialization.

Q93: What is the Tolerant Reader Pattern?

Answer: A service consuming data (JSON, XML, or binary) should be conservative in what it sends, and liberal in what it accepts (Postel's Law). Consumers should parse only the specific fields they need and silently ignore unexpected additional fields, allowing producers to add new fields without breaking existing consumers.

Q94: How do you design a Global Distributed System for Multi-Region Active-Active deployment?

Answer:

  1. Route users to the nearest regional data center using latency-based DNS (e.g. Route53) or Anycast BGP.
  2. Store stateless compute instances in all regions.
  3. For stateful data:
    • Partition data geographically (e.g. EU users in EU region, US users in US region) so local writes are strictly CP.
    • For global shared state, use conflict-free replicated data types (CRDTs) or active-active databases with multi-leader asynchronous replication and deterministic conflict resolution rules (e.g. Last-Write-Wins with TrueTime).

Q95: What is the difference between Vertical Pod Autoscaling (VPA) and Horizontal Pod Autoscaling (HPA)?

Answer:

  • HPA: Adds or removes container pod replicas dynamically based on CPU, memory, or custom metrics (e.g. scaling from 5 to 50 pods).
  • VPA: Adjusts CPU and memory resource requests/limits of existing pods. In standard Kubernetes, changing VPA limits requires pod eviction and restart, making it unsuitable for rapid, real-time traffic spikes.

Q96: How do you design microservices for Disaster Recovery (RPO and RTO)?

Answer:

  • RPO (Recovery Point Objective): Maximum acceptable data loss measured in time. Minimizing RPO requires synchronous multi-AZ database replication or continuous cross-region CDC streams.
  • RTO (Recovery Time Objective): Maximum acceptable downtime before service is restored. Minimizing RTO requires automated DNS failover, pre-warmed standby infrastructure, and automated database promotion scripts.

Q97: What is Chaos Engineering, and why is it necessary in microservices?

Answer: The discipline of experimenting on a distributed system in production to build confidence in the system's capability to withstand turbulent conditions. Tools like Chaos Mesh or Gremlin inject artificial latency, packet loss, container crashes, and disk failures to prove that circuit breakers, bulkheads, and fallback mechanisms work before real outages strike.

Q98: How do you prevent Cascading Failures during cold disaster recovery spin-up?

Answer: Apply the Circuit Breaker & Gradual Traffic Shedding Pattern:

  1. Do not open 100% of ingress traffic to cold infrastructure immediately.
  2. Warm up database connection pools and caches using synthetic replay traffic.
  3. Use Gateway traffic shedding to allow 10% of users, then 25%, then 50%, until JIT compilation and caches stabilize.

Q99: What is Contract Testing (Pact), and why is it superior to end-to-end integration tests?

Answer: End-to-end integration tests in microservices are brittle, slow, and expensive to maintain across 50 services. Consumer-Driven Contract Testing (Pact) allows consumers to define their API expectations as a machine-readable JSON contract. The provider executes the contract against its mock controller in isolation during CI. If the provider breaks the contract, the build fails before deployment.

Q100: What is the Single Responsibility Principle applied at the microservice level?

Answer: A microservice should have one, and only one, business reason to change. It should be bounded by a single cohesive business capability (e.g. billing, inventory, catalog), owned by one autonomous team, and scalable independently of unrelated capabilities.

Loading the rest of the lesson…