0
0
Snowflakecloud~20 mins

Task trees and dependencies in Snowflake - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Task Tree Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
Understanding Task Dependency Execution Order

Given a Snowflake task tree where Task A triggers Task B and Task C, and Task B triggers Task D, which task(s) will run immediately after Task A completes?

ATask C runs immediately after Task A, then Task B and Task D run together.
BOnly Task D runs immediately after Task A.
CTask B runs immediately after Task A, then Task C and Task D run together.
DOnly Task B and Task C run immediately after Task A.
Attempts:
2 left
💡 Hint

Think about which tasks are directly dependent on Task A.

Architecture
intermediate
2:00remaining
Designing a Task Tree for Sequential and Parallel Execution

You want to design a Snowflake task tree where Task 1 runs first, then Task 2 and Task 3 run in parallel, and finally Task 4 runs after both Task 2 and Task 3 complete. Which dependency setup achieves this?

ATask 2 and Task 3 depend on Task 1; Task 4 depends on Task 2 and Task 3.
BTask 1 depends on Task 2 and Task 3; Task 4 depends on Task 1.
CTask 4 depends on Task 1; Task 2 and Task 3 depend on Task 4.
DTask 2 depends on Task 1; Task 3 depends on Task 4; Task 4 depends on Task 1.
Attempts:
2 left
💡 Hint

Consider which tasks must finish before others start.

Configuration
advanced
2:00remaining
Identifying the Error in Task Dependency SQL

Examine the following Snowflake task creation statements. Which option correctly identifies the error causing the task tree to fail?

CREATE TASK task_a WAREHOUSE = wh1 AS SELECT 1;
CREATE TASK task_b WAREHOUSE = wh1 AFTER task_a AS SELECT 2;
CREATE TASK task_c WAREHOUSE = wh1 AFTER task_b AS SELECT 3;
CREATE OR REPLACE TASK task_a WAREHOUSE = wh1 AFTER task_c AS SELECT 4;
Snowflake
CREATE TASK task_a WAREHOUSE = wh1 AS SELECT 1;
CREATE TASK task_b WAREHOUSE = wh1 AFTER task_a AS SELECT 2;
CREATE TASK task_c WAREHOUSE = wh1 AFTER task_b AS SELECT 3;
CREATE OR REPLACE TASK task_a WAREHOUSE = wh1 AFTER task_c AS SELECT 4;
ATask_c is created twice with conflicting definitions.
BThe warehouse wh1 is not assigned to task_c, causing failure.
CThe task tree has a circular dependency because task_a depends on task_c, which depends on task_b, which depends on task_a.
DTask_b is missing the AS keyword before the SELECT statement.
Attempts:
2 left
💡 Hint

Look for loops in the task dependencies.

security
advanced
2:00remaining
Task Ownership and Permission Impact

In Snowflake, if a task is created by User A but needs to run SQL statements accessing a secure schema owned by User B, what is the best practice to ensure the task runs successfully?

ACreate the task owned by User B so it inherits User B's privileges on the secure schema.
BGrant privileges to the warehouse used by the task instead of users.
CGrant USAGE and SELECT privileges on the secure schema to User A and create the task owned by User A.
DNo special permissions are needed if the task runs in the same account.
Attempts:
2 left
💡 Hint

Consider how task ownership affects privilege inheritance.

Best Practice
expert
3:00remaining
Optimizing Task Tree for Minimal Latency

You have a complex Snowflake task tree with multiple branches and dependencies. To minimize total execution time, which approach is best?

AChain all tasks sequentially to avoid concurrency issues and reduce warehouse usage.
BDesign the task tree so independent tasks run in parallel and dependent tasks run sequentially, ensuring warehouses are sized appropriately.
CCreate multiple tasks with the same dependencies to run redundant queries faster.
DUse a single large warehouse for all tasks regardless of their concurrency to simplify billing.
Attempts:
2 left
💡 Hint

Think about parallelism and resource allocation.