This question runs in a pre-configured Salesforce environment - no personal connection required.
Query all accounts that have a non-null AnnualRevenue. Calculate the average AnnualRevenue across all such accounts. Return a sorted list of account names where the AnnualRevenue exceeds that average. Sort the names alphabetically.
Examples:
Assume accounts with AnnualRevenue: [500000, 1000000, 2000000, 3000000]
Average = 1625000
Accounts above average: those with 2000000 and 3000000
Output: [names of those accounts sorted alphabetically]
Explanation: Only accounts strictly above the average are included
If no accounts have AnnualRevenue set:
Output: []
Explanation: Return empty list when no revenue data exists
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 July 2026
Contest runs July 1 - 31. Complete challenges to climb the leaderboard!
Only the 31 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.