Special OFFER: 1st Enroll Flat 25% OFF OR 2nd Enroll Get 40% OFF | Use Coupon JTOFFER25

- Salesforce Blogs -

Top 20 Salesforce Apex Interview Questions and Answers in 2021


Apex in Salesforce Org is a development platform used for designing essential Software as a Service (SaaS) apps readily on top of Salesforce.com's customer relationship management (CRM) silo. Apex is the feature that allows Salesforce Developers to access Salesforce.com's much important back-end database as well as the client-server assemblage to create important third-party SaaS applications.

Good knowledge in Apex has become a big necessity for a lot of job profiles in Salesforce. Most of the companies look for your capability in handling this ultimate Feature of Salesforce. Since it is in so much demand there are many job openings for the role of an Apex Salesforce Developer. If you are someone who has applied for the post of Apex Developer somewhere and you are expecting an interview to be scheduled soon then you should take a brief look at this blog. In this blog, the team of JanBask Training has collated a few most frequently and likely to be asked Salesforce interview questions for freshers or advanced professionals appearing for an interview related to Salesforce Apex. 

Salesforce Apex Interview Questions

We have prepared a very exhaustive list of questions for the individuals who are looking forward to attending the Apex interview any time soon. The most popular salesforce apex interview questions or Salesforce trigger interview questions are given here in this blog would definitely help you in the right way. Here, we have included the top frequently asked Salesforce interview questions and answers for developer experienced or freshers along to help everyone carve their niche in Salesforce.

Apex Interview Questions & Answers for Freshers

Check out the Salesforce interview questions for freshers of Apex often asked in interviews.

Q1). What is Apex?

Ans:- Apex is an object-oriented and strongly typed computer programming language which enables the developers to implement flow and transaction control statements on all the Salesforce servers in collation with calls to the APIs. It uses syntax that looks quite like that of Java and works like the database stored processes. Apex helps the developers to implement business logic with most of the system events, together with tab clicks, related record updates, as well as the Visualforce pages. 

Learn more about Apex with Salesforce online training

Q2). What is Apex Scheduler?

Ans:-Apex Scheduler is the feature which is used to invoke the Apex classes to help them run at explicit times, first, execute the Schedulable assemblage for the class, then state the schedule by utilizing either the Schedule Apex page or the System.

Q3). Give an example of Implicit and Explicit Invocation of apex?


  • Implicit -> Triggers

  • Explicit -> JavaScript Remoting

Q4). What is an Abstract Class?

Ans:-Abstract classes in Salesforce Apex are the classes that comprise one dynamic strategy at least. A conjectural technique is an approach that is marked though it contains no use whatsoever.

Read: What is CRM? Salesforce CRM Tutorial Guide For Beginners

Q5). What is a Scheduler class in Apex?

Ans:-The Apex class is the class which is planned to run at some predefined intermission of programming classes. A Scheduler Class must necessarily execute a schedulable crossing point and it should also contain the method ‘named execute ()’.

Q6). Name a few aggregate functions that are supported by Salesforce SOQL Apex?

Ans:-Following aggregate functions are supported by Salesforce SOQL-

  • Sum ()
  • Min()
  • Max()
  • Count()
  • Avg()
  • Count_Distinct() 

Q7). What do you think is the difference between a standard and a custom controller?

Ans:-The standard controller in Salesforce Apex programming is auto-generated by the Salesforce silo for all its objects. Whereas the Custom controllers are the control commands that are written by the developer and they do what the code was written by the developer tells them to do.

Q8). Elucidate the difference between Ajax and ActionPoller?

Ans:-ActionPoller is the clock in Apex that enables an AJAX refresh demand to be sent to the server as instructed by a period interim that the developer determines.

Q9). How can you refer to a current page id in Apex?

Ans:-In case you wish to retrieve or refer to required ID in a Visualforce page then, in that case, you can easily refer to it utilizing a standard controller.

Q10). What do you mean by page reference?

Ans:-A Page Reference in Apex environment is a reference which is made to an instantiation of a specific page. Among the several different characteristics that it possesses the most noteworthy ones are- Page References that comprise a URL and a plan of inquisition parameters of several names and qualities.

Get Salesforce scenario based interview questions for freshers pdf here!

Apex Interview Questions & Answers for Experienced

