Cognizant
20+ Agility E Services Interview Questions and Answers
Q1. How many ways asynchronous code can be written in Salesforce
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
Q2. 5. Methods of Batchable Interface
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.
Q3. How to cal child to parent in Lightning aura
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
Q4. Access Modifiers in Apex
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
Q5. Annotations used in salesforce
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
Q6. What are profiles and users in Salesforce?
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.
Q7. Difference between sales cloud and service cloud.
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
Q8. Order Of Execution
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
Q9. Coding best practices
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
Q10. Sort a string for both lowe and uper case characters
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.
Q11. Difference between classic and lighting
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
Q12. Give count of contact records of account trigger
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
Q13. Trigger and test class best practices
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
Q14. What is Salesforce?crm
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
Q15. What is apex in Salesforce?
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.
Q16. What is events in aura
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.
Q17. What is LWC in Salesforce.
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
Q18. Diff between wire and imperative
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
Q19. What is trigger ?
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.
Q20. What is apex sharing
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
Q21. Explain lifecycle hooks in lwc
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
Q22. Diff between aura and lwc
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
Q23. Explain batch and batch size
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
Q24. Explain sharing rules
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.
More about working at Cognizant
Top HR Questions asked in Agility E Services
Interview Process at Agility E Services
Top Salesforce Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month