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
Rank Top Failing Consent Workflows
00:00
5 left

Rank Top Failing Consent Workflows

MediumSQL · PostgreSQL

Problem

Wakemed Operations uses MyChart consent workflows for proxy access, releases, research participation, and interpreter-supported communications. Write a PostgreSQL query to identify the five workflows with the highest failure rates for selected patient segments.

Requirements

  1. Include only attempts from the pediatric_proxy, limited_english, and older_adult segments between 2025-01-01 inclusive and 2025-04-01 exclusive.
  2. Calculate total attempts, failed attempts, and failure rate percentage for each workflow.
  3. Exclude workflows with fewer than two qualifying attempts.
  4. Return the top five workflows, ordered by failure rate descending, failed attempts descending, and workflow name ascending to break ties.

Schema

consent_workflows
ColumnTypeDescription
workflow_idPKINTUnique consent workflow identifier
workflow_nameVARCHAR(150)Display name of the consent workflow
patients
ColumnTypeDescription
patient_idPKINTUnique patient identifier
user_segmentVARCHAR(50)Operational segment assigned to the patient
consent_attempts
ColumnTypeDescription
attempt_idPKINTUnique consent attempt identifier
workflow_idINTWorkflow used for the attempt
patient_idINTPatient associated with the attempt
statusVARCHAR(20)Attempt outcome, such as completed or failed
attempted_atTIMESTAMPTimestamp when the consent attempt occurred
Tablesconsent_workflowspatientsconsent_attempts
Interviewer

Your question is Rank Top Failing Consent Workflows. 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.