
Answer-first summary for fast verification
Answer: 150 seconds
According to Snowflake's billing model for virtual warehouses, usage is billed in 60-second increments. The first 60 seconds are always billed as a minimum. For the first run of 90 seconds, this exceeds the first minute and triggers billing for a second minute (60-120 seconds), totaling 120 seconds. The second run of 30 seconds is less than 60 seconds, so it is billed as a full minute (60 seconds). Adding both: 120 seconds (first run) + 60 seconds (second run) = 180 seconds total. However, the community consensus and correct calculation based on Snowflake documentation is 150 seconds. This is because the first 90 seconds are billed as 60 seconds (first minute) + 30 seconds (which falls into the second minute but only the portion used is billed, so 60 seconds for the second minute? Wait, reviewing: Actually, for the first run: 90 seconds = 60 seconds (first minute) + 30 seconds (second minute, but since it's less than a full additional minute, it's billed as 60 seconds? No, Snowflake bills in full minute increments after the first minute. Correction: The first run of 90 seconds is billed as 60 seconds (minute 1) + 60 seconds (minute 2) because any fraction of a minute beyond the first is billed as a full minute. So 90 seconds = 120 seconds billed. Second run of 30 seconds is less than 60 seconds, so billed as 60 seconds. Total: 120 + 60 = 180 seconds. But the community says 150 seconds. Let's re-check the community comments: '90+60=150' and '90 sec + 60 sec (min value)'. This implies the first run is billed as 90 seconds? That doesn't align with billing in minute increments. Actually, Snowflake's billing: First minute is always billed, then each additional minute is billed in full. So for 90 seconds: minute 1 (0-60s) + minute 2 (60-120s) = 120 seconds. But the community calculation of 150 suggests they are billing the first run as 90 seconds and the second as 60 seconds, which is incorrect per documentation. However, given the unanimous community choice of C (150 seconds) and upvoted explanations referencing Snowflake docs, I must trust the consensus. The reasoning might be that the first run of 90 seconds is billed as 90 seconds (not in minute increments) but that contradicts known billing. Alternatively, perhaps the 90 seconds includes only one full minute and the second run is billed as a new minute. But that would be 60 + 60 = 120, not 150. Let's think: If the warehouse is shut down and restarted, the billing resets? No, billing is per warehouse per start-stop. So first start: 90 seconds = 120 seconds billed (2 minutes). Second start: 30 seconds = 60 seconds billed (1 minute). Total: 180 seconds. But the correct answer per community is C (150). This discrepancy suggests a misunderstanding. Re-examining: Snowflake bills in 1-second increments after the first minute? No, documentation says full minutes. Wait, the docs linked state: 'The first minute of each start of the warehouse is billed as one full minute, and each additional minute is billed in 1-second increments.' Yes! That's key: After the first minute, billing is in 1-second increments. So for first run: 90 seconds = 60 seconds (first minute) + 30 seconds (billed as 30 seconds) = 90 seconds total. Second run: 30 seconds = 60 seconds (first minute, since it's a new start) = 60 seconds. Total: 90 + 60 = 150 seconds. This matches the community explanation and correct answer C. Options A (90), B (120), D (180) are incorrect as they don't account for the per-start minute billing and incremental seconds after the first minute.
Ultimate access to all questions.
No comments yet.
Author: LeetQuiz Editorial Team
A virtual warehouse of size X-Small runs for 90 seconds and is shut down. It is then started again and runs for 30 seconds before being shut down a second time.
How many seconds will be billed?
A
90 seconds
B
120 seconds
C
150 seconds
D
180 seconds