ForceChallenges
ProblemsDailyNotesInterview
Sign in

Practice

All problemsSOQL practiceApex trigger challengesDaily challengeOpportunityTrigger.oldMapBefore UpdateBulkificationContactValidationGROUP BYSemi-JoinAccountBefore Insert

Interview questions

All questionsAdminAdministrationApexApex TriggerAsync ApexDevelopmentField ServiceField ServiceIntegrationLwc

By company

DeloitteSalesforceAccentureInfosysPwCCognizant

Learn

Study notes

ForceChallenges

AboutContact usPrivacy PolicyTerms of ServiceFor AI assistants (llms.txt)
© 2026 ForceChallenges · Salesforce SOQL & Apex trigger practice
Development questions29 of 102
DevelopmentMedium 1 min read

Write a SOQL query to find all AccountShare records for a specific Account to inspect manual and Apex sharing reasons (RowCause).

Asked atDeloittePwCEY

Answer

Each sharing-enabled object has a Share object (e.g. AccountShare) holding the sharing grants. Filter by AccountId and inspect RowCause to see why access exists.

soql
SELECT Id, AccountId, UserOrGroupId, AccountAccessLevel, RowCause
FROM AccountShare
WHERE AccountId = :accId

RowCause values include Owner, Manual, Rule, Team, Territory, and Apex sharing reasons for custom objects.

soqlscenariosharingsetup-objects
Practice SOQL & Apex
PreviousWrite a SOQL query on FieldHistory (AccountHistory or OpportunityFieldHistory) to see who changed a specific field in the last 7 days.Next Write a SOQL query to fetch Accounts along with only their Closed Won Opportunities in a subquery (SELECT Id, Name, (SELECT Id, Amount FROM Opportunities WHERE StageName = 'Closed Won') FROM Account).

More Development questions

  • What is reactivity in LWC and when does a field trigger a re-render?
  • What are the best practices to improve LWC performance?
  • How do you unit test an LWC with Jest?
  • How do you use a third-party JavaScript library or static resource in LWC?
  • Why can renderedCallback run multiple times and how do you prevent repeated execution?