This question runs in a pre-configured Salesforce environment - no personal connection required.
Write a method that finds contacts with executive titles (CEO, CTO, CFO, VP, Director, etc.) and returns a List of formatted contact information strings. Each string should include the contact's name, title, company name, and email in the format: "Name - Title at Company (email)". Results should be sorted alphabetically by contact name.
This challenge tests your ability to use SOQL with complex LIKE conditions, string formatting, and relationship queries to find and format executive contact information.
Examples
Input: None (method queries all contacts)
Output: [
'Jennifer Williams - CFO at Alpine Private Bank (jennifer.williams@alpinebank.ch)',
'Michael Johnson - CEO at Cloud Code Academy (michael.johnson@cloudcodeacademy.com)',
'Robert Chen - VP of Engineering at TechFlow Solutions (robert.chen@techflow.com)',
'Sarah Davis - CTO at Cloud Code Academy (sarah.davis@cloudcodeacademy.com)',
...
]
Explanation: Returns formatted strings for executives, sorted by name
Input: If no executives exist
Output: []
Explanation: Returns empty list when no executive titles found
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 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
Note
You can test your code by connecting to Salesforce, but to save your progress and earn points, you'll need to create an account. Your solutions and achievements will be tracked automatically once you're logged in.