[go: up one dir, main page]

0% found this document useful (0 votes)
44 views13 pages

Interview Questions

What is your name ?

Uploaded by

Zahreelay Views
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views13 pages

Interview Questions

What is your name ?

Uploaded by

Zahreelay Views
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 13

rollup summary

sum of child record child


on account : insert update delete
sum of cotact
contact amount

-----------------------------------------------------------------------------------
-----------------------------------------

trigger on Contact ContactTrigger(after insert, after update, after delete){

if(trigger.isInsert && trigger.isAfter){


ContactTriggerHandler.afterInsert(trigger.New);
}

if(trigger.isUpdate && trigger.isAfter){


ContactTriggerHandler.afterInsert(trigger.New, trigger.Old);
}

if(trigger.isDelete && trigger.isAfter){


ContactTriggerHandler.afterInsert(trigger.Old);
}

public class ContactTriggerHandler{

public static void afterInsert(List<Contact> contactList){

set<Id> accountId = new set<Id>();

for(Contact con : contactList){


accountId.add(con.AccountId);
}

for(AggregrateResult ar : [Select Sum(contact_amount__c), accountId from Contact


where Id accountId IN: accountId group By accountId){
Account acc = new Account();
acc.Id = ar.get('expr0);
acc.sumofcontact()

public static void afterUpdate(List<Contact> contactList, Map<Id,Contact> oldMap){


map<Id,Integer> conamountmap = new map<Id,Integer>();
set<Id> accountId = new set<Id>();
for(Contact con : contactList){
if(con.contact_amount__c != oldMap.get(con.Id).contact_amount__c){
accountId.add(con.Id);
}
}
}
public static void afterDelete(List<Contact> contactList){
}

-----------------------------------------------------------------------------------
---------------------------------------

while sharing record if we are sharing to a public group then there is a option
that is grant access using heirachy if that is unchecked my manager wont
be able to view the record

The records which are successful that needs to be inserted in batch class except
failed one

calling api from lwc

lightning message service

Lightning data service

promise vs async & await

diff between recordapi & LDS

when order is created i have to send data to 10 systems hows that possible

differecne between remote site setting & named credentials

why we use implements in batch class / apex

communicate from child 1 to parent & parent to child 2

queable related que

how to handle mixed dml exception in test class

best practices for test class

how to enforce security to record, object & field in apex

system.runAs in test class

-----------------------------------------------------------------------------------
---------------------------------------
what is relationship between product, price
what are the standards by salesforce that needs to be followed while doing
integration
diff between connected app & remote site setting
why we use connected apps
What are required parameters in postman to test salesforce integration
Why rest used not soap for integration

-----------------------------------------------------------------------------------
--------------------------
unselective query
check how to use aggregate query
query related exceptions
record lock exceptions & how to solve

in batch how we can execute records in particular order

owd is read only & on profile user do not have read only access

Lightning record page access based on permission set

check batch class start method use & difference

enforce security in query


-----------------------------------------------------------------------------------
------------------------------
Diff between batch & quable
diff between database.querylocator & iterable in batch class
how to solve mix dml exception in batch class

can we call wire method from connected call back


life cycle hook lwc
what framework you use while implementing trigger
in before trigger flow how to show error if data is not correct

using quick action i have to show toast message when data is process by using lwc

need count of successful process records in batch class


what type of actions we have in flow
how to call apex from flow, can we pass multiple parameters through flow

can we call wire method multiple times

can we call apex class from constructor of LWC :


https://salesforcediaries.com/2019/12/12/constructor-in-lightning-web-component/

what are the interfaces available for batch class :


https://www.apexhours.com/batch-apex-in-salesforce/

best practices for test classes

-----------------------------------------------------------------------------------
------------------------------
Creates the number of contacts which are equal to the number which we will enter in
the Number of Contacts(Number) field on the Account Object.

if update 10 from 12 so 2 records should be created

if contact has been deleted then no contact should be change on account

trigger on Account AccountTrigger (after Insert, after Update){

if(trigger.isInsert && trigger.isAfter){


AccountTriggerHandler.afterInsert(trigger.new);
}

if(trigger.isUpdate && trigger.isAfter){


AccountTriggerHandler.afterUpdate(trigger.new, trigger.oldmap);
}

public class AccountTriggerHandler{

public static void afterInsert(List<Account> newAccount){

List<Contact> conToCreate = new List<Contact>();

for(Account acc : newAccount){

for(integer i=1; i <= acc.NoOfContacts__c; i++){


Contact con = new Contact();
con.AccountId = acc.Id;
con.LastName = 'Test '+ i;

conToCreate.add(con);
}

}
if(conToCreate.size() > 0)
insert conToCreate;

public static void afterUpdate(List<Account> newAccount, map<Id,Contact> oldMap){

List<Contact> conToCreate = new List<Contact>();


map<Id,Integer> accContactMap = new map<Id,Integer>();

for(Account acc : newAccount){

if(acc.NoOfContacts__c > oldMap.get(acc.Id).NoOfContacts__c){


for(integer i=1; i <= acc.NoOfContacts__c - oldMap.get(acc.Id).NoOfContacts__c; i+
+){
Contact con = new Contact();
con.AccountId = acc.Id;
con.LastName = 'Test '+ i;

conToCreate.add(con);
}
}

else{
accContactMap.put(acc.Id, oldMap.get(acc.Id).NoOfContacts__c -
acc.NoOfContacts__c);
}

if(conToCreate.size() > 0)
insert conToCreate;

}
with sharing without sharing
i have 2 classes without sharing can we call method of 1 class in 2nd class
can we debug flow with perticular user
in how many ways we can call apex from lwc js filewhat are the precautions we need
to take when we are calling a method from @wire
sales process in sales cloud
before vs after triggers
if we are using before trigger can we do DML & why?
recurssive trigger
depth of recurssive trigger
how to avoid recurssive trigger
shadow clone & deep clone
-----------------------------------------------------------------------------------
------------------------------
account : billing & shipping address
if billing address is updated then create a task & assigned to primary contact
there is field on contact called isprimary that will be true.

task subject should be complete KYC

---------------------------------------------------------
trigger on Account AccountTrigger(before update, after update){

if(trigger.isBefore && trigger.isUpdate){


AccountTriggerHandler.beforeUpdate(trigger.new, trigger.oldmap);
}

public class AccountTriggerHandler{

public static void beforeUpdate(List<Account> accountList, map<Id,Account>


accountMap){

set<Id> accountId = new set<Id>()


List<Task> taskToCreate = new List<Task>();

for(Account acc : accountList){

if(acc.BillingAddress != accountMap.get(acc.Id).BillingAddress){
accountId.Id(acc.Id);
}

for(Account acc : [select id, name, (select id, name from contacts where
isprimary__c = true) from account where Id in: accountId]){

List<Contacts> conList = acc.contacts;

if(conList.size() > 0){

Task tk = new Task();


tk.Subject = 'Please complete the KYC';
tk.whatId = conList[0].Id;
taskToCreate.add(tk);

if(taskToCreate.size() > 0)
insert taskToCreate;

}
-----------------------------------------------------------------------------------
------------------------------
debug log - list of cases & tasks

set<id> caseId = new set<id>()


for(Case cs : trigger.nee){
caseId.add(cs.id);
}

for(case cs : [select id, casenumber (select id, Name from tasks where status =
'open') where id in: caseId]){
System.debug('CaseNumber '+ cs.casenumber);
System.debug('Task List '+ cs.tasks);
}

- check on latest release by salesforce for apex


- create 2 lwc component where in component there is 1st name last name & search
button, fetch the account with details & show it in 2nd component
- check all the things which i am doing in REST API, like links for generating
access token, what is approach which are using like access token / username
password
- Check queueable for Mixed dml exception, check diff between queueable vs future
- how u will manage the component accessibilty with 2 different teams / profiles
- use trailhead for personal growth please spend some time on it
- Why LWC
- events in LWC

- write a trigger to get list of open tasks related to case


-----------------------------------------------------------------------------------
------------------------------
custom setting vs custom metadata
find the highest 2nd salary of the employee
soql governer limit has been end and i have to pass the records from trigger to 3rd
system
lwc child to parent & parent to child
exstict in salesforce admin
@wire method
i am using @wire method i am querying 5 records with inline edit does all the
records with get updated as bulk
DISTINCT in salesforce
-----------------------------------------------------------------------------------
------------------------------
trigger and batch at same time @future annotation
trigger and context variables

workflow same object which one get executed 1st - its unpredictable
how to call apex method from component
application event component event
how to get id in vf using standard controller
how to control record level and object level access
schedule class from execution window
component related questions
sharing record related questions like on what basis we can share the records and to
whom
profiles and permission set related questions
triggers and trigger events and related questions
in which scenario workflow can be schedule
test.start and test.stop use
skip a piece of code in test class
test class related questions
methods for metadata and custom setting
diff between list and hierarchy in custom setting
batch default size & max size
salesforce latest release
how to enable manual sharing
lwc annotation
stop recursive trigger
how to implement integration and related questions
execute batch in test
diff queueable, schedulable, @future
trigger before vs after
setup integration
annotation used in lwc and aura
cascade delete of account
in what scenario we should use @future
save point in salesforce
public vs global in apex class
-----------------------------------------------------------------------------------
-----------
Create a list having duplicate values and display only unique values from them
write a trigger to find the count of active related contacts for an account and
update that count on account

Create a trigger on opportunity to add all the contacts having the same account as
opportunity.account into the opportunity "Contact Roles"
Example : Account: Birla have 3 Contacts: Suraj, Akshay & Ganesh then while
creating an opportunity for Birla add Suraj, Akshay & Ganesh to Opportunity Contact
Roles

List<OpportunityContactRole> newContactRoleList = new


List<OpportunityContactRole>();
newContactRoleList.add(new
OpportunityContactRole(ContactId=opp.Primary_Contact__c,OpportunityId=opp.Id,Role='
Decision Maker',IsPrimary=true));
why use afterinsert in code

Interview Questions
Tell me something about yourself and your journey in salesforce
have you worked on administration part
salesforce security model
diff between profile and roles
permission set
In how many ways can we share a record? 1.Role Hierarchy. 2.Organization Wide
Defaults. 3.Manual Sharing. 4.Criteria Based Sharing Rules. 5.Apex Sharing.
Can we delete user? freez and deactivate ?Why we cant delete users in salesforce
Types of report in salesforce
What are Bucket Fields in Salesforce?
types of relationship in salesforce? how can we achieve many to many
if i have two master details on a object if i delete a master record what will
happen
*You can convert a master-detail relationship to a lookup relationship as long as
no roll-up summary fields exist on the master object
*You can convert a lookup relationship to a master-detail relationship if the
lookup field in all the records contains a value.
diff between workflow and process builder
How to call apex from process builder - @InvocableMethod

Development
Governer limits in salesforce
best practices in salesforce
salesforce order of execution
have you worked on apex class, triggers and asynchronous apex
Is it possible to edit Apex / Visualforce page Class/Trigger in the Production
Environment?
Trigger events in salesforce
what are trigger context variables in salesforce
For the same event if there are multiple triggers on the object, how to control the
order of execution? - We cannot control the order of execution in this situation.
It is recommended to have only one trigger per one object.
when we can use before undelete
what is recurrsion
how can we stop recurssive triggers
different types of asynchronous apex - Future Methods, Batch Apex, Queueable Apex,
Schedules Apex
What are the methods of Batch Apex Class?
default batch size. How to call another batch from one batch.
Is it okay if we did not define finish method in batch class
Can we use @future annotation in batch class
How to cover the code for a batch class? - To cover the code for the batch class we
should call the batch class from the inside of the Test.startTest() and
Test.stopTest().
Types of controller in salesforce
What is difference betwn standard & custom controller
Syntax to use standard and custom controller at same time
What is the purpose of test class
have used @isTestRunning
What is the purpose of Test.startTest() and Test.stopTest()?
Test.startTest() and Test.stopTest() maintains fresh set of governor limits. Assume
that you are consuming 99 SOQL queries outside of Test.startTest() and
Test.stopTest() then if you include any SOQL inside of Test.startTest() and
Test.stopTest() count will start from 1.
Per testMethod we can use Test.startTest() and Test.stopTest() only for one time.
To execute asynchronous methods synchronously we can call those methods from inside
of Test.startTest() and Test.stopTest().
What is the purpose of system.runAs()? -
By default test class runs in System Mode. If you want to execute a piece of code
in a certain user context then we can use system.runAs (UserInstance)

Differnece between custom object and custom settings


have you worked on aura component and lwc?

What are all component bundles we deal with while working with Lightning Component?
Following are the component bundles we deal with while working with Lightning
Component.
Component: contains markup.
Controller: handles the client side events.
Helper: write the common logic inside helper which can be used by different
controller methods, avoiding repetition.
Style: contains the style for the component.
Documentation: used to record the component’s use.
Renderer: contains the default rendering behaviour of a component.
SVG: the icon which gets displayed before the component name in the Lightning App
Builder.
Design: control which attribute we can expose to tools like the Lightning App
Builder. It helps with component re-usability.

1. Where we can use Lightning Components?


We can use Lightning Components in the following places:

Lightning App Builder and Community Builder.


Lightning Pages.
Lightning Experience Record Pages.
Quick Action
Override Standard Actions with Lightning Components
Create Stand-Alone Apps

4. What options are there for Lightning Record Page assignment?


“Lightning Pages” can be assigned at three different levels:

The org default


App default – this overrides the assignment done at the org level
App, record type, profile – this overrides the assignment done at org level and at
the App level.

Q. Which interface should you use if you want your component to be available for
all pages?
You can use the flexipage:availableForAllPageTypes interface.

Q. Which interface should you use if you want to get the id of the record from the
record Detail page?
You can use the force:hasRecordId interface.

types of events in component


Component Events - This is used when data has to be sent from child component to
parent component.
Application Events - This is use when data has to be sent from one component to
another component which is not with in the hierarchy.
How to call apex method from aura component

11. Which interface should you use if you want to override a standard action?
You will need to use the Lightning:actionOverride interface

Which interface should you use if you want your component to be used a tab?
You will need to use the force:appHostable interface.
Which interface should you use if you want your component to be used a quick
action?
You will need to use the force:lightningQuickAction interface.

46.What are the types of decorators in lightning web components?

We have 3 Decorators in Lightning Web Components.


1) @api

2) @track

3) @wire

When do we use @api with a function or a property?


When we need to expose the property or function to the container (parent)
component. Then we annotate them with @api. In simple words,
to create a public property or function.

When the @wire method gets called?


Wired Apex methods get called automatically when the component is connected or
every time the reactive properties are changed.
-----------------------------------------------------------------------------------
-------------------

custom setting vs custom metadata


find the highest 2nd salary of the employee
soql governer limit has been end and i have to pass the records from trigger to 3rd
system
lwc child to parent & parent to child
exstict in salesforce admin
@wire method
i am using @wire method i am querying 5 records with inline edit does all the
records with get updated as bulk
DISTINCT in salesforce

-----------------------------------------------------------------------------------
-----------------------------------------
how to manager more than 50 milion records in batch class
integration related question like inbound & outbound call\
how to read the response received in api call
how to de secure authentication for inbound & outbound call
in how many ways we can call apex class in LWC (wire & imperative)
child to parent & parent to child communication

when to use before triggers & after triggers


use of record type
how to pass data in final method in batch class
can we send list of sobject in future method
diff between future & queueable

basic access level or security model of salesforce


can we revoke the access of the user in profile or anyway

-----------------------------------------------------------------------------------
-----------------------------------------
view state
plateform event
system.runAs
Test.starttest * test.stoptest
use of rendered in aura
annotations used in lwc
what is recurrsive trigger & how to avoid it
apex methodologies = best practices
promises in javascript
future vs queueable
governer limit in salesforce
custom setting vs custom metadata
before trigger vs after trigger
access specifier in salesforce

mututed permission set


permission set for community
share records for community users
-----------------------------------------------------------------------------------
-----------------------------------------
public class example1{

String sample1;
String sample2;

public void method1(String s1, String s2){

sample1 = s1;
sample2 = s2;

public class example2 extends example1{

String sample1;
String sample2;

String sample3;

public void method1(String s1, String s2){

sample1 = s1;
sample2 = s2;
sample3 = sample1 +' '+sample2;
}

trigger
account
countact - manage a field

when a new contact is added under account then we need to isLastChild__c to true.
and for other contact under the same Account make the isLastChild__c as false
write trigger for that in apex

trigger on contact ContactTrigger(after insert, after update){


if(trigger.isAfter && trigger.isInsert){

ContactTriggerHandler.afterInsert(trigger.New);

public class ContactTriggerHandler{

public static void afterInsert(List<Contact> conList){

Set<Id> accountIdSet = new Set<Id>();


Set<Id> contactIdSet = new Set<Id>();
List<Contact> conList = new List<Contact>;

for(Contact con : conList){

accountIdSet.add(con.Id);
contactIdSet.add(con.Id);

Contact contact = new Contact();


contact.Id = con.Id;
contact.isLastChild__c = true;

conList.add(contact);
}

for(Contact con : [select id, isLastChild__c, Name from contact where AccountId In:
accountIdSet AND isLastChild__c = true AND Id NOT IN: contactIdSet]){

Contact contact = new Contact();


contact.Id = con.Id;
contact.isLastChild__c = false;

conList.add(contact);

if(conList.size() > 0)
update conList;

how salesforce will identify its a recurrsive trigger


how to handle recurrsive trigger
how many records will be processed in trigger
events in LWC
difference between future & batch class
method overridding
will permission set will override the profile
apex methodologies
lwc lifecycle hook
governer limits in salesforce
named credentials
stringyfy & method used in apex integration
how to schedule batch using chron expression
sharing rule vs role hierarchy

types of flows in salesforce


how to call flow from another flow

-----------------------------------------------------------------------------------
-----------------------------------------
bulk api
how to import millions of records in salesforce
in which trigger scenario we will get record is read only
in before record triggered flow can we call subflow
lwc lifecycle hook parent to child
insert 2000 record batch size is 500, & howmmany records get process in trigger
can we have trigger.new & trigger.newmap in before trigger
ci/cd
which deployment tools you have used for deployment
with sharing / without sharing
what kind of flows we can create
what is difference between 15 & 18 digit record Id
platform events

-----------------------------------------------------------------------------------
-----------------------------------------

You might also like