Here are the Salesforce interview questions and answers for developer experienced for more than 3-4 years.

Q11). What is a virtual class in Apex programming?

Ans:- In an environment where you are conducting protest situated type of programming, a virtual class is a term referred to a settled kind of inward class whose capacity along with the part factors can be easily abrogated and also reclassified by the other subclasses of any other external class. Virtual classes are something that closely resembles the virtual capacities of the program.

Read More: Salesforce Developer Role and Responsibilities

Q12). Explain the difference between trigger.new and trigger.newmap?

Ans:-Trigger. new can be used as a part and parcel of when the type of activities. Whereas the Trigger.newmap can only be used as a part and parcel of an after embed and after and before a refresh.

Read: What are Salesforce Workflow Rules? How to Create Workflow Rules?

Q13). What is Overloading in Apex?

Ans:-Overloading in Apex programming alludes to the capability to make use of alone identifier to distinguish various techniques for a class that contrasts in their in sequence virtues and gives way to the function parameters. Overload techniques are generally, for the most part, used especially when they convincingly carry out a comparable enterprise yet to some extent only one of its kind of arrangement of function parameters.salesforce quiz

It is an idea which is used to steer totally away from the overindulgence of programming code where a comparable line of attack can be easily utilized in a number of circumstances when coupled with a few alternate arrangements of function parameters.

The real strategy that you had originally developed gets called in during the runtime to settle the assemble time, along these very lines balancing a very strategic distance from all the runtime mistakes that can occur. Overloading is the method that gives code the lucidity it requires, takes out its multilateral quality, and upgrades the runtime implementation.

Q14). What is your opinion as a developer is a need for a Batch Apex?

Ans:-To begin with, it is first important for you to know that the Salesforce governor puts strict limits on its data. In case you want to get hold of the huge amount of records or fire DML on an n number of rows on class objects, it is very multifarious in Salesforce and it definitely does not let you manoeuvre on other than the certain specific number of data models or records that perfectly satisfies the Governor limits which are set.

Nevertheless, for medium to large businesses, it is very important to administer a large number of records every day. Adding/editing/deleting them whenever it is required. To handle this scenario Salesforce had to come up with this powerful commanding concept called the Batch Apex. Batch Apex is the feature that allows you to manage paperwork or files effectively and maneuver them by means of an unambiguous syntax.

Read More: Salesforce Tutorial Guide for Beginners 

Q15). What do you understand about web service callouts?

Ans:-Apex Code is a wonderful platform that chains the aptitude of interpretation of the Apex procedures as an essential Web service. Salesforce Apex also supports the capability to call upon the peripheral internet services and this is what is referred to as 'Callouts.' The former one is drawn in while creating a request for the web service that a customer can bring into play, while the second one is invoking an outside web service.

Q16). Explain a few Considerations required for a Static keyword in Apex.

Ans:-Here are a few considerations required for a Static keyword in Apex.

  • An Apex class can't be static.

  • Static is allowed just in an outer class.

  • Static variables are not exchanged as a part of the View State.

  • Static variables and static blocks keep running altogether in which they are composed in a class.

  • Static variables are static only to the extent of demand.

The Salesforce Self-learning module will help you formulate more concepts like this at your own pace.

Q17). What is your opinion on the possibility to call an apex method in javascript code?

Ans:-Truly, we can call apex methods utilizing javascript. We can accomplish this utilizing ActionFunction. An ActionFunction enables you to attach an apex method to a javascript function name and conjure synchronously. ActionFunction must be stated as a child of the apex: form component. 

Read: How to Export Backup Data from Salesforce?

Q18). What is the difference between public and global class in Apex?

Ans:-A public class is accessible to the inside application or namespace. This isn't precisely similar to a public modifier in Java whereas Global class is visible everywhere, in any application or namespace. Web Service must be proclaimed as Global and which can be accessed inside Javascript as well. It resembles a public modifier in Java.

Q19). What is commandLink?

Ans:-CommandLink is a connection that implements an activity which is characterized by the program controller, and thereafter invigorates the present page or explores to the distinctive page in light of the Page Reference variable that is returned by the action.

Q20). What is outputLink?

Ans:-OutputLink is a connection to URL. This part is rendered in HTML as an anchor tag with an href property. The body of the OutputLink is a text or picture that displays the connection.

For complete Salesforce Trigger Interview Questions on Apex, get here!


These were the Salesforce Apex interview questions and answers for freshers and experienced often asked in the interview sessions. Prepare for them before your next interview round by grasping the Apex and other Salesforce concepts well.

JanBask Training gives a path to your skills and areas of expertise with industry-level projects. We can help you fast track your career with the training in Salesforce certifications you are looking for. 

Get a complete PDF of Salesforce scenario based interview questions, here!

If you have any questions regarding Salesforce Apex or want to ask any Salesforce scenario based interview questions, you ask in the comment section below. Happy coding!

Your Next Read:

Salesforce Tutorial Overview

FaceBook Google+ LinkedIn Pinterest


    With fact-finding market research & solicitous words, Nandita helps our digital learners globally navigate their way to profound career possibilities in IT and Management.


  • L

    Louis Anderson

    I want to grow my career in salesforce technology, right now i am pursuing my BCA, can you guide me what next i can do for entering salesforce career path.

  • H

    Holden White

    What is the role of salesforce apex? What are the required certifications for this profile? Is it similar to a salesforce developer?

  • P

    Paxton Harris

    Need some more sample questions, kindly release another blog on the same topic with some more questions.

  • N

    Nash Martin

    Nice interview guide on salesforce apex interview questions.The way questions are answered is really simple to understand but i thought few answers need to be more laborative to explain well. But overall a nice post!

  • P

    Phoenix Robinson

    Looking for some more questions based on salesforce apex, and most of the listed questions are theoretical, i need some technical questions.

  • J

    Jax Williams

    Thanks for the article! I cleared my Salesforce Apex interview with the help of topics you suggested and the questions were really helpful.

  • A

    Amari Jones

    Hi, the article is really informative but I wanted to know about the Salesforce Apex interview questions and answers related to Business Analysts.

  • H

    Holden White

    The post is quite informative but I felt few answers were too short, I mean they need to be intricate.

  • A

    Aidan Johnson

    I am impressed with the answers you have provided in the article. Thanks team!!

  • R

    Rafael Lewis

    What is the cost of the Salesforce apex course?


Trending Courses


  • AWS & Fundamentals of Linux
  • Amazon Simple Storage Service
  • Elastic Compute Cloud
  • Databases Overview & Amazon Route 53

Upcoming Class

13 days 05 Nov 2021


  • Intro to DevOps
  • GIT and Maven
  • Jenkins & Ansible
  • Docker and Cloud Computing

Upcoming Class

-0 day 23 Oct 2021

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning

Upcoming Class

6 days 29 Oct 2021


  • Architecture, HDFS & MapReduce
  • Unix Shell & Apache Pig Installation
  • HIVE Installation & User-Defined Functions
  • SQOOP & Hbase Installation

Upcoming Class

6 days 29 Oct 2021


  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL

Upcoming Class

6 days 29 Oct 2021


  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Selenium framework development using Testing

Upcoming Class

-0 day 23 Oct 2021

Business Analyst

  • BA & Stakeholders Overview
  • BPMN, Requirement Elicitation
  • BA Tools & Design Documents
  • Enterprise Analysis, Agile & Scrum

Upcoming Class

-0 day 23 Oct 2021

MS SQL Server

  • Introduction & Database Query
  • Programming, Indexes & System Functions
  • SSIS Package Development Procedures
  • SSRS Report Design

Upcoming Class

13 days 05 Nov 2021


  • Features of Python
  • Python Editors and IDEs
  • Data types and Variables
  • Python File Operation

Upcoming Class

-0 day 23 Oct 2021

Artificial Intelligence

  • Components of AI
  • Categories of Machine Learning
  • Recurrent Neural Networks
  • Recurrent Neural Networks

Upcoming Class

14 days 06 Nov 2021

Machine Learning

  • Introduction to Machine Learning & Python
  • Machine Learning: Supervised Learning
  • Machine Learning: Unsupervised Learning

Upcoming Class

27 days 19 Nov 2021


  • Introduction to Tableau Desktop
  • Data Transformation Methods
  • Configuring tableau server
  • Integration with R & Hadoop

Upcoming Class

6 days 29 Oct 2021

Search Posts


Receive Latest Materials and Offers on Salesforce Course