Add office photos
Cognizant logo
Engaged Employer

Cognizant

Verified
3.7
based on 50.5k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Salesforce Developer
Experienced
Skills
Clear (1)

20+ Cognizant Salesforce Developer Interview Questions and Answers

Updated 24 Dec 2024

Q1. How many ways asynchronous code can be written in Salesforce

Ans.

There are multiple ways to write asynchronous code in Salesforce.

  • Using @future annotation

  • Using Queueable interface

  • Using Batch Apex

  • Using Platform Events

  • Using Asynchronous Apex REST Callouts

View 1 answer
right arrow

Q2. 5. Methods of Batchable Interface

Ans.

Batchable interface has three methods: start(), execute(), and finish().

  • start() method is used to initialize the batch job and return the query locator.

  • execute() method is used to process the records returned by the query locator.

  • finish() method is used to perform any final operations after the batch job completes.

View 1 answer
right arrow

Q3. How to cal child to parent in Lightning aura

Ans.

To call child to parent in Lightning aura, use events and event handlers.

  • Create an event in the child component

  • Register the event in the parent component

  • Create an event handler in the parent component

  • Fire the event from the child component

  • Handle the event in the parent component

  • Pass data between the child and parent components using event attributes

Add your answer
right arrow

Q4. Access Modifiers in Apex

Ans.

Access modifiers in Apex control the visibility and accessibility of classes, methods, variables, and interfaces.

  • There are three access modifiers in Apex: private, public, and global.

  • Private access modifier restricts access to only within the defining class.

  • Public access modifier allows access from any other class or trigger.

  • Global access modifier allows access from any Apex code in any Salesforce organization.

  • Access modifiers can be applied to classes, methods, variables, an...read more

View 2 more answers
right arrow
Discover Cognizant interview dos and don'ts from real experiences

Q5. Annotations used in salesforce

Ans.

Annotations are used in Salesforce to add metadata to classes, methods, and variables.

  • Annotations are used to provide additional information to the compiler or runtime engine.

  • They can be used to control the behavior of code, such as enforcing security or limiting access.

  • Examples of annotations include @AuraEnabled, @TestSetup, and @Deprecated.

  • Annotations can also be used to provide documentation for code, such as @description or @param.

  • Annotations are defined using the @ symb...read more

View 1 answer
right arrow

Q6. What are profiles and users in Salesforce?

Ans.

Profiles and users in Salesforce are used to control access to data and functionality within the platform.

  • Profiles define the permissions and access settings for a group of users.

  • Users are individuals who have access to the Salesforce platform.

  • Profiles can be assigned to users to determine what they can view and edit.

  • Users can have different roles and permissions based on their profile settings.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Difference between sales cloud and service cloud.

Ans.

Sales cloud is for managing sales while service cloud is for managing customer service.

  • Sales cloud is focused on managing the sales process, from lead generation to closing deals.

  • Service cloud is focused on managing customer service, from support cases to service level agreements.

  • Sales cloud includes features like lead and opportunity management, while service cloud includes features like case management and knowledge base.

  • Sales cloud is typically used by sales teams, while s...read more

Add your answer
right arrow

Q8. Order Of Execution

Ans.

Order of Execution in Salesforce determines the sequence of events that occur when a record is saved.

  • Validation rules are executed first

  • Before triggers are executed next

  • Custom validation rules are executed after before triggers

  • After triggers are executed next

  • Assignment rules are executed after after triggers

  • Workflows are executed after assignment rules

  • Escalation rules are executed after workflows

  • Finally, the record is saved to the database

View 1 answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. Coding best practices

Ans.

Coding best practices ensure efficient, maintainable, and scalable code.

  • Use meaningful variable and function names

  • Follow a consistent coding style

  • Write modular and reusable code

  • Use version control

  • Write unit tests

  • Optimize code for performance

  • Document code and add comments

Add your answer
right arrow

Q10. Sort a string for both lowe and uper case characters

Ans.

Sort a string with both lower and upper case characters.

  • Convert the string to an array of characters.

  • Sort the array using a custom comparator function that considers case.

  • Join the sorted array back into a string.

Add your answer
right arrow

Q11. Difference between classic and lighting

Ans.

Classic is the old Salesforce UI while Lightning is the new modern UI.

  • Classic has a cluttered interface while Lightning has a cleaner and more intuitive interface.

  • Lightning has more features and customization options than Classic.

  • Lightning is optimized for mobile devices while Classic is not.

  • Lightning has a more modern look and feel compared to Classic.

  • Classic is being phased out by Salesforce in favor of Lightning.

  • Examples of Classic include the old Opportunity and Account p...read more

Add your answer
right arrow

Q12. Give count of contact records of account trigger

Ans.

Use SOQL query to count contact records related to account trigger

  • Use a SOQL query to retrieve the count of contact records related to the account trigger

  • Filter the contacts based on the account ID in the trigger context

  • Aggregate the count of contact records using COUNT() function in SOQL

Add your answer
right arrow

Q13. Trigger and test class best practices

Ans.

Best practices for triggers and test classes

  • Keep triggers focused on a single concern

  • Use helper classes to keep trigger logic clean

  • Write test classes to cover all trigger scenarios

  • Use @isTest annotation for test classes

  • Avoid hardcoding values in test classes

Add your answer
right arrow

Q14. What is Salesforce?crm

Ans.

Salesforce is a cloud-based customer relationship management (CRM) platform that helps businesses manage their sales, customer service, marketing, and more.

  • Cloud-based CRM platform

  • Helps businesses manage sales, customer service, marketing, etc.

  • Provides tools for automation, analytics, and collaboration

  • Offers customizable solutions for different industries

  • Examples: Sales Cloud, Service Cloud, Marketing Cloud

