Skip to main content
πŸ”’ Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial β†’
⚑
← Coursesβ€ΊDevOps for Python servicesModule 5 Β· Cloud, IaC, Secrets, Cost Β· Recapβ€ΊK8s: resource limits + requestsquiz85 / 104
+100 XP
Task
πŸ“ **Task:** Build \`cost_recommendation(monthly_spend, growth_rate, threshold)\` returning one of \`"scale"\`, \`"rightsize"\`, or \`"ok"\`: 1. \`growth_rate > 1.5\` AND \`monthly_spend < threshold\` β†’ \`"scale"\` (under budget AND demand is exploding β€” pre-buy capacity). 2. \`monthly_spend > threshold * 1.2\` β†’ \`"rightsize"\` (>20% over budget β€” request/limit tuning + spot migration before scaling further). 3. \`monthly_spend > threshold\` AND \`growth_rate < 1.0\` β†’ \`"rightsize"\` (over budget AND demand is shrinking β€” definite tuning signal). 4. Otherwise β†’ \`"ok"\` (within bounds; no action this month). \`growth_rate\` is the month-over-month multiplier (1.2 = +20% MoM). πŸ“‹ Implement the function above. Tests run automatically. πŸ’‘ **Hint:** Re-read the theory if you get stuck.
🎯 Quiz

Question

πŸ“ **Task:** Build \`cost_recommendation(monthly_spend, growth_rate, threshold)\` returning one of \`"scale"\`, \`"rightsize"\`, or \`"ok"\`: 1. \`growth_rate > 1.5\` AND \`monthly_spend < threshold\` β†’ \`"scale"\` (under budget AND demand is exploding β€” pre-buy capacity). 2. \`monthly_spend > threshold * 1.2\` β†’ \`"rightsize"\` (>20% over budget β€” request/limit tuning + spot migration before scaling further). 3. \`monthly_spend > threshold\` AND \`growth_rate < 1.0\` β†’ \`"rightsize"\` (over budget AND demand is shrinking β€” definite tuning signal). 4. Otherwise β†’ \`"ok"\` (within bounds; no action this month). \`growth_rate\` is the month-over-month multiplier (1.2 = +20% MoM). πŸ“‹ Implement the function above. Tests run automatically. πŸ’‘ **Hint:** Re-read the theory if you get stuck.