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!

How It Works

  • • Write your solution in the code editor
  • • This challenge runs without connecting your own org
  • • Submit to check if your solution passes
  • • Use hints if you get stuck

Contest Alert

🏆 #CodeEveryDay September 2026 (Sep 16–30)Sponsored by FLXBL

Contest runs September 16 - 30. Complete challenges to climb the leaderboard!

1st & 2nd: Salesforce certification exam voucher see all prizes

Only the 15 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In