This question runs in a pre-configured Salesforce environment - no personal connection required.
Write a method that uses SOQL to join Accounts with their Contacts and return formatted strings showing the account name and contact name. The method should return a List of Strings in the format "Account Name - Contact Name", sorted alphabetically by the combined string.
This challenge tests your ability to work with SOQL relationship queries and string formatting to create meaningful data combinations.
Examples
Input: None (method queries all account-contact relationships)
Output: [
'Cloud Code Academy - Michael Johnson',
'Cloud Code Academy - Nina Petrov',
'Cloud Code Academy - Sarah Davis',
'TechFlow Solutions - Emily Martinez',
'TechFlow Solutions - Grace Kim',
'TechFlow Solutions - Robert Chen',
...
]
Explanation: Returns formatted strings for each account-contact pair, sorted alphabetically
Input: If accounts have no contacts
Output: []
Explanation: Returns empty list when no contact relationships exist
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
Contest runs February 1 - 28. Complete challenges to climb the leaderboard!
Points are calculated for challenges completed during the contest period.