CompanyCognizant 2024
Focus AreaSalesforce Developer
Questions19+
Topics4
Cognizant 2024 Salesforce developer interview experience, shared by a real candidate.
What's Covered
Topics covered in this interview.
01Lightning Web Components7
02Apex & Triggers4
03Salesforce Core Concepts3
04General & Experience5
All Interview Questions
Every question asked in this interview, listed one by one.
1What are the ways in LWC for child to parent and parent to child communications.
2Explain LWC life cycle.
3Tell me some difference in Aura & LWC.
4What we can do with Aura and not in LWC?
5When wire method get call in LWC life cycle?
6Why we have get and set in LWC?
7What is string mutation in LWC?
8What are the advantages of using wire method.
9How wire method detect the data has been changed.
10Can we control field label security in Apex? How?
11Write a Trigger: When check box is checked on Meeting object. The meeting status should changed to Cancelled.
12Can we restrict access using permission set?
13When you have last used permission set and for what purpose?
14What us muting for permission sets?
15Worked on CRM Dashboards?
16How can we retrieve CRM Dashboards?
17Open notepad and write code for showing related Contacts and Opportunity of Account Object. First tell me approaches.
18How I can display n number of records without pagination.
19What are wrapper classes? Can you write sample code?
More Salesforce Interview Questions to Practice
The extra questions below are not from this interview. They cover the same topics and are commonly asked in Salesforce developer interviews, so they make good practice before your own round.
Lightning Web Components questions
- What is Lightning Data Service, and which base components use it?
- How do you handle errors returned from an Apex call in LWC?
- What is the difference between document.querySelector and this.template.querySelector?
- How do you render content conditionally in LWC?
- What are slots, and how do named slots work?
Apex questions
- What is the order of execution when a record is saved?
- How do you write a good test class, and what is the minimum code coverage for deployment?
- What does @AuraEnabled(cacheable=true) do?
- How do you handle exceptions in Apex, and what is a custom exception?
Triggers questions
- What is the difference between addError on a record and addError on a field?
- What happens when a trigger and a record-triggered Flow run on the same object?
- What are the trigger context variables?
- What is the difference between before and after triggers, and when do you use each?
Security and Administration questions
- What is a validation rule, and how can you bypass it for specific users?
- What is the difference between a role and a profile?
- What are record types and page layouts used for?
General and experience questions
- What was the most challenging issue you solved recently, and how did you solve it?
- How do you approach debugging a production issue?
- How do you decide between a declarative and a programmatic solution?
Concepts to Revise
Based on the questions on this page, these are the areas most worth revising.
Lightning Web Components
- Lifecycle hooks: constructor, connectedCallback, renderedCallback, disconnectedCallback
- Decorators: @api, @track, @wire and when each is needed
- Parent to child and child to parent communication using properties and custom events
- Lightning Data Service and the uiRecordApi functions
- Calling Apex: wire versus imperative, and cacheable methods
- Template directives: if:true, for:each, key and lwc:if
Apex
- Governor limits for SOQL, DML, CPU time and heap size
- Bulkification: no SOQL or DML inside loops
- Sharing keywords and how they affect record access
- Asynchronous Apex: future, queueable, batch and schedulable
- Test classes: test data, System.assert, Test.startTest and Test.stopTest
- Collections and wrapper classes
Triggers
- Context variables: isBefore, isAfter, isInsert, isUpdate, isDelete, isUndelete
- Trigger.new, Trigger.old, Trigger.newMap and Trigger.oldMap, and in which events each exists
- One trigger per object with a handler class
- Preventing recursion with static variables
- addError to block a save with a message
- Testing triggers with single and bulk records
How to Prepare
The questions on this page lean towards Lightning Web Components, Apex and Triggers. Spend most of your revision time there, then cover the remaining topics lightly.
- Build one small component that uses @wire, an imperative Apex call and a custom event, and be ready to explain each part.
- Practise explaining governor limits and bulkification with a real example from your own project.
- Write a trigger with a handler class from memory, then test it with 200 records to prove it is bulk safe.
- Say your answers out loud. Interviewers listen for clear, structured explanations, not memorised definitions.
- Prepare one or two real examples from your own projects for the general questions.
Preparing for a Salesforce developer interview?
Browse more real company interview experiences and hands-on Apex trigger patterns.