Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 feedbackSuccess 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
CLT and SQL Tasks
00:00
5 left

CLT and SQL Tasks

MediumSQL · PostgreSQL

Problem

Explain what CLT is, and solve SQL tasks involving regex and data extraction.

Use PostgreSQL syntax. Parse valid merchant, amount, and authorization-code values from event text, then retain only approved, non-test transactions with matching metadata.

Output

  1. One row per qualifying transaction, with transaction_id, event_timestamp, merchant_name, amount, authorization_code, and source_system.
  2. Exclude malformed events, declined or test transactions, and events without metadata.
  3. Order by event_timestamp ascending, then transaction_id ascending.

Schema

raw_transaction_events
ColumnTypeDescription
event_idPKINTUnique event identifier
transaction_idVARCHAR(20)Transaction identifier embedded in the event record
event_textTEXTSemi-structured event text containing transaction attributes
event_timestampTIMESTAMPTime when the event was recorded
transaction_metadata
ColumnTypeDescription
transaction_idPKVARCHAR(20)Unique transaction identifier
statusVARCHAR(20)Transaction processing status
is_testBOOLEANWhether the transaction is a test record
source_systemVARCHAR(30)System that supplied the transaction metadata
Tablesraw_transaction_eventstransaction_metadata
Interviewer

Your question is CLT and SQL Tasks. Start with the requirements and the two 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.