Question 1 of 30
A company is developing a Visualforce page to display a list of accounts along with their associated contacts. The developer needs to ensure that the page is optimized for performance and adheres to best practices. Which approach should the developer take to efficiently retrieve and display the data while minimizing the number of SOQL queries executed?
Use a single SOQL query to retrieve all accounts and their related contacts using a subquery.
Execute separate SOQL queries for each account to retrieve its contacts.
Use a custom controller that retrieves accounts and contacts in a loop.
Implement a Visualforce component for each account to fetch its contacts individually.

Preparing for SalesForce Certified Platform Developer II Certified Platform Developer II? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free