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
Snowflake Scheduled Task
00:00
5 left

Snowflake Scheduled Task

MediumSQL · PostgreSQL

Problem

Write a Snowflake query to create and schedule a task that runs every hour.

Asked in the Technical round 1 stage. Since the target database is PostgreSQL, implement the equivalent using PostgreSQL-compatible objects without requiring optional extensions. Register the task and define the routine that an external scheduler can invoke hourly.

Output

  1. One row for the registered hourly task
  2. Columns: schedule_name, cron_expression, command, and active
  3. Include only the requested task, ordered by schedule_name

Schema

task_schedules
ColumnTypeDescription
schedule_namePKVARCHAR(100)Unique registered task name
cron_expressionVARCHAR(30)Cron expression defining the schedule
commandTEXTPostgreSQL command executed by the scheduler
activeBOOLEANWhether the schedule is enabled
timezoneVARCHAR(64)Timezone used for schedule interpretation
ownerVARCHAR(100)Team responsible for the schedule
last_registered_atTIMESTAMPTZTimestamp when the definition was last registered
hourly_task_runs
ColumnTypeDescription
run_idPKBIGINTUnique task execution identifier
task_nameVARCHAR(100)Name of the registered task
started_atTIMESTAMPTZExecution start timestamp
statusVARCHAR(20)Execution status
detailsTEXTExecution details or error message
Tablestask_scheduleshourly_task_runs
Interviewer

Your question is Snowflake Scheduled Task. 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.