Bird
Raised Fist0
Snowflakecloud~20 mins

Resource monitors for cost control in Snowflake - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
πŸŽ–οΈ
Resource Monitor Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
How does a resource monitor behave when the credit usage threshold is reached?

In Snowflake, what happens when a resource monitor reaches its defined credit usage threshold?

AThe monitor sends an alert and can optionally suspend warehouses if configured to do so.
BThe monitor sends an alert and suspends all warehouses immediately.
CThe monitor automatically increases the credit quota to avoid suspension.
DThe monitor deletes all query history to free up credits.
Attempts:
2 left
πŸ’‘ Hint

Think about whether the monitor acts automatically or requires configuration to suspend warehouses.

❓ Configuration
intermediate
2:00remaining
Which SQL command creates a resource monitor with a monthly credit quota of 100 credits?

Select the correct Snowflake SQL command to create a resource monitor named monthly_monitor with a 100 credit monthly quota.

ACREATE RESOURCE MONITOR monthly_monitor WITH CREDIT_QUOTA = 100;
BCREATE RESOURCE MONITOR monthly_monitor WITH CREDIT_QUOTA = 100 TRIGGERS ON 100 PERCENT DO NOTIFY;
CCREATE RESOURCE MONITOR monthly_monitor SET CREDIT_QUOTA = 100 MONTHLY;
DCREATE RESOURCE MONITOR monthly_monitor CREDIT_QUOTA = 100 MONTHLY;
Attempts:
2 left
πŸ’‘ Hint

Check the correct syntax for specifying credit quota and period.

❓ Architecture
advanced
2:00remaining
What is the best architecture to monitor and control costs across multiple Snowflake accounts?

You manage multiple Snowflake accounts for different teams. Which architecture allows centralized cost monitoring and control using resource monitors?

AUse a shared Snowflake account with resource monitors assigned to each team’s warehouses via tags.
BCreate separate resource monitors in each account and manually aggregate reports externally.
CCreate a single resource monitor in one account and link it to warehouses in other accounts.
DDisable resource monitors and rely on billing alerts from the cloud provider.
Attempts:
2 left
πŸ’‘ Hint

Consider how Snowflake resource monitors can be assigned and how to centralize control.

❓ security
advanced
2:00remaining
Which role is required to create and manage resource monitors in Snowflake?

To securely manage resource monitors, which Snowflake role must a user have?

ASECURITYADMIN role
BSYSADMIN role
CPUBLIC role
DACCOUNTADMIN role
Attempts:
2 left
πŸ’‘ Hint

Think about which role has the highest privileges related to account-wide settings.

βœ… Best Practice
expert
2:00remaining
How should you configure resource monitors to avoid unexpected warehouse suspensions during business hours?

Which approach best prevents resource monitors from suspending warehouses unexpectedly during critical business hours?

ADo not use resource monitors and manually track credit usage daily.
BCreate multiple resource monitors with overlapping quotas and suspend warehouses immediately when thresholds are hit.
CSchedule resource monitors to suspend warehouses only outside business hours using Snowflake tasks and alerts.
DSet a high credit quota and disable automatic suspension, relying only on alerts.
Attempts:
2 left
πŸ’‘ Hint

Consider how to combine scheduling and monitoring to protect business operations.

Practice

(1/5)
1. What is the main purpose of a resource monitor in Snowflake?
easy
A. To track and control cloud credit usage by setting limits
B. To create new virtual warehouses automatically
C. To backup data to external storage
D. To manage user access permissions

Solution

  1. Step 1: Understand resource monitor function

    Resource monitors are designed to track cloud credit consumption and enforce limits to control costs.
  2. Step 2: Identify the correct purpose

    Among the options, only tracking and controlling credit usage matches the resource monitor's role.
  3. Final Answer:

    To track and control cloud credit usage by setting limits -> Option A
  4. Quick Check:

    Resource monitor = cost control [OK]
Hint: Resource monitors limit cloud credits to control costs [OK]
Common Mistakes:
  • Confusing resource monitors with user access controls
  • Thinking resource monitors create warehouses
  • Assuming resource monitors handle data backups
2. Which Snowflake SQL command correctly creates a resource monitor with a 1000 credit monthly limit?
easy
A. CREATE RESOURCE MONITOR my_monitor WITH CREDIT_QUOTA = 1000, TRIGGERS ON 90 PERCENT DO NOTIFY
B. CREATE RESOURCE MONITOR my_monitor SET CREDIT_LIMIT = 1000
C. CREATE RESOURCE MONITOR my_monitor WITH CREDIT_QUOTA = 1000 TRIGGERS ON 90 PERCENT DO NOTIFY
D. CREATE RESOURCE MONITOR my_monitor CREDIT_LIMIT 1000

Solution

  1. Step 1: Review correct syntax for resource monitor creation

    The correct syntax uses CREATE RESOURCE MONITOR with WITH CREDIT_QUOTA and TRIGGERS clauses.
  2. Step 2: Match syntax with options

    CREATE RESOURCE MONITOR my_monitor WITH CREDIT_QUOTA = 1000 TRIGGERS ON 90 PERCENT DO NOTIFY matches the correct syntax including triggers and notification on 90% usage.
  3. Final Answer:

    CREATE RESOURCE MONITOR my_monitor WITH CREDIT_QUOTA = 1000 TRIGGERS ON 90 PERCENT DO NOTIFY -> Option C
  4. Quick Check:

    Correct syntax uses WITH CREDIT_QUOTA and TRIGGERS [OK]
