Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Data Masking for Financial Clients
00:00
5 left

Data Masking for Financial Clients

MediumSQL · PostgreSQL

Problem

How would you implement data masking for a financial client?

Write a SQL query that returns a masked view of client records for non-privileged users. Keep the same row set, but replace sensitive values with masked versions based on the access level.

Output

  1. One row per client record.
  2. Columns: client_id, display_name, masked_email, masked_account_number, risk_segment.
  3. For access_level = 'FULL', show the original email and account number. For all other access levels, mask the email and account number.
  4. Sort by client_id ascending.

Schema

client_access_view
ColumnTypeDescription
client_idPKINTUnique client record identifier
display_nameVARCHAR(255)Client display name shown to users
emailVARCHAR(255)Client email address
account_numberVARCHAR(32)Client bank account number
risk_segmentVARCHAR(50)Client risk classification
access_levelVARCHAR(20)Viewer access level used to decide masking
Tablesclient_access_view
Interviewer

Your question is Data Masking for Financial Clients. Start with the requirements and the one table in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.