The interview problem

Practice prompt

A customer offers a read replica for your AI data extraction, but long queries are canceled and replication lag rises. Diagnose the tradeoff and agree on a safe access pattern.

Original practice, not a reported company interview. All scenarios and worked numbers are illustrative. Interview date: not applicable. Sources retrieved September 30, 2026.

1. Scope and assumptions

Read-only access does not mean zero operational impact. Ask about replica role, recovery requirements, query cancellation policy and the freshness the pilot actually needs.

2. Worked approach

disputed scan
  → replay/resource diagnosis
  → bounded extraction plan
  → monitored trial
  → owner approval

Reproduce one canceled query with the database owner and inspect duration, plan, scanned volume and replay-conflict signals. Separate resource contention from recovery conflicts. Define bounded extraction windows, selective queries and a timeout policy before increasing database settings.

For heavy repeatable scans, consider a dedicated analytical snapshot or export so the recovery replica retains its operational role. Use checkpoints for completed chunks and a consistent-snapshot strategy when cross-chunk consistency matters. Agree on an owner, resource budget and an abort condition based on lag and production health.

3. Calculate the example

A scan reading 300 GB at an effective 100 MB/s takes about 3,000 seconds, or 50 minutes, ignoring CPU and other overhead. Breaking it into 30 chunks of 10 GB reduces individual work to about 100 seconds, but does not guarantee one coherent database snapshot across all chunks. If the customer permits only 30 seconds of replay delay, merely allowing a 50-minute query to block replay violates the stated requirement.

4. Failure cases and trade-offs

Turning off cancellation can transfer the problem into growing lag or retained old data. Retrying the whole scan after every cancellation wastes capacity. A watermark based on mutable timestamps can miss updates between chunks.

A dedicated export costs storage and setup but isolates the pilot. Chunked replica reads are simpler when eventual consistency is acceptable. Tuning standby behavior is a database-owner decision backed by measured recovery impact, not a hidden connector default.

5. Validate the result

Run a controlled extraction with lag, resource and cancellation monitoring. Verify resumability and compare output against an agreed snapshot sample. Have the database owner approve the operating envelope and rollback trigger.

6. Interview follow-ups and self-review

Which consistency guarantee does the exported dataset need? How are deletes captured?

Reward read-only impact awareness, a reproducible diagnosis, duration arithmetic and negotiated database limits.

Sources and related practice

Technical reference: www.postgresql.org — Standby query/recovery conflict background; customer plan and figures are original.

Exact publication/update date not established in this review. Retrieved September 30, 2026. This reference supports the named technical concept; the proposed workflow and examples are original, not a documented vendor implementation or interview report.

Continue with Investigate an AI customer’s capacity and cost problem; Design point-in-time database recovery.

Continue your preparation

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