CTO Systems Architecture & Infrastructure 4 — Questions and Answers
Question 1: A CTO must architect a real-time bidding platform that requires sub-5ms p99 response times at 1 million requests per second. Which infrastructure decision has the highest impact on meeting this SLA?
- Choosing PostgreSQL with connection pooling
- Deploying in-process caching with pre-warmed data and co-locating compute near network edge (Correct answer)
- Using a monolithic Java application with vertical scaling
- Implementing synchronous database writes on every bid request
Correct answer: Deploying in-process caching with pre-warmed data and co-locating compute near network edge
Sub-5ms p99 at scale requires eliminating network round trips to external stores; in-process caches and edge co-location are the dominant latency levers.
Question 2: Which load balancing algorithm is most appropriate for backend services where request processing time varies significantly (e.g., some requests take 1ms, others 500ms)?
- Round-robin
- Least connections (or least outstanding requests) (Correct answer)
- Random selection
- IP-hash sticky sessions
Correct answer: Least connections (or least outstanding requests)
Least-connections routes new requests to the server with the fewest active connections, naturally avoiding hot spots caused by slow requests holding connections.
Question 3: When implementing zero-downtime schema migrations for a high-traffic relational database, which technique avoids locking the table during an ALTER operation?
- Running ALTER TABLE during a maintenance window with application downtime
- Using an online schema change tool (e.g., pt-online-schema-change, gh-ost) that operates on a shadow copy (Correct answer)
- Dropping the old table and recreating it with the new schema
- Disabling foreign key checks during the migration
Correct answer: Using an online schema change tool (e.g., pt-online-schema-change, gh-ost) that operates on a shadow copy
Online schema change tools copy data to a shadow table while applying live writes via triggers, then atomically swap the tables without long locks.
Question 4: A CTO is evaluating a content delivery network strategy. Which caching behavior represents a security risk for authenticated API responses?
- Setting Cache-Control: no-store on all API responses
- Caching responses that include Set-Cookie or user-specific data without Vary: Cookie headers (Correct answer)
- Using short TTLs (under 60 seconds) for dynamic content
- Disabling caching for POST and PUT requests
Correct answer: Caching responses that include Set-Cookie or user-specific data without Vary: Cookie headers
Without a Vary: Cookie header, CDN edge nodes may serve one user's authenticated response to another user, leaking sensitive data.
Question 5: An engineering team debates between synchronous REST and asynchronous event-driven messaging for inter-service communication. In which scenario does asynchronous messaging provide the clearest architectural advantage?
- A user login flow that must return a session token immediately
- An order placed event that triggers inventory reservation, fraud check, and email notification concurrently (Correct answer)
- A real-time stock price feed that must push updates within 100ms
- A database read that returns a single user record
Correct answer: An order placed event that triggers inventory reservation, fraud check, and email notification concurrently
Asynchronous messaging enables fan-out to multiple consumers in parallel without the caller waiting, which is ideal for multi-step post-order processing.
Question 6: Which capacity planning metric is most useful for predicting when a stateful service will exhaust resources under organic growth?
- Current CPU utilization percentage
- Rate of resource consumption growth (derivative of usage over time) extrapolated to a saturation point (Correct answer)
- Peak request rate on the busiest day of the year
- Number of active database connections at noon
Correct answer: Rate of resource consumption growth (derivative of usage over time) extrapolated to a saturation point
The growth rate (slope) of consumption allows projection to a saturation threshold, giving the team a lead time for capacity increases.
Question 7: A CTO reviews a proposed microservices decomposition where each service owns its own database. Which anti-pattern most commonly undermines this boundary in practice?
- Services communicating via an API gateway
- Shared database schema where multiple services read and write the same tables (Correct answer)
- Using different database technologies per service
- Services that each maintain their own connection pool
Correct answer: Shared database schema where multiple services read and write the same tables
A shared database couples services at the data layer, negating independent deployability and allowing schema changes in one service to break others.
A CTO must architect a real-time bidding platform that requires sub-5ms p99 response times at 1 million requests per second.
Which infrastructure decision has the highest impact on meeting this SLA?