Synthetic Data Generation System

Privacy-Aware Training Data from Real Tables

Design a platform that learns the shape of a sensitive real dataset and produces synthetic rows that are useful for analysis and model training, measured for fidelity and privacy before anything leaves the secure zone.

Overview

Some of the most useful data a company holds cannot be handed around: patient records, card transactions, support chats. Analysts, vendors and model builders still need data with the same shape. A synthetic data platform trains a generative model (a generator) on the real table and samples new rows that follow the same distributions and correlations, without being any real person's row.

It is also used to top up rare cases: when there are 200 real fraud cases and a million normal payments, the generator can produce more rows that look like the fraud cases.

Two things make this a hard design. First, a generator can look good column by column and still be useless, because it lost the relationships between columns. Second, synthetic is not the same as anonymous: a generator can memorize and replay real rows, especially unusual ones. One study found that synthetic data either failed to stop inference attacks or lost much of its usefulness, and that it was hard to predict which (Stadler, Oprisanu and Troncoso, USENIX Security 2022). So every output is measured before release.

Questions to ask first

  • What kind of data? — Tables first (numbers and categories); text and images named only
  • Who receives the output? — Internal teams, and sometimes outside partners; outside release needs approval
  • Is a formal privacy guarantee required? — For regulated data, yes: differential privacy with a chosen budget
  • What is the output for? — Analysis and training models that are then evaluated on real data
  • How big are the tables? — Up to about 1 million rows and 50 columns
  • Is conditional output needed? — Yes: more rows of a rare class on request

What you will be able to do

  • Pick a generator for a table and explain what makes tabular data hard for it.
  • Measure a synthetic table three ways: column fidelity, usefulness (TSTR) and privacy (distance to closest record, membership inference).
  • Explain differential privacy and epsilon in plain words, and how DP-SGD trains a generator under it.
  • Design the release gate, the privacy budget ledger and lineage in SQL.
  • Answer the follow-ups: rare classes, bias, drift in the source, and what to say when asked 'is synthetic data anonymous?'.

Key concepts

  • Tabular GAN (CTGAN)
  • Mode-specific normalization
  • Conditional sampling
  • Fidelity metrics
  • Train on synthetic, test on real (TSTR)
  • Distance to closest record
  • Membership inference
  • Differential privacy (epsilon)
  • DP-SGD
  • Release gate and lineage

Functional requirements

  • Register a source table (a reference, never a copy) and train a generator on it as a job
  • Optionally train with differential privacy at a chosen epsilon and delta
  • Sample any number of rows, including rows with some columns fixed (for example label = fraud)
  • Evaluate each synthetic sample: column fidelity, pairwise relationships, TSTR utility, and privacy checks
  • Block release until the checks pass; outside release also needs a named approver
  • Record lineage: source version, generator version, parameters, evaluation and approver for every file

Non-functional requirements

  • Real data stays inside the secure zone; training and evaluation run there (a hard rule we chose)
  • A generator on a 1M × 50 table trains in a few GPU hours (our target)
  • Evaluation is reproducible: fixed splits, fixed seeds, versioned code
  • Every release decision is auditable for years (append-only records)
  • Privacy spend per source dataset is tracked and capped

Interview questions

  • Is synthetic data anonymous?
  • How do you know the synthetic data is good?
  • Explain epsilon to a product manager.
  • How does DP-SGD work, and where does it go in a GAN?
  • A fraud team has 200 real fraud cases. Can synthetic data help?
  • How do you stop the synthetic data from amplifying bias?
  • Two jobs try to spend the last of a table's privacy budget at once. What happens?
  • How would you scale this to many teams and bigger tables?

Sign up free to read the full topic

More System Design topics

Start free on Cariara · Coding problems · System design studio