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
Fraud Risk Feature SQL
00:00
5 left

Fraud Risk Feature SQL

MediumSQL · PostgreSQL

Problem

Tell me about a time you had to use SQL and a metric selection approach to evaluate fraud risk for Uber users, and how you handled feedback when your answer was not well received.

For the hands-on SQL portion, calculate each user's weighted fraud-risk score using only metrics marked for selection. Include users without usable selected metrics.

Output

  1. One row per Uber user with user_id, user_name, selected_metric_count, and weighted_risk_score
  2. Include all users, order by score descending, then user_id ascending

Schema

users
ColumnTypeDescription
user_idPKINTUber user identifier
user_nameVARCHAR(100)User display name
metric_definitions
ColumnTypeDescription
metric_idPKINTFraud metric identifier
metric_nameVARCHAR(100)Fraud metric name
weightDECIMAL(5,2)Metric weighting factor
is_selectedBOOLEANWhether the metric is included in scoring
user_metric_values
ColumnTypeDescription
user_metric_value_idPKINTUser metric observation identifier
user_idINTUber user identifier
metric_idINTReferenced fraud metric
metric_valueDECIMAL(8,2)Normalized metric value
Tablesusersmetric_definitionsuser_metric_values
Interviewer

Your question is Fraud Risk Feature SQL. Start with the requirements and the three tables 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.