Skip to content
tezvyn:

Differential Privacy: Anonymize Data with Math

Source: Wikipedia: Differential privacyHardHow cards are made

Differential Privacy: Anonymize Data with Math

Differential Privacy adds mathematical noise to data queries, making it impossible to know if one person's data is included. Tech giants use it to learn from user behavior without seeing individual activity.

Why it exists

Simple data anonymization, like removing names, often fails. Individuals can be re-identified by linking other data points. Differential Privacy was created to provide a provable, mathematical guarantee that an individual's information is protected, even from sophisticated analysis.

The mental model

Differential Privacy is a promise: the output of a query will be statistically indistinguishable whether or not your personal data is in the dataset. It's like blurring a crowd photo just enough to see the crowd's size and shape, but not enough to recognize any single face. The presence or absence of one person doesn't change the overall picture.

How it works

It works by injecting a carefully calculated amount of random noise into the result of a statistical query (like a count or an average). The amount of noise is controlled by a parameter, epsilon (ε), which represents the 'privacy budget'. A smaller epsilon means more noise and stronger privacy. The mathematical framework guarantees that an attacker looking at the result cannot be sure if any specific individual was part of the computation.

When to use it

Use Differential Privacy when you hold a sensitive dataset and need to allow others to run statistical analyses on it in aggregate. It is used by the US Census Bureau to release public data, and by companies like Apple and Google to collect telemetry (e.g., popular emojis, browser settings) without accessing raw user data.

When not to use it

DP is not for situations that require perfect accuracy or access to individual records. A doctor needing a specific patient's exact medical history cannot use a differentially private system for that task. It's also less effective on small datasets, as the required noise can easily overwhelm the actual data, making the results useless.

One canonical example

The US Census Bureau uses Differential Privacy to protect respondent confidentiality in its public data releases. They add controlled noise to the statistical tables about population counts and demographics. This ensures that while the data is accurate enough for uses like redistricting, it is mathematically impossible to use the public data to find out the specific details of any single person or household.

Interview question

Which statement best describes the fundamental privacy guarantee of Differential Privacy?

  • a.It encrypts all sensitive individual data points before they are used in any analysis.
  • b.It makes it statistically indistinguishable whether any single individual's data was included in the dataset for a given query.Correct
  • c.It removes all unique identifiers from a dataset, making re-identification impossible.
  • d.It ensures that the final statistical results are perfectly accurate, regardless of data sensitivity.
Why?

Differential Privacy's core promise is that the output of a query will be statistically indistinguishable whether or not a specific individual's data is in the dataset. Option C describes simple anonymization, which the card states often fails and is what Differential Privacy was created to improve upon.

Just read this? Test yourself on what you have been reading.

Read the original → en.wikipedia.org

You just looked this up. Could you explain it out loud?

That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on data science — each one lists the topics its interview covers.

See open roles