Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Salesforce Apex and LWC
00:00
5 left

Salesforce Apex and LWC

MediumSQL · PostgreSQL

Problem

Tell me about your experience building Salesforce features using Apex, Lightning Web Components (LWC), and the Salesforce data model.

Using the supplied Salesforce-style Account, Contact, and Opportunity data, write a PostgreSQL query that summarizes account activity.

Output

  1. One row per account, including accounts without contacts or won opportunities.
  2. Return account_name, won_revenue, contact_count, and account_status.
  3. Classify accounts as Won Business, Contacts Only, or No Activity.
  4. Order by won_revenue descending, then account_name ascending.

Schema

salesforce_accounts
ColumnTypeDescription
account_idPKINTSalesforce Account identifier
account_nameVARCHAR(120)Account display name
owner_nameVARCHAR(120)Assigned Salesforce account owner
industryVARCHAR(80)Account industry classification
created_dateDATEDate the Account was created
salesforce_contacts
ColumnTypeDescription
contact_idPKINTSalesforce Contact identifier
account_idINTRelated Account identifier
full_nameVARCHAR(120)Contact full name
emailVARCHAR(180)Contact email address
is_primaryBOOLEANWhether the Contact is marked primary
salesforce_opportunities
ColumnTypeDescription
opportunity_idPKINTSalesforce Opportunity identifier
account_idINTRelated Account identifier
stageVARCHAR(40)Opportunity sales stage
amountNUMERIC(12,2)Opportunity amount
close_dateDATEExpected or actual close date
Tablessalesforce_accountssalesforce_contactssalesforce_opportunities
Interviewer

Your question is Salesforce Apex and LWC. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.