Salesforce Interview Questions on Apex

Jagdish Dhus
0

  Salesforce Interview Questions on Apex -



1. What is Apex?

Ans - a. Apex is Advance Programming Experience.

          b. Apex is an Object-Orientated programming language and it is used to develop different types of products in Salesforce.

          c.  Apex allows the creation or executes flows, triggers, and lightning components.


2. what are the features of APEX?

Ans -  a. syntax is the same as Java

           b. easy to use

          c. testing is easy

          d. apex upgrade automatically

          e. integrated ( Apex support all DML operations )

          f. multitenant  


3. what are the different data types in Apex?

Ans - a. Primitive Data Types - String, Decimal, ID, Integer, Decimal, Boolean, Long, Date, Time, DateTime.

          b. Collections - List, Set, Map

          c. SObject - All Standard and Custom Object


4. What are the different collections in Apex?

Ans - a. List Collection Class - List class store the elements inside the collection in the same order in which they were inserted.

          b. Set Collection Class - Set class stores the elements inside the collection in sorted order.

          c.  Map Collection Class - Map collection allows us to store the elements in Key-Value pairs.


5. What is SOQL in Apex?

Ans - a. SOQL is a Salesforce Object Query Language.

          b. Using SOQL, We can fetch either one or more records from the object.

          c. In SOQL we can also add required user-defined conditions to filter the data.


6. What is SOSL in Apex?

Ans -  a. SOSL is a Salesforce Object Search Language.

           b. By using SOSL queries, we can search specific content in multiple objects in the database.  

           c. SOSL queries should be used with the 'FIND' keyword.


7. How many ways to write Apex programming code?

Ans - We can write Apex code in 

        a. Execute Anonymous Window

        b. Standard Navigation

        c. Developer Console

        d. Visual Studio Code Editor


8. How many ways to invoke an Apex class?

Ans - a. by using Execute Anonymous Window

          b. by using Triggers

          c. by using Visualforce pages

          d. by using batch apex class

           e. by using schedule apex

           f. by using email services

           g. by using a visual studio code editor


9. Why array is not used in Apex?

Ans - When we manage the elements by using Array, it causes some issues like

        a. Array can hold similar types of elements.

        b. Array supports static memory allocation.

        c. Array doesn't provide proper memory management.

        d. Array size can not change at runtime.

        e. We don't have readymade methods to manage the elements inside the array.

        f. We can not insert or remove the elements from the middle of the array.

        that's why instead of an array we use the collection classes.


10. What is Bulkification? / Why do we use the Bulkification process?

Ans - a. When we perform DML operations on records, we can have max 150 DML statements inside a single transaction.

          b. If we tried to perform more than 150 DML operations it causes an exception ('System.Limit.Exception Too many DML Statement:151').

          c. To avoid this problem, always bulkify the code i,e instead of performing the operations on each record separately, we can use the collection and perform the DML operations on Collections.   


11. How do you select all fields from an object using SOQL?   

Ans - by using SELECT * FROM Account;


12. Which operator can be used to combine two or more criteria while writing a SOQL query?

Ans -  AND operator 


13. What is the maximum number of records that can be returned by a single SOQL query?

Ans - 100000


14. What are the different types of relationship queries available in Salesforce?

Ans - a. parent-to-child relationship

          b. child-to-parent relationship


15. What’s the difference between static and dynamic SOQL queries?

Ans -  Static SOQL queries can not be changed at run time and Dynamic SOQL queries can be changed as needed.

Post a Comment

0Comments
Post a Comment (0)
To Top