Add your answer
right arrow

Q15. What is apex in Salesforce?

Ans.

Apex is a strongly typed, object-oriented programming language used in Salesforce for creating custom business logic.

  • Apex is similar to Java and C# in syntax and structure.

  • It allows developers to add custom code to Salesforce applications.

  • Developers can use Apex to create triggers, classes, and web services.

  • Example: Writing a trigger in Apex to automatically update a field on a record when certain conditions are met.

Add your answer
right arrow

Q16. What is events in aura

Ans.

Events in Aura are used to communicate between components in the Salesforce Lightning framework.

  • Events are used to pass data or trigger actions between components.

  • There are two types of events in Aura: component events and application events.

  • Component events are used to communicate between components in the same hierarchy.

  • Application events are used to communicate between components across the entire application.

  • Events are handled using event handlers in the component markup.

Add your answer
right arrow

Q17. What is LWC in Salesforce.

Ans.

LWC stands for Lightning Web Components, a modern UI framework for building web components on the Salesforce platform.

  • LWC is a programming model for building Lightning components using modern web standards like JavaScript and HTML.

  • It provides a lightweight and efficient way to create reusable components that can be easily integrated into Salesforce applications.

  • LWC allows developers to build components that are secure, performant, and easy to maintain.

  • Examples of LWC include ...read more

Add your answer
right arrow

Q18. Diff between wire and imperative

Ans.

Wire is a reactive data binding approach in LWC, while imperative is an imperative data fetching approach.

  • Wire is used to declaratively bind data to a component, automatically handling updates.

  • Imperative is used to fetch data imperatively, giving more control over when and how data is fetched.

  • Wire is recommended for most scenarios due to its simplicity and efficiency.

  • Imperative is useful for cases where more control is needed, such as fetching data conditionally or in respons...read more

Add your answer
right arrow

Q19. What is trigger ?

Ans.

A trigger is a piece of code that automatically executes when a specified event occurs in a database.

  • Triggers are used to enforce business rules, validate data, and maintain data integrity.

  • They can be written in Apex programming language in Salesforce.

  • Triggers can be executed before or after an event like insert, update, delete, etc.

  • Example: A trigger can be used to update a related record when a new record is inserted.

Add your answer
right arrow

Q20. What is apex sharing

Ans.

Apex sharing controls access to records in Salesforce based on the organization-wide defaults and sharing rules.

  • Apex sharing allows developers to programmatically share records with users or groups in Salesforce.

  • It can be used to extend the sharing settings defined in the organization-wide defaults and sharing rules.

  • Developers can use Apex sharing to grant access to specific records based on custom logic or criteria.

  • Examples include sharing a record with a specific user based...read more

Add your answer
right arrow

Q21. Explain lifecycle hooks in lwc

Ans.

Lifecycle hooks in LWC are methods that allow developers to interact with the component lifecycle at specific points.

  • Lifecycle hooks include connectedCallback, disconnectedCallback, renderedCallback, errorCallback, and others.

  • connectedCallback is called when a component is inserted into the DOM.

  • disconnectedCallback is called when a component is removed from the DOM.

  • renderedCallback is called after the component's template has been rendered.

  • errorCallback is called when an erro...read more

Add your answer
right arrow

Q22. Diff between aura and lwc

Ans.

Aura is a component-based framework for building web apps on Salesforce platform, while LWC is a modern framework to build web components.

  • Aura is based on JavaScript and has a larger codebase compared to LWC

  • LWC uses modern web standards like ES6, Shadow DOM, and Custom Elements

  • Aura components have a .cmp file extension, while LWC components have a .html file extension

  • LWC provides better performance and is easier to debug compared to Aura

Add your answer
right arrow

Q23. Explain batch and batch size

Ans.

Batch is a process that divides a large job into smaller chunks for easier processing. Batch size is the number of records processed in each chunk.

  • Batch is used to process large volumes of data in Salesforce.

  • Batch size determines the number of records processed in each batch.

  • Batch jobs can be scheduled to run at specific times or triggered manually.

  • Batch jobs are useful for tasks like data cleansing, data migration, and complex calculations.

  • Example: A batch job to update all ...read more

Add your answer
right arrow

Q24. Explain sharing rules

Ans.

Sharing rules control the level of access users have to records in Salesforce.

  • Sharing rules are used to extend sharing access to users in public groups or roles.

  • They can be based on criteria or ownership of records.

  • Sharing rules are used when organization-wide defaults do not provide the desired level of access.

  • They can be defined for standard and custom objects.

  • Examples include giving read access to a specific group of users for records owned by a certain user.

Add your answer
right arrow

More about working at Cognizant

Back
Awards Leaf
AmbitionBox Logo
Top Rated Mega Company - 2024
Awards Leaf
Awards Leaf
AmbitionBox Logo
Top Rated IT/ITES Company - 2024
Awards Leaf
HQ - Teaneck. New Jersey., United States (USA)
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Cognizant Salesforce Developer

based on 14 interviews
2 Interview rounds
Technical Round
HR Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Salesforce Developer Interview Questions from Similar Companies

TCS Logo
3.7
 • 30 Interview Questions
PwC Logo
3.4
 • 13 Interview Questions
View all
Recently Viewed
SALARIES
OpenText Technologies
INTERVIEWS
Boeing
No Interviews
INTERVIEWS
Boeing
No Interviews
SALARIES
ValueLabs
INTERVIEWS
ValueLabs
No Interviews
COMPANY BENEFITS
OpenBet
No Benefits
INTERVIEWS
Cognizant
No Interviews
INTERVIEWS
Boeing
No Interviews
INTERVIEWS
Quest Global
No Interviews
JOBS
Infinite Computer Solutions
No Jobs
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter