Scrivio Interview library
ScenarioPrincipal7 min read · updated 12 November 2026

Regulators require that no personal data appears in non-production systems, but your integration tests and staging environments have used production copies for a decade. How would you plan the exit?

I would plan the exit as a programme with four phases. First, inventory every place production data is copied and every test that depends on it, and rank them by risk. Second, build synthetic data generation for the main domain entities with realistic edge cases. Third, replace copies system by system, starting with the highest-risk data, and accept that some tests must be rewritten because they relied on specific real records. Throughout, add controls that block new copies and audit existing environments, so the problem cannot grow back while we remove it.

Why this question is asked

A decade of production copies means the copies are no longer a practice; they are part of how the company works. Staging environments, regression suites, training systems, support sandboxes and vendor integrations all quietly assume real data. A regulator's requirement turns that into a deadline. Interviewers ask this at the most senior level because it is a programme, not a fix: it needs an inventory nobody has, engineering work that competes with features, controls that change people's habits, and honest conversations about what will break. In this answer, we will walk through the plan phase by phase, with the reasoning behind the order, the trade-offs at each step, and how to show the regulator progress along the way.

1Phase 1: Find Every Copy and Every Dependency

We cannot remove what we have not found. The inventory has two halves. The first is where production data goes: database restore jobs, export scripts, backups restored to non-production, data pipelines feeding analytics sandboxes, files on shared drives and laptops, and copies held by vendors. Infrastructure records, backup tool logs, cloud storage listings and network flows from production to other environments all help, and so does simply asking every team lead.

The second half is who depends on that data. For each environment, which test suites, manual test scripts, training courses or support processes would break without it? A regression suite that looks up 'customer 48213 with an expired card' depends on a specific real record. A performance test depends on real volumes. A training environment depends on realistic-looking screens. Each dependency gets an owner.

Then we rank. Risk comes from what the data contains, such as health data, payment data or children's data, how widely the environment is accessible, and how far from production controls it sits. A vendor sandbox with full customer records ranks above an internal staging database with a subset of order data.

Excerpt from the inventory
EnvironmentData copiedDepends on itRisk
Vendor UAT sandboxFull customer and payment recordsPartner integration testsHighest
StagingNightly restore of main databaseRegression suite, manual QAHigh
Performance labMonthly full copyLoad tests needing real volumeHigh
Developer laptopsAd hoc extractsDebugging, local testingHigh, poorly known
Training systemQuarterly subsetCall centre trainingMedium

2Phase 2: Build Synthetic Data for the Main Entities

Replacing copies needs something to replace them with, so the engineering starts early, in parallel with the inventory. A central team builds synthetic data generation for the core domain entities: customers, accounts, orders, payments, contracts, whatever the business revolves around. The generators must respect every constraint, so relationships between tables are valid, and follow realistic distributions derived from aggregate statistics about production rather than from individual records.

Edge cases are where synthetic data earns its keep. Ten years of tests found bugs because real data contained odd things: names with apostrophes, addresses in non-Latin scripts, customers with three hundred accounts, accounts opened on 29 February, amounts at exactly a limit, records migrated from a system retired in 2017 with half-empty fields. Each known oddity becomes a deliberate scenario in the generator, and the teams that relied on real data are the best source of that list. The generator is versioned, seeded so runs are reproducible, and able to produce a small dataset for a laptop or a hundred million rows for the performance lab.

3Phase 3: Replace the Copies System by System

With the inventory ranked and generators available, we replace copies in risk order. For each environment, the owner team switches its refresh from a production restore to a synthetic load, runs its suites, and fixes what breaks. The highest-risk environments go first even when they are not the easiest, because the regulator cares about risk reduced, not about the number of environments done.

Here we must be honest: some tests will need rewriting. A test that asserts on a specific real customer, or relies on a combination of facts that just happened to exist in production, cannot survive the switch. Those tests are rewritten to create or request the scenario they need. That work is budgeted per team from the start rather than discovered as overruns, because pretending every test will just work is the quickest way to lose the teams' trust. A few cases, such as performance tests needing true production skew, may get a time-limited exception through a masked and audited pipeline, approved by the privacy office, with an end date.

Step throughExiting production copies
  1. Inventory copies and dependenciesEvery environment, export and vendor copy, with an owner
  2. Rank by riskSensitivity of data, access breadth, distance from prod controls
  3. Block new copies nowRestore jobs and exports need privacy approval
  4. Build synthetic generatorsCore entities, real constraints, known edge cases
  5. Switch highest-risk environmentLoad synthetic data, run suites, rewrite tests on real records
  6. Any environment still on copies?
    YesTake the next one in risk orderNoAudit everything and close the programme
  7. Audit environments continuouslyScans for personal data, reported to the regulator

7 steps in order. Play them, or step through them one at a time.

4Controls That Stop the Problem Growing Back

Removing copies is pointless if new ones keep appearing, so controls start in week one, not at the end. Database restore and export jobs from production to anything else require an approval that the privacy office owns; most are simply switched off. Network rules prevent non-production environments from reading production data stores. Automated scans look for personal data in non-production databases and storage, for example email addresses outside the reserved test domains, real card number patterns or national id formats, and report what they find.

Audit gives us evidence for the regulator. Each environment has a status: still on copies, exception approved until a date, or clean, with scan results attached. A monthly report shows the risk-weighted progress. Regulators generally respond better to a credible plan with visible, measured progress than to a promise of a big switch at the end.

5Running It as a Programme

A change of this size needs a sponsor at executive level, a central team that owns the generators and the controls, and named owners in every team with environments to migrate. The timeline should be agreed with the regulator or with legal counsel who speak to them, with milestones such as 'vendor copies removed in six months, all high-risk environments in twelve, everything in eighteen'. The numbers depend on the company; the shape, risk first with controls from the start, is what matters.

Finally, the programme leaves a lasting benefit that is worth selling internally. Tests that create their own data are more reliable and can run in parallel and on laptops, environments refresh in minutes instead of overnight, and onboarding no longer requires production data access. Framing the work as improving testing, not only satisfying a regulator, keeps teams engaged.

6Follow-up questions

What about backups restored for disaster recovery tests?

Those are production data used for a production purpose, so they belong inside the production boundary. The recovery test should restore into an environment with production-level controls and access, and the environment should be destroyed afterwards. It should not double as a staging or test environment.

How do you handle third-party vendors that require real data in their test systems?

Vendor copies usually rank highest, because the data leaves our control. We work with each vendor to accept synthetic data, which usually means generating records that pass their validation, such as valid-format but non-issued identifiers. Where a vendor cannot, the contract and the data processing agreement must say so explicitly, and the exception goes to the privacy office with an end date.

How do you prove to the regulator that no personal data remains?

With continuous evidence rather than a statement. Automated scans of every non-production environment for personal data patterns, an inventory showing every environment's status, access logs, and the blocked export jobs together show that copies were removed and cannot come back. Scans are not perfect, so they are combined with the controls that prevent copying in the first place.

7Conclusion

In this answer, we planned the exit from a decade of production copies as a programme. We start with an inventory of every copy and every test or process that depends on it, ranked by risk. A central team builds synthetic generators for the main domain entities, including the edge cases real data used to provide. Environments switch to synthetic data in risk order, and tests that relied on specific real records are rewritten with time budgeted for it. Controls that block new copies and audits of existing environments start on day one, giving the regulator measurable evidence of progress.

What to say in the interviewAbout 90 seconds aloud

Open with

I'd treat it as a programme with an executive sponsor and run it risk first. Step one is an inventory, because after ten years nobody knows every copy: restore jobs, export scripts, the performance lab, vendor sandboxes, extracts on laptops.

Then, if they want more

For each one I also record what depends on it, which test suites, manual QA, training or support processes, and an owner, and then rank by risk: how sensitive the data is, how many people can reach it, and how far it sits from production controls. Vendor copies with full customer records usually come first.

At the same time I'd put controls in place immediately, so the problem stops growing: production restores and exports to non-production need privacy approval, network rules block non-prod from prod data stores, and automated scans look for personal data in non-prod environments.

In parallel, a central team builds synthetic generators for the core entities, with valid relationships, realistic distributions from aggregate statistics, and the edge cases teams used to get from real data, like odd names, leap-day dates or migrated records with missing fields. Then we switch environments one by one in risk order.

I'd be upfront that some tests will need rewriting because they relied on specific real customers, and budget that time. Rare needs like production-skew performance tests get time-limited masked exceptions. Progress is reported to the regulator as a risk-weighted status per environment, backed by the scans.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Regulators require that no personal data appears in non-production systems, but your...": https://scrivio-interview-library.netlify.app/java/integration-testing/e1565e66d7/