Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Optimizing Slow Spreadsheet Workflows
00:00
5 left

Optimizing Slow Spreadsheet Workflows

MediumSQL · PostgreSQL

Problem

Describe a time you optimized a slow-running spreadsheet or data workflow.

Using the supplied workflow tables, write a SQL query that summarizes execution performance for active workflows and identifies workflows exceeding the duration target.

Output

  1. One row per active workflow, including workflows with no runs
  2. Columns: workflow_id, workflow_name, total_run_count, completed_run_count, avg_duration_seconds, failed_run_count, and performance_status
  3. Set performance_status to NO DATA, SLOW, or WITHIN TARGET; a slow workflow has an average completed-run duration above 300 seconds
  4. Order by workflow_id ascending

Schema

workflows
ColumnTypeDescription
workflow_idPKINTUnique workflow identifier
workflow_nameVARCHAR(150)Name of the spreadsheet or data workflow
owner_teamVARCHAR(100)Team responsible for the workflow
is_activeBOOLEANWhether the workflow is currently active
workflow_runs
ColumnTypeDescription
run_idPKINTUnique workflow run identifier
workflow_idINTWorkflow executed by the run
started_atTIMESTAMPRun start timestamp
statusVARCHAR(20)Execution status
duration_secondsINTRun duration in seconds
Tablesworkflowsworkflow_runs
Interviewer

Your question is Optimizing Slow Spreadsheet Workflows. 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.