Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
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
Sign up free to run your codeLog inLn 1
Run your query to see results here.