Hint: Use WITH CREDIT_QUOTA and TRIGGERS to create monitors [OK]
Common Mistakes:
  • Using SET instead of WITH for quota
  • Omitting TRIGGERS clause
  • Incorrect keyword CREDIT_LIMIT instead of CREDIT_QUOTA
3. Given this resource monitor configuration:
CREATE RESOURCE MONITOR rm1 WITH CREDIT_QUOTA = 500 TRIGGERS ON 80 PERCENT DO NOTIFY ON 100 PERCENT DO SUSPEND;

What happens when the credit usage reaches 100%?
medium
A. The resource monitor suspends the warehouses linked to it
B. Snowflake sends a notification but continues running
C. The credit quota automatically increases
D. Nothing happens automatically

Solution

  1. Step 1: Analyze the triggers in the resource monitor

    The monitor triggers a notification at 80% and suspends resources at 100% usage.
  2. Step 2: Understand the effect of the 100% trigger

    At 100%, the monitor suspends warehouses linked to it to prevent further credit use.
  3. Final Answer:

    The resource monitor suspends the warehouses linked to it -> Option A
  4. Quick Check:

    100% trigger with SUSPEND = suspend warehouses [OK]
Hint: 100% trigger with SUSPEND stops warehouses automatically [OK]
Common Mistakes:
  • Thinking notification happens at 100% instead of suspend
  • Assuming quota increases automatically
  • Believing nothing happens at limit
4. You wrote this command to create a resource monitor:
CREATE RESOURCE MONITOR monitor1 WITH CREDIT_QUOTA = 2000 TRIGGERS ON 90 PERCENT DO NOTIFY ON 110 PERCENT DO SUSPEND;

What is wrong with this command?
medium
A. CREDIT_QUOTA must be less than 1000
B. The trigger percentage cannot exceed 100%
C. DO NOTIFY is not a valid action
D. Resource monitors cannot suspend warehouses

Solution

  1. Step 1: Check trigger percentage limits

    Trigger percentages must be between 0 and 100; 110% is invalid.
  2. Step 2: Validate other parts of the command

    DO NOTIFY is valid, CREDIT_QUOTA can be any positive number, and suspension is allowed.
  3. Final Answer:

    The trigger percentage cannot exceed 100% -> Option B
  4. Quick Check:

    Trigger percent ≀ 100% [OK]
Hint: Trigger percentages must be 0-100% only [OK]
Common Mistakes:
  • Setting trigger above 100%
  • Confusing DO NOTIFY syntax
  • Thinking suspension is disallowed
5. You want to prevent unexpected high costs by automatically suspending warehouses when 95% of your monthly credit quota is used, and notify at 80%. Which resource monitor configuration achieves this?
hard
A. CREATE RESOURCE MONITOR cost_control WITH CREDIT_QUOTA = 1500 TRIGGERS ON 95 PERCENT DO NOTIFY ON 80 PERCENT DO SUSPEND;
B. CREATE RESOURCE MONITOR cost_control WITH CREDIT_QUOTA = 1500 TRIGGERS ON 100 PERCENT DO NOTIFY ON 95 PERCENT DO SUSPEND;
C. CREATE RESOURCE MONITOR cost_control WITH CREDIT_QUOTA = 1500 TRIGGERS ON 80 PERCENT DO SUSPEND ON 95 PERCENT DO NOTIFY;
D. CREATE RESOURCE MONITOR cost_control WITH CREDIT_QUOTA = 1500 TRIGGERS ON 80 PERCENT DO NOTIFY ON 95 PERCENT DO SUSPEND;

Solution

  1. Step 1: Identify notification and suspension percentages

    Notification should occur at 80%, suspension at 95% usage.
  2. Step 2: Match triggers to correct actions and order

    CREATE RESOURCE MONITOR cost_control WITH CREDIT_QUOTA = 1500 TRIGGERS ON 80 PERCENT DO NOTIFY ON 95 PERCENT DO SUSPEND; correctly sets 80% for notification and 95% for suspension.
  3. Step 3: Verify other options

    The other options swap actions or percentages incorrectly or notify at 100% instead of 80%.
  4. Final Answer:

    CREATE RESOURCE MONITOR cost_control WITH CREDIT_QUOTA = 1500 TRIGGERS ON 80 PERCENT DO NOTIFY ON 95 PERCENT DO SUSPEND; -> Option D
  5. Quick Check:

    Notify 80%, suspend 95% = CREATE RESOURCE MONITOR cost_control WITH CREDIT_QUOTA = 1500 TRIGGERS ON 80 PERCENT DO NOTIFY ON 95 PERCENT DO SUSPEND; [OK]
Hint: Notify lower %, suspend higher % to control costs [OK]
Common Mistakes:
  • Swapping notify and suspend percentages
  • Setting notify higher than suspend
  • Using 100% notify instead of 80%
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard