SAA Development & Deployment 2 — Questions and Answers
Question 1: A team wants to ensure that metadata changes in a sandbox are automatically tracked and can be rolled back. Which tool is BEST suited for this requirement?
- Salesforce DX (SFDX) with version control integration (Correct answer)
- Change Sets from sandbox to production
- Ant Migration Tool with manual backups
- Workbench metadata retrieve and deploy
Correct answer: Salesforce DX (SFDX) with version control integration
Salesforce DX integrates with version control systems like Git, enabling automatic tracking of metadata changes and rollback capabilities.
Question 2: During a code review, a developer used a SOQL query inside a for loop. What is the primary risk of this pattern in Salesforce?
- It causes incorrect query results
- It can exceed the 100 SOQL queries per transaction governor limit (Correct answer)
- It slows down rendering of Visualforce pages
- It prevents bulk record processing
Correct answer: It can exceed the 100 SOQL queries per transaction governor limit
SOQL queries inside loops multiply with each iteration and can quickly hit the 100 SOQL queries per transaction governor limit.
Question 3: An architect needs to deploy a complex package with dependencies between components across multiple orgs. Which approach is MOST appropriate?
- Deploy using change sets in sequence
- Use unlocked packages with explicit package dependencies defined in sfdx-project.json (Correct answer)
- Deploy all components in a single unmanaged package
- Use Workbench to deploy metadata in the correct order
Correct answer: Use unlocked packages with explicit package dependencies defined in sfdx-project.json
Unlocked packages support explicit dependency declarations in sfdx-project.json, ensuring proper installation order across orgs.
Question 4: A company wants to enforce code coverage requirements before any deployment to production. Which mechanism enforces this automatically?
- Pre-deployment validation rules in Setup
- Salesforce requires at least 75% overall Apex code coverage for production deployments (Correct answer)
- A connected CI/CD pipeline must enforce it manually
- Apex test suites block deployments below 50% coverage
Correct answer: Salesforce requires at least 75% overall Apex code coverage for production deployments
Salesforce enforces a minimum of 75% overall Apex code coverage as a built-in requirement for all production deployments.
Question 5: Which environment type in Salesforce is BEST suited for performance and load testing before a production release?
- Developer Sandbox
- Full Sandbox (Correct answer)
- Partial Copy Sandbox
- Developer Pro Sandbox
Correct answer: Full Sandbox
A Full Sandbox contains a complete copy of production data and metadata, making it the best environment for realistic performance and load testing.
Question 6: An architect is designing a CI/CD pipeline for a Salesforce project. Which sequence of steps BEST represents an automated pipeline?
- Code commit → Manual review → Change Set deploy → Production
- Code commit → Automated tests → Validate deploy → Merge → Deploy to production (Correct answer)
- Code commit → Retrieve metadata → Package → Deploy via Workbench
- Pull request → Manual deploy → Sandbox test → Production
Correct answer: Code commit → Automated tests → Validate deploy → Merge → Deploy to production
A best-practice CI/CD pipeline automates testing and validation on every code commit before promoting changes through environments to production.
Question 7: A developer created a trigger on the Account object that fires on insert and update. During a data migration, 50,000 records are inserted via Data Loader. What Apex feature ensures the trigger handles this efficiently?
- Using @future methods inside the trigger
- Writing bulkified trigger logic that processes records in collections (Correct answer)
- Disabling the trigger during migration via Custom Settings
- Using process builders instead of triggers for bulk loads
Correct answer: Writing bulkified trigger logic that processes records in collections
Bulkified trigger logic processes records using collections (lists/maps) rather than one at a time, efficiently handling large data volumes within governor limits.
A team wants to ensure that metadata changes in a sandbox are automatically tracked and can be rolled back.
Which tool is BEST suited for this requirement?