This question runs in a pre-configured Salesforce environment - no personal connection required.

Query and return all Account records where the NumberOfEmployees field is greater than or equal to the given minimum value. Return results ordered by NumberOfEmployees in descending order (largest first). Return an empty list if minEmployees is null.

Filtering accounts by employee count is a common task in sales operations. It allows sales teams to focus on accounts that meet a specific size threshold, such as identifying enterprise customers or segmenting accounts for different sales motions.

Method Signature

public static List<Account> getLargeAccounts(Integer minEmployees)

Examples

Input: minEmployees = 500 Output: List of 12 Account records with NumberOfEmployees >= 500 Explanation: Returns enterprise-sized accounts with 500 or more employees, ordered by employee count descending
Input: minEmployees = 100 Output: List of 24 Account records with NumberOfEmployees >= 100 Explanation: Returns accounts with at least 100 employees
Input: minEmployees = 10000 Output: [] Explanation: No accounts have more than 3500 employees in the dataset
Input: minEmployees = null Output: [] Explanation: Null input returns empty list
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 account

How 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 May 2026

Contest runs May 1 - 31. Complete challenges to climb the leaderboard!

Points are calculated for challenges completed during the contest period.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In