Data Governance, Contracts, and Classification Questions
Governing data at scale: data contracts between producers and consumers, schema evolution/compatibility, data classification and sensitivity tagging, access control, and lineage/cataloging. Covers policy, ownership, and compliance-driven controls over data. The governance layer over the technical stack.
You're responsible for classifying the sensitivity of columns in a shared CRM dataset (say, contacts and accounts tables) and setting access policy for several internal roles with different needs. Design a classification scheme, a column-level access policy per role, and a masking or tokenization approach for anyone exporting the data. What's the trade-off between tightening this and keeping the sales and analytics teams productive?
Sample Answer
Classify CRM columns by what they reveal, grant access per role against that classification rather than per table, and mask or tokenize on export by default so leaving the platform is never the path of least resistance for raw PII (personally identifiable information).
Classification scheme for the CRM columns
Using contacts and accounts tables as the concrete example:
| Tier | Example columns | Rationale |
|---|---|---|
| Restricted | contacts.ssn_or_tax_id, contacts.date_of_birth, accounts.bank_account_number | direct identifiers or financial instruments; high harm if exposed |
| Confidential | contacts.email, contacts.phone, accounts.annual_revenue, accounts.deal_value | personal contact info and competitively sensitive business data |
| Internal | contacts.account_id, contacts.lead_source, accounts.industry, accounts.territory | useful for business operations, low harm if seen broadly inside the company |
Column-level access policy per role
| Role | Restricted columns | Confidential columns | Internal columns |
|---|---|---|---|
| Sales rep (own accounts) | No access | Full access, own assigned accounts only (row-level filter) | Full access |
| Sales manager | No access | Full access, own team's accounts | Full access |
| Analytics / BI | No access | Masked (for example last-4-digits of phone, domain-only email) unless a specific approved analysis needs raw values | Full access |
| Finance | Access to bank_account_number only, no other restricted fields | Full access | Full access |
| Data platform admin | Audited emergency access only, logged and time-boxed | Full access | Full access |
The row-level filter for sales reps ("own assigned accounts only") is enforced the same way as the column policy: as a predicate attached to the underlying table or a secure view, not as a client-side filter the reporting tool could be misconfigured to skip.
Masking or tokenization for exports
Any export (a CSV download, a scheduled report to an external tool, an API pull) goes through a masking layer by default:
- Confidential columns default to masked on export. Email becomes domain-only (
***@acme.com), phone becomes last-4 visible. A sales rep exporting their own account list for a call sheet needs raw values, so an explicit "export unmasked" action is available but is logged with the requester, timestamp, and row count, distinct from the default masked export. - Restricted columns default to tokenized, not just masked, on export. A tokenized value (a random surrogate replacing the real value, with the mapping held in a separate, tightly access-controlled vault) preserves the ability to join or de-duplicate records by the token without ever putting the raw restricted value into an exported file. Reversing a token back to the real value requires a separate, audited request against the vault, not just re-running the export.
- Bulk exports get an extra gate. A single row export (one contact's card) and a 50,000-row bulk export carry very different risk, so exports above a configurable row threshold require a second approval regardless of role, since bulk exfiltration is the actual threat this control exists to catch.
Trade-off between tightening this and keeping sales and analytics productive
Tightening column access and masking exports protects the company from a breach or a compliance violation, but every added control point (an approval step, a masked-by-default value, a token that needs unmasking) adds latency to a sales rep who needs a phone number to make a call right now, or an analyst who needs to validate an anomaly against a real record.
The trade-off resolves cleanly along one axis: default to restrictive, make the unrestricted path fast for the common case. A sales rep's own assigned accounts should never feel gated (row-level access plus unmasked confidential fields, no extra click), because that is their actual job. What gets gated is the exceptional case: bulk export, cross-territory access, or restricted-tier fields. If the common case is fast and only the exceptional case has friction, sales and analytics stay productive while the actual risk surface (bulk exfiltration, restricted-field misuse) is where the friction concentrates. Getting this backwards, adding friction to the common case while leaving bulk export easy, is the pattern that both angers users and fails to reduce real risk.
You're responsible for PII controls across a whole analytics toolchain: SQL, a BI tool, object storage, and notebooks. Design the policies and technical controls (masking, tokenization, RBAC, audit logging) plus the automation needed to catch accidental PII leakage, while still letting authorized analysts do their real work in each of those tools.
Sample Answer
Apply the same classification and controls consistently across all four surfaces (SQL, the BI tool, object storage, and notebooks) rather than securing the warehouse well and treating the other three as afterthoughts, since the surface most likely to leak PII (personally identifiable information) in practice is whichever one gets the least attention.
Policies and technical controls, per surface
| Surface | Access control | Masking / tokenization | Audit logging |
|---|---|---|---|
| SQL / warehouse | Role-based access control (RBAC) at the dataset and column level | Column masking policies applied at the table, inherited by every query | Query-level logging: user, query text, columns touched |
| BI tool | Users mapped to warehouse roles via single sign-on (SSO); no direct base-table access, only through governed views/models | Masked fields carried through from the underlying view; exports of masked data stay masked | Dashboard view and export events logged separately from raw query logs |
| Object storage | Bucket- or prefix-level IAM (identity and access management) policies; PII-containing prefixes segregated from general-purpose data | Encryption at rest by default; for raw PII dumps, tokenize sensitive fields before landing in a broadly-readable prefix | Object read/write access logged at the storage layer (for example S3 server access logs or equivalent) |
| Notebooks | Ephemeral, scoped credentials issued per session rather than long-lived personal keys baked into notebook code | Notebooks connect through the same masked views as SQL access, not directly to raw tables, by default | Session start/stop and query history logged the same as any other warehouse client |
Automation to catch accidental PII leakage
Policy alone doesn't catch the actual failure mode, which is usually someone unintentionally exporting or printing raw PII while doing legitimate work, not a deliberate breach attempt. Layer in automated detection:
- Static scanning of notebook code and BI exports. A scheduled or pre-commit scan for the pattern of a raw PII column name (
email,ssn) appearing in an unmasked query result or a notebook's saved output cell, flagging it for review rather than silently allowing it. - Data loss prevention (DLP) scanning on object storage writes. Any write to a broadly-readable storage prefix gets scanned for PII-shaped content (matching known patterns: emails, national ID formats, card numbers) even if it wasn't tagged as PII at the source; this catches the case where a PII column got joined into a new derived file nobody classified.
- Anomalous-export alerting. A single analyst exporting a normal-sized daily report is expected behavior; the same analyst exporting a 500,000-row extract from a PII-containing table is not. Alert on volume and frequency outliers rather than trying to block every export outright, since most exports are legitimate.
- Automatic quarantine, not automatic deletion. When a scan flags a likely leak, move the artifact (the notebook output, the storage object) into a restricted-access quarantine location and notify the owner, rather than deleting it outright; this preserves the evidence needed to confirm whether it was actually a leak, while immediately limiting exposure.
Letting authorized analysts do their real work
The controls above are only sustainable if the default, masked path is fast enough that nobody has an incentive to route around it:
- Governed views and masked notebook connections should cover the large majority of day-to-day analysis without needing an unmask request.
- For the genuine minority of cases needing raw PII (an investigation, a data quality debug session), provide a fast, logged, time-boxed unmask request rather than either blocking it entirely or leaving raw access permanently open.
- Keep the friction concentrated on the risky action (raw export, bulk pull), not on ordinary querying, so the controls don't train people to find workarounds.
Trade-offs & pitfalls
The most common failure in practice is securing the warehouse thoroughly and leaving object storage or notebooks as the gap, because they're viewed as "just infrastructure" rather than a PII surface in their own right. A raw data lake prefix that predates the classification effort, or a notebook server with a long-lived admin credential baked in from years ago, is often the actual leak path even when the warehouse-layer controls look solid on paper. Auditing all four surfaces with the same rigor, rather than assuming the newest or most-visible surface is the only one that matters, is the discipline that prevents this.
A stakeholder from another team asks for a one-off query against production tables that include customer emails and account balances, or requests temporary access to a dataset containing sensitive PII. What questions would you ask before deciding, what safety checks would you require, and under what conditions would you refuse or redirect them to an approved workflow instead? How would you document the decision so it's defensible later?
Sample Answer
Before running anything, establish purpose and minimum necessary scope; the questions and safety checks exist to answer one thing, whether this request can be satisfied with less exposure than "raw production access to emails and account balances," and the answer is almost always yes.
Questions to ask before deciding
- What business decision or problem actually needs this data? A request framed as "I need customer emails and balances" is usually really "I need to understand churn by balance tier" or similar; the underlying need often doesn't require raw PII (personally identifiable information) at all.
- Would aggregated or masked data answer the question? If the stakeholder needs a trend, a distribution, or a count, an aggregate query or a masked extract satisfies it without ever exposing a raw email or an individual balance.
- Does the requester have an approved role for this data, and is there a standing access-request process they skipped? If a governed workflow already exists for this kind of request, a one-off ad-hoc query is the wrong path even if the requester is well-intentioned.
- How long is the output retained, and where does it go? A one-time analysis that lives in a shared spreadsheet indefinitely is a very different risk than a query result viewed once and discarded.
Safety checks before granting anything
- Require the request in writing (a ticket, not a verbal ask), naming the specific columns, the specific rows or filters, and the stated purpose, so there is a record.
- Default to the least-identifying version that still answers the question: masked emails, rounded or bucketed balances, aggregated counts, in that order of preference.
- Route the actual query execution through an audited path (a service account or reviewed script) rather than handing the requester direct table access.
- Time-box any access granted so it doesn't quietly become standing access after the immediate need passes.
When to refuse or redirect
Refuse or redirect to an approved workflow when any of the following hold:
- The requester cannot articulate a specific business decision the raw data would inform (a vague "just want to look around" is a refusal, not a judgment call).
- The same question can be answered with an aggregate or masked view; in that case granting raw access is unnecessary exposure, not a convenience.
- The output would land somewhere uncontrolled, an unmanaged spreadsheet, a personal drive, a chat message, regardless of how legitimate the underlying need is.
- The requester's role has no documented business need for this dataset category at all, in which case the right move is redirecting them to whoever does own that access decision (a data steward or the dataset owner), not personally deciding to grant it.
Documenting the decision so it's defensible later
Record, at the time of the decision, not reconstructed afterward: who requested it, what was requested, what was actually granted (and how it differed from the raw request, if it did), the stated business justification, who approved it, and the retention/deletion plan for any output. This record should live in the same system used for other access decisions (a ticketing system tied to the governance process), not in an email thread that's hard to find during an audit.
Worked example
A marketing stakeholder asks for "a list of customer emails and their account balances" to plan a win-back campaign for high-balance accounts. Instead of granting the raw request: ask what threshold defines "high-balance" (say, above $5,000), then provide an aggregated count of accounts above that threshold segmented by region, with a separate, governed campaign-send workflow (one the marketing team already uses for outreach) handling the actual emails, rather than the stakeholder receiving a raw export of addresses and balances they'd have to handle themselves. The business need (identify and reach a segment) is fully met without a raw PII export ever existing.
Trade-offs & pitfalls
The main pitfall is treating "no" as the only safe answer and creating a reputation for blocking legitimate work; that pushes requesters toward informal workarounds that leave no audit trail. The safer default in practice is redirect-and-satisfy: find the narrower path that meets the actual need, rather than a flat refusal, so people keep bringing requests through the front door.
Design a data governance and access-control model for sensitive PII that has to satisfy real compliance obligations (data classification, masking, role-based access, audit trails, automated PII discovery) without grinding analyst productivity to a halt. Where would you allow just-in-time approvals or self-service, and where would you insist on friction, and how would you defend that split to a skeptical stakeholder on either side who wants the opposite answer?
Sample Answer
Split the model into a fast, self-service default path for low-risk, common-case access and a deliberately slower, approval-gated path reserved for the specific actions that carry real risk, bulk export, raw restricted-tier access, and cross-boundary data movement, rather than applying uniform friction everywhere or uniform speed everywhere.
Compliance obligations as concrete controls
- Data classification: every dataset tagged by sensitivity tier (public through restricted), which drives every other control below rather than each control being independently decided per dataset.
- Masking: confidential and restricted fields masked by default in any query or export; unmasking requires an explicit, logged action.
- Role-based access control (RBAC): roles scoped to the minimum access needed for a job function, avoiding broad "analyst" roles that quietly accumulate access to everything over time.
- Audit trails: every access, mask/unmask event, and export logged with who, what, when, and the stated purpose.
- Automated PII (personally identifiable information) discovery: a scheduled scan across new and existing datasets that flags PII-shaped fields that weren't already tagged, since manual tagging alone reliably misses fields added after the initial classification pass.
Automated PII discovery linked to consent
Automated discovery alone only tells you a field looks like PII; it doesn't tell you whether that data can legally be used for a given purpose. Linking discovery output to the consent-management record closes that gap: when the discovery scan flags a new PII field, the pipeline automatically checks whether the customers represented in that dataset have a consent record covering the purpose the field is being used for, and if not, the field is auto-masked pending a compliance review rather than silently becoming usable the moment it's classified. This turns "we found PII" into "we found PII, and here's whether it's currently authorized for use," which is the actionable version of the discovery signal.
Metric-definition registry as a concrete control
A metric-definition registry (a single governed source of truth for how a business metric like "active customer" or "churned account" is defined and calculated) is a control worth weighing alongside the access controls above, because a self-service analytics environment with strong access control but no metric registry still lets two analysts compute "revenue" two different ways from the same underlying restricted data, which is a data-integrity risk that access control alone doesn't address. Requiring metrics used in anything shared beyond the requester (a dashboard, a report to leadership) to be pulled from the registry, rather than computed ad hoc from masked or raw tables, is a low-friction control that catches a different failure mode than the security controls above: not unauthorized access, but authorized-but-wrong use.
Where to allow just-in-time approvals or self-service
- Self-service, no approval needed: querying already-masked, already-classified data through governed views; pulling metrics from the registry; standard-sized exports of non-restricted data.
- Just-in-time (JIT) approval, fast turnaround: a specific, time-boxed unmask request for a named dataset with a stated reason, approved by the data owner, expiring automatically.
Where to insist on friction
- Bulk export of restricted-tier data: requires a second approver beyond the data owner (for example a compliance reviewer), regardless of who's requesting it, because bulk exfiltration risk doesn't correlate with seniority or trust level, it correlates with volume.
- New consumption of PII flagged by automated discovery: blocked (auto-masked) until a compliance review confirms consent coverage, not granted by default while review is pending.
- Cross-boundary movement (for example moving a restricted dataset into a new tool or a new team's environment for the first time): requires governance sign-off, since this is exactly the kind of change that quietly expands the actual risk surface without anyone deciding to expand it on purpose.
Defending the split to a skeptical stakeholder on either side
To a security-focused stakeholder who wants more friction everywhere: the actual risk is concentrated in bulk volume and novel data movement, not in ordinary masked queries; adding approval gates to the 95% of access that's low-risk doesn't reduce the real risk, it just trains people to route around the system for routine work, which is worse for security than a fast, well-logged self-service path. Point to the audit trail: every self-service access is still logged and reviewable, friction isn't the only control, logging is a control too.
To a productivity-focused stakeholder who wants less friction everywhere: the gated actions (bulk export, new PII consumption, cross-boundary movement) are specifically the small number of actions that, if wrong, are hard or impossible to undo, once a bulk export leaves the building, revoking access to the source dataset doesn't undo the export. The friction is proportionate to the size of the mistake it prevents, not applied indiscriminately, and the self-service path covers the overwhelming majority of day-to-day work without any gate at all.
The defensible position to both is the same: friction is allocated by the actual, demonstrated risk profile of the action (volume, novelty, reversibility), not by a blanket policy in either direction, and that allocation is visible and auditable, not a judgment call made silently case by case.
Trade-offs & pitfalls
The failure mode to watch for is scope creep on the "requires friction" list: once a gate exists for bulk export, there's a temptation to extend it to smaller and smaller export sizes over time in the name of caution, which erodes the self-service path's speed until it isn't actually the fast option anymore. Re-anchoring the friction list periodically to actual incident and audit data, not to accumulated caution, keeps the split honest.
You need to let analysts join records across datasets by a shared identifier without ever exposing raw PII to them. What are your realistic options for doing this safely, and how would you choose between them, say for a one-time internal join between two warehouse tables versus a live join an external, less-trusted partner needs to perform against your infrastructure? Discuss the trade-offs each option makes between performance and how strongly it protects against re-identification.
Sample Answer
The realistic options range from simple deterministic hashing (fast, but weak against a determined attacker with the same hashing scheme) to secure multi-party computation or a trusted intermediary (strong protection, but higher cost and latency), and the right choice depends heavily on whether the join is a one-time internal operation or a recurring join with an external, less-trusted party.
The options
| Approach | Mechanism | Re-identification protection | Performance |
|---|---|---|---|
| Deterministic hashing (salted) | Both sides hash the shared identifier with the same salted algorithm; join on matching hashes | Weak against a dictionary attack if the identifier space is small (for example phone numbers or emails) and either party can hash-and-compare candidate values | Fastest; a straightforward SQL join on the hash column |
| Tokenization via a shared or centrally-issued token | A trusted party issues consistent tokens for the shared identifier to both sides; original values never leave the issuing party | Strong, if the token-issuing party is trusted and the mapping vault is well secured; token itself carries no recoverable information | Fast once tokens are issued; requires an upfront token-issuance step |
| Private set intersection (PSI), a cryptographic protocol | Both parties compute the intersection of their identifier sets using a cryptographic protocol that reveals only the matching records (or just their count), without either party learning the other's non-matching values | Strong; specifically designed so neither party exposes their full raw identifier set to the other | Slower than plain hashing; scales with set size and protocol round trips, most practical for periodic batch joins rather than continuous ones |
| Secure enclave / trusted intermediary | Both parties send their data (or pointers to it) into an isolated, attested compute environment (or a mutually trusted third party) that performs the join and returns only the agreed output | Strong, contingent on trusting the enclave's attestation or the intermediary's integrity | Near-native compute performance for the join itself, but adds engineering complexity to get data securely into and results out of the enclave |
One-time internal join between two warehouse tables
For a one-time join entirely inside your own infrastructure (two tables you already control, joined once for an internal analysis), deterministic hashing is usually sufficient and by far the fastest to implement: both tables live in the same trust boundary already, so the main residual risk is an internal analyst reversing the hash, which is mitigated by using a strong, secret, non-reused salt and restricting who can run the join query at all. Reaching for private set intersection (PSI) or an enclave here is usually overkill: those techniques exist to protect data from a party you don't fully trust, and in a one-time internal join, both sides of the join are already inside the same access-control boundary.
Live join an external, less-trusted partner needs to perform
This is a fundamentally different trust situation: the partner is a separate organization, the join may run repeatedly (not once), and the partner should learn nothing about your non-matching records, and ideally nothing about your raw identifiers at all, matching or not. Deterministic hashing is a poor fit here specifically because the partner could run a dictionary attack against your hashed values using their own guesses at the underlying identifiers, since hashing doesn't require your cooperation to attack once they have the hash. Private set intersection is the better-fitted tool for this case: it's designed exactly for two parties who don't trust each other to learn only the intersection (or an aggregate over it), without either party ever seeing the other's raw or hashed identifier set directly. A centrally-issued token from a mutually trusted third party is a workable alternative if such a trusted intermediary already exists in the relationship (a data clean room provider, for example), trading some of PSI's cryptographic guarantees for operational simplicity.
Trade-offs: performance versus re-identification protection
The general pattern across all four options is that stronger protection costs more in latency, engineering complexity, or both:
- Hashing is cheapest and fastest but its protection depends entirely on salt secrecy and identifier entropy, both of which degrade over time or under a sustained attack.
- Tokenization shifts the trust requirement onto the token-issuing party and its vault, which is a single well-defined thing to secure well, rather than the identifier itself.
- PSI removes the need to trust any single party with the raw data at all, at the cost of protocol overhead that makes it a better fit for periodic batch joins than a continuously-updating live feed.
- A secure enclave gets close to native performance for the join computation itself but pushes the trust question onto the enclave's attestation chain and the complexity of securely feeding data in and getting results out.
Trade-offs & pitfalls
The most common mistake is applying the internal-join answer (plain salted hashing) to the external-partner case because it's already built and it's fast; that reasoning ignores that the threat model changed, not just the join mechanics. The choice of technique should follow from who else can see the hashed or tokenized value and what they're motivated to do with it, not from which technique is already implemented elsewhere in the stack.
Unlock Full Question Bank
Get access to all 15 Data Governance, Contracts, and Classification interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.