This question runs in a pre-configured Salesforce environment - no personal connection required.
Write a method that queries all Accounts and updates each Account record with a revenue tier tag in the Description field based on their AnnualRevenue value.
Apply these tier classifications:
- Revenue >= 100000000 (100M+): Set Description to 'Enterprise Tier'
- Revenue >= 10000000 (10M+): Set Description to 'Mid-Market Tier'
- Revenue >= 1000000 (1M+): Set Description to 'SMB Tier'
- Revenue < 1000000 or null: Set Description to 'Startup Tier'
The method should return the total number of accounts that were updated (as Integer). Use bulk-safe DML operations and do not use DML statements inside loops.
Examples
// Account with AnnualRevenue = 225000000 // Description should be set to 'Enterprise Tier' // Account with AnnualRevenue = 15000000 // Description should be set to 'Mid-Market Tier' // Account with AnnualRevenue = 3000000 // Description should be set to 'SMB Tier' // Account with AnnualRevenue = 890000 // Description should be set to 'Startup Tier' // Account with AnnualRevenue = null // Description should be set to 'Startup Tier'
Apex Code Editor
Welcome to Lightning Challenge!
Create an Account
Sign up to track your progress, earn points, and compete with others. Your solutions will be saved automatically.
Create accountHow It Works
- • Write your solution in the code editor
- • Connect your Salesforce org to test
- • Submit to check if your solution passes
- • Use hints if you get stuck
Contest Alert
🏆 #CodeEveryDay Mar 2026
Contest runs March 3 - 31. Complete challenges to climb the leaderboard!
Points are calculated for challenges completed during the contest period.