Question 1
Topic: Salesforce Fundamentals
Skill tested: Select declarative or programmatic solutions based on requirements and platform limits.
A regional distributor wants to calculate a risk score from several related records, use it to route approvals, and update the score whenever any of those records changes. The calculation must support logic that varies by product line and includes iterative evaluation of child records. The solution must be maintainable by administrators, but the team has confirmed that the required calculation cannot be expressed with formula fields or Flow elements. They have no existing codebase, and a managed AppExchange package would introduce an unnecessary dependency. What is the most appropriate recommendation?
Apex is appropriate when the requirement exceeds what declarative tools can express, particularly when the calculation requires iterative processing and complex branching that the team has verified Flow cannot implement for this use case. The resulting score can still be surfaced to administrators and used in declarative approval routing. A Flow should not be selected merely because it is declarative if it cannot meet the requirement. Roll-up summary fields aggregate supported child data but do not implement this custom algorithm. An unrelated package adds dependency and does not guarantee the required logic.