CompanyVerolt
Focus AreaSalesforce Developer
Questions31+
Topics5

Verolt – Salesforce Developer Interview Questions

What's Covered

Topics covered in this interview.

01Flows & Automation3
02Lightning Web Components8
03SOQL & Data4
04Apex & Triggers8
05General & Experience8

All Interview Questions

Every question asked in this interview, listed one by one.

1How can I call flow from apex?
2How can we call apex from flow?
3How many different types of flow?
4Different lifecycle hooks in lwc.
5If there is one parent and two child components then what will be the order of execution of the life cycle hook.
6@wire method in lwc
7Can I call the wire method inside a javascript function?
8How can we method imperatively?
9Can you tell me what is the promise function in javascript?
10Can you do callouts in javascript?
11Can we show lwc on the vf page?
12What is the limit for DML in one transaction?
13Can I do DML in where cacheable = true?
14What is the difference between master detail and lookup relationship?
15What is the junction object?
16Different REST APIs methods.
17Difference between put and patch method.
18Is there any limit for callout in batch apex? And what is the limit?
19Callout limit in future method?
20How can there be an invokable method in your one apex class?
21Best practice for triggers.
22In apex, how can I test the method?
23What should be the test coverage for the test method?
24Tell me about access and refresh token.
25How to send record value to the third party APIs.
26If I am creating and updating 100 records at a time then how can I do this?
27If only one record makes only one callout so that time how can you do this?
28What if i write cachable = false
29What is the difference between 15 and 18 digit Ids?
30How many records can I queries?
31Any limit of creating custom objects in salesforce?

Preparing for a Salesforce developer interview?

Browse more real company interview experiences and hands-on Apex trigger patterns.

Quick answers to key questions

Flow and Apex

  • Call a flow from Apex. Start an autolaunched flow with the Flow.Interview class.
Map<String, Object> inputs = new Map<String, Object>();
inputs.put('accountId', acc.Id);
Flow.Interview.My_Autolaunched_Flow myFlow = new Flow.Interview.My_Autolaunched_Flow(inputs);
myFlow.start();
  • Call Apex from a flow. Use an Apex action that calls an @InvocableMethod. Only one invocable method is allowed in each Apex class.
  • Types of flow. Screen, record-triggered, schedule-triggered, platform event-triggered and autolaunched flows.

Lightning Web Components

  • Lifecycle order with one parent and two children. The parent constructor runs first, then the parent connectedCallback. Next, the first child runs its constructor and connectedCallback, then the second child does the same. Rendering then finishes from the inside out: renderedCallback runs for child 1, then child 2, and then for the parent.
  • Can a wire method be called inside a JavaScript function? No. A wired method is declarative and the platform calls it. If you need to call Apex from a function, import the method and call it imperatively.
  • How do we call a method imperatively? Import the Apex method, call it like a function, and handle the returned promise with then and catch, or with async and await.
  • What is a promise? An object that represents the result of an operation that finishes later. It can be pending, fulfilled or rejected. You handle it with then, catch and finally, or await.
  • Can we do callouts in JavaScript? Browser calls to other domains are blocked unless the site is added to the Trusted URLs (CSP) settings. The recommended way is to make the callout from Apex and call that Apex method from the component.
  • Can we show an LWC on a Visualforce page? Yes, with Lightning Out. Wrap the LWC in an Aura component, put that in an Aura app, and load it on the page.
  • What if we write cacheable=false? The method cannot be used with @wire, so it must be called imperatively. In return it can perform DML.
  • Can we do DML in a method with cacheable=true? No. Cacheable methods are read-only, and DML throws an error.

Apex, data and integration

  • DML limits. 150 DML statements per transaction and 10,000 records processed by DML.
  • How many records can we query? 50,000 records in total across the SOQL queries of one transaction.
  • Master-detail and lookup. In a master-detail relationship the child depends on the parent, takes its sharing from it, is deleted with it and can have roll-up summaries. A lookup is a loose link with its own owner and sharing.
  • Junction object. A custom object with two master-detail relationships that creates a many-to-many relationship.
  • REST methods, and PUT and PATCH. GET, POST, PUT, PATCH and DELETE. PUT replaces the whole resource, while PATCH changes only the fields you send.
  • Callout limits. 100 callouts per transaction, with a total timeout of 120 seconds. This applies to future methods too, and in batch Apex each execute call is its own transaction with its own 100 callouts.
  • Access token and refresh token. An access token is a short-lived credential used to call the API. A refresh token lives longer and is used to get a new access token without asking the user to log in again.
  • 15 and 18 digit Ids. A 15 digit Id is case-sensitive. An 18 digit Id adds 3 checksum characters, so it is case-insensitive and safe in tools such as Excel and in integrations. Both work in Salesforce.
  • Test coverage. At least 75% overall to deploy to production, but aim for 90% or more with meaningful assertions.

Send a record to a third-party API

HttpRequest req = new HttpRequest();
req.setEndpoint('callout:My_Named_Credential/accounts');
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json');
req.setBody(JSON.serialize(new Map<String, Object>{
    'name' => acc.Name,
    'phone' => acc.Phone
}));
HttpResponse res = new Http().send(req);
System.debug(res.getStatusCode());

For 100 records, send them in one request as a JSON list when the other system allows it. If the API accepts only one record per call, use queueable or batch Apex with a small scope, because a transaction allows only 100 callouts, and a callout cannot be made from a trigger directly.