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

Write a method that uses SOQL to find all Contact records whose email address belongs to a specific domain. The method should take a domain parameter (e.g., 'cloudcodeacademy.com') and return a List of Contact names (FirstName + LastName) sorted alphabetically.

This challenge tests your ability to work with string pattern matching in SOQL using the LIKE operator and handle proper field concatenation.

Examples

Input: domain = 'cloudcodeacademy.com' Output: ['Michael Johnson', 'Nina Petrov', 'Sarah Davis'] Explanation: Returns contacts whose email ends with '@cloudcodeacademy.com', sorted by name Input: domain = 'techflow.com' Output: ['Emily Martinez', 'Grace Kim', 'Robert Chen'] Explanation: Returns contacts whose email ends with '@techflow.com', sorted by name Input: domain = 'nonexistent.com' Output: [] Explanation: Returns empty list when no contacts have emails from that domain
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 Feb 2026

Contest runs February 1 - 28. Complete challenges to climb the leaderboard!

Points are calculated for challenges completed during the contest period.