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
Database Trade-Offs for Detection
00:00
5 left

Database Trade-Offs for Detection

HardSQL · PostgreSQL

Problem

Explain the trade-offs between different database architectures in the context of a financial crime detection system.

Write a SQL query that summarizes completed detection runs for each architecture and exposes comparable operational trade-offs through latency, alerts, cost, and throughput metrics.

Output

  1. One row per architecture, including architectures with no completed runs.
  2. Columns: architecture_name, run_count, avg_latency_ms, total_alerts, avg_cost_usd, and avg_throughput_tx_per_sec.
  3. Sort by average latency ascending, place missing latency values last, then sort by architecture name.

Schema

architectures
ColumnTypeDescription
architecture_idPKINTUnique architecture identifier
architecture_nameVARCHAR(100)Architecture name
architecture_typeVARCHAR(50)Broad database architecture category
detection_runs
ColumnTypeDescription
run_idPKINTUnique detection run identifier
architecture_idINTReferenced architecture
statusVARCHAR(20)Run status
latency_msDECIMAL(10,2)End-to-end detection latency in milliseconds
alert_countINTNumber of alerts generated
cost_usdDECIMAL(10,2)Estimated run cost in US dollars
transactions_processedBIGINTNumber of transactions processed
runtime_secondsDECIMAL(10,2)Run duration in seconds
Tablesarchitecturesdetection_runs
Interviewer

Your question is Database Trade-Offs for Detection. 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.