EMT Practice Test

1. Question Content...


Question List

Question1: Which annotation exposes an Apex class as a RESTful web service?

Question2: Universal Containers has large number of custom applications that were built using a third-party javaScript framework and exposed using Visualforce pages. The Company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience. What should the developer do to fulfill the business request in the quickest and most effective manner?

Question3: When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?

Question4: A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what defined for payments in the PaymentProcessor interface. public interface PaymentProcessor { void pay(Decimal amount); } Which is the correct implementation to use the PaymentProcessor interface class?

Question5: A Salesforce Administrator used Flow Builder to create a flow named ''accountOnboarding''. The flow must be used inside an Aura component.
Which tag should a developer use to display the flow in the component?

Question6: A developer has to identify a method in en Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a SOQL statement to save the changes to the database.
Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits?
Choose 2 answers

Question7: A developer must create a CreditcardPayment class that provides an implementation of an existing Payment class. Public virtual class Payment { public virtual void makePayment(Decimal amount) { /*implementation*/ } } Which is the correct implementation?

Question8: Assuming that 'name; is a String obtained by an <apex:inputText> tag on a Visualforce page. Which two SOQL queries performed are safe from SOQL injections? Choose 2 answers

Question9: A developer needs to save a List of existing Account records named myAccounts to the database, but the records do not contain Salesforce Id values. Only the value of a custom text field configured as an External ID with an API name of Foreign_Key__c is known.
Which two statements enable the developer to save the records to the database without an Id? (Choose two.)

Question10: code below deserializes input into a list of Accounts.

Which code modification should be made to insert the Accounts so that field-level security is respected?

Question11: Which three statements are accurate about debug logs? Choose 3 answers

Question12: A developer is asked to explore if this automation can be implemented without writing any Apex code.
Which statement is true regarding this automation request?

Question13: Given the following trigger implementation:
trigger leadTrigger on Lead (before update){
final ID BUSINESS_RECORDTYPEID = '012500000009Qad';
for(Lead thisLead : Trigger.new){
if(thisLead.Company != null && thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){ thisLead.RecordTypeId = BUSINESS_RECORDTYPEID;
}
}
}
The developer receives deployment errors every time a deployment is attempted from Sandbox to Production.
What should the developer do to ensure a successful deployment?

Question14: Which action may cause triggers to fire?

Question15: When a user edits the Postal Code on an Account, a custom Account text field named "Timezone" must be update based on the values in a PostalCodeToTimezone__c custom object. How should a developer implement this feature?

Question16: Universal Containers recently transitioned from Classic to Lighting Experience. One of its business processes requires certain value from the opportunity object to be sent via HTTP REST callout to its external order management system based on a user-initiated action on the opportunity page. Example values are as follow Name Amount Account Which two methods should the developer implement to fulfill the business requirement? (Choose 2 answers)

Question17: Universal Containers (UC) decided it will not to send emails to support personnel directly from Salesforce in the event that an unhandled exception occurs. Instead, UC wants an external system be notified of the error. What is the appropriate publish/subscribe logic to meet these requirements?

Question18: A developer is debugging the following code to determinate why Accounts are not being created Account a = new Account(Name = 'A'); Database.insert(a, false); How should the code be altered to help debug the issue?

Question19: A recursive transaction is limited by a DML statement creating records for these two objects:
1. Accounts
2. Contacts
The Account trigger hits a stack depth of 16.
Which statement is true regarding the outcome of the transaction?

Question20: A developer Is asked to create a Visualforce page that lists the contacts owned by the current user. This component will be embedded In a Lightning page.
Without writing unnecessary code, which controller should be used for this purpose?

Question21: What can used to delete components from production?

Question22: A developer migrated functionality from JavaScript Remoting to a Lightning web component and ... existing getOpportunities method to provide data.

Question23: A business implemented a magnification plan to encourage its customers to watch some educational videos.
Customers can watch videos over several days, and their progress is recorded. Award points are granted to customers for all completed videos. When the video is marked as completed in Salesforce, an external web service must be called so that points can be awarded to the user.
A developer implemented these requirements in the after update trigger by making a calf to an external web service. However, a System.CalloutException is occurring.
What should the developer do to fix this error?

Question24: A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org. Which tool should the developer use to troubleshoot?

Question25: A developer needs to update an unrelated object when a record gets saved. Which two trigger types should the developer create?

Question26: Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1,000,000. A developer created the following trigger on the Account object to satisfy this requirement.

Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, It fails with system. Exception errors.
Which two actions should the developer take to fix the code segment shown above?
Choose 2 answers

Question27: A developer created a trigger on the Account object and wants to test if the trigger is properly bulklfield. The developer team decided that the trigger should be tested with 200 account records with unique names.
What two things should be done to create the test data within the unit test with the least amount of code? Choose 2 answers A developer created a trigger on the Account object and wants to test if the trigger is properly bulklfield. The developer team decided that the trigger should be tested with 200 account records with unique names.
What two things should be done to create the test data within the unit test with the least amount of code?
Choose 2 answers

Question28: what are the methods used to show input in classic and lightning ?

Question29: Given the code below:

What should a developer do to correct the code so that there is no chance of hitting a governor limit?

Question30: Which two statements accurately represent the MVC framework implementation in Salesforce? Choose 2 answers

Question31: For which three items can a trace flag be configured?
Choose 3 answers

Question32: A develop created these three roll-up summary fields on the custom object. Project_c:

The developer is asked to create a new field that should the ratio between rejected and approved timesheet for a given project.
What are two benefits of choosing a formula held instead of an Apex trigger to fulfill the request? Choose 2 answers

Question33: Which three statements are true regarding trace flags? (Choose three.)

Question34: What is a benefit of developing applications in a multi-tenant environment?

Question35: A developer created these three Rollup Summary fields in the custom object, Project_ct,

The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.
Which should the developer use to Implement the business requirement in order to minimize maintenance overhead?

Question36: Which action causes a before trigger to fire by default for Accounts?

Question37: When importing and exporting data into Salesforce, which two statements are true?
Choose 2 answers

Question38: A developer needs to create a custom button for the Account object that, when clicked, will perform a series of calculation and redirect the user to a custom visualforce page.
Which three attributes need to be defined with values in the <apex:page> tag to accomplish this?
Choose 3 answers

Question39: A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violation to the user. How can the developer make sure that validation rule violations are displayed?

Question40: A developer identifies the following triggers on the Expense_c object:
DeleteExpense,
applyDefaultstoexpense
validateexpenseupdate;
The triggers process before delete, before insert, and before update events respectively.
Which two techniques should the developer implement to ensure trigger best practice are followed?

Question41: Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records. which Visualforce feature supports this requirement?

Question42: Which exception type cannot be caught?

Question43: A developer creates a custom exception as shown below:
What are two ways the developer can fire the exception in Apex? Choose 2 answers

Question44: What are two best practices when it comes to Lightning Web Component events?

Question45: What are two ways that a controller and extension can be specified on a Visualforce page?
Choose 2 answers

Question46: A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces. public interface Sortable { void sort(); } public interface Drawable { void draw(); } Which is the correct implementation?

Question47: A developer must build application that tracks which Accounts have purchase specific pieces of equal products. Each Account could purchase many pieces of equipment.
How should the developer track that an Account has purchased a piece of equipment.

Question48: What will be the output in the debug log in the event of a QueryExeption during a call to the @query method in the following Example?

Question49: A lead developer creates an Apex interface called "Laptop". Consider the following code snippet:

How can a developer use the Laptop Interface within the Silvertaptop class?

Question50: A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineItem trigger. Which method allows access to the price book?

Question51: A development team wants to use a deployment script lo automatically deploy lo a sandbox during their development cycles.
Which two tools can they use to run a script that deploys to a sandbox?
Choose 2 answers

Question52: A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of test allowing them to test independent requirements various types of Salesforce Cases.
Which approach can efficiently generate the required data for each unit test?

Question53: What is the value of the Trigger.old context variable in a Before Insert trigger?

Question54: Which process automation should be used to post a message to Chatter without using Apex code?

Question55: Which process automation should be used to send an outbound message without using Apex code?

Question56: Which code should be used to update an existing Visualforce page that uses standard Visualforce components so that the page matches the look and feel of Lightning Experience?

Question57: A developer is implementing an Apex class for a financial system. Within the class, the variables 'creditAmount' and 'debtAmount' should not be able to change once a value is assigned. In which two ways can the developer declare the variables to ensure their value can only be assigned one time? Choose 2 answers

Question58: While writing an Apex class that creates Accounts, a developer wants to make sure that all required fields are handled properly.
Which approach should the developer use to be sure that the Apex class works correctly?

Question59: Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation.
What are two characteristics of declarative development over programmatic customization?
Choose 2 answers

Question60: A developer needs to create a custom Interface in Apex.
Which three considerations must the developer keep in mind while developing the Apex Interface?
Choose 3 answers

Question61: Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required?

Question62: Which statement is true about developing in a multi-tenant environment?

Question63: What are two characteristics related to formulas? Choose 2 answers.

Question64: A developer must create an Apex class, contactcontroller, that a Lightning component can use to search for Contact records. User of the Lightning component should only be able to search Contact records to which they have access. Which two will restrict the records correctly?

Question65: Universal container wants a list button to display a visualforce page that allows users to edit multiple records which visualforce feature supports this requirement.

Question66: Universal Container use a simple order Management app. On the Order Lines, the order line total is calculated by multiplying the item price with the quantity ordered. There is a Master-Detail relationship between the Order and the Order Lines object.
What is the practice to get the sum of all order line totals on the order header?

Question67: A developer is building custom search functionality that uses SOSL to search account and contact records that match search terms provided by the end user. The feature is exposed through a Lightning web component, and the end user is able to provide a list of terms to search.
Consider the following code snippet:

What is the maximum number of search terms the end user can provide to successfully execute the search without exceeding a governor limit?

Question68: A developer needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent.
Which action will allow the developer to relate records in the data model without knowing the Salesforce ID?

Question69: which statement is true regarding execution order when triggers are associated to the same object and event?

Question70: A workflow updates the value of a custom field for an existing Account.
How can a developer access the updated custom field value from a trigger?

Question71: Which two statements are accurate regarding Apex classes and interfaces?
Choose 2 answers

Question72: What are three ways for a developer to execute tests in an org? Choose 3.

Question73: What should a developer do to check the code coverage of a class after running all tests?

Question74: A developer has an integer variable called maxAttempts. The developer meeds to ensure that once maxAttempts is initialized, it preserves its value for the lenght of the Apex transaction; while being able to share the variable's state between trigger executions. How should the developer declare maxAttempts to meet these requirements?

Question75: The following code snippet is executed by a Lightning web component in an environment with more than 2,000 lead records:

Which governor limit will likely be exceeded within the Apex transaction?

Question76: A Salesforce developer wants to review their code changes immediately and does not want to install anything on their computer or on the org.
Which tool is best suited?

Question77: An org has an existing Flow that creates an Opportunity with an Update Records element. A developer update the Flow to also create a Contact and store the created Contact's ID on the Opportunity.
Which update should the developer make in the Flow?

Question78: A credit card company needs to Implement the functionality for a service agent to process damaged credit cards. When the customers call In, the service agent must gather many pieces of information Is tasked to Implement this functionality.
What should the developer use to satisfy this requirement In the most efficient manner?

Question79: A custom object Trainer_c has a lookup field to another custom object Gym___c.
Which SOQL query will get the record for the Viridian City gym and it's trainers?

Question80: A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an Orderltem object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders.
What should a developer do to allow their code to move some existing Orderltem records to a new Order record?

Question81: A software company uses the following objects and relationships:
* Case: to handle customer support issues
* Defect_c: a custom object to represent known issues with the company's software
* case_Defect__c: a junction object between Case and Defector to represent that a defect Is a customer issue What should be done to share a specific Case-Defect_c record with a user?

Question82: Which declarative process automation feature supports iterating over multiple records?

Question83: Managers at Universal Containers want to ensure that only decommissioned containers are able to be deleted in the system. To meet the business requirement a Salesforce developer adds ^Decommissioned" as a picklist value for the Status__: custom field within the Contact__c object.
Which tool should the developer use to enforce only Container records with a status of "Decommissioned" can be deleted?

Question84: The following Apex method is part of the ContactService class that is called from a trigger: public static void setBusinessUnitToEMEA(Contact thisContact){ thisContact.Business_Unit__c = "EMEA" ; update thisContact; } How should the developer modify the code to ensure best practice are met?

Question85: A developer considers the following snippet of code:

Based on this code, what is the value of x?

Question86: What are two ways a developer can get the status of an enquered job for a class that queueable interface? Choose 2 answers

Question87: What are two use cases for executing Anonymous Apex code? Choose 2 answers

Question88: Which three resources in an Azure Component can contain JavaScript functions?

Question89: In the following example, which sharing context will myMethod execute when it is invoked?

Question90: The Job_Application__c custom object has a field that is a Master-Detail relationship to the Contact object, where the Contact object is the Master. As part of a feature implementation, a developer needs to retrieve a list containing all Contact records where the related Account Industry is 'Technology' while also retrieving the contact's Job_Application__c records.
Based on the object's relationships, what is the most efficient statement to retrieve the list of contacts?

Question91: Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, BodyFat, and its method, calculateBodyFat(). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace.
Which approach should a developer take to ensure calculateBodyFat() is accessible outside the package namespace?

Question92: Universal Container(UC) wants to lower its shipping cost while making the shipping process more efficient. The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address. The Developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called "Global Address". Which field should the developer ad to create the most efficient model that supports the business need?

Question93: What is an example of a polymorphic lookup field in Salesforce?

Question94: Which three data types can a SOQL query return? Choose 3 answers

Question95: In terms of the MVC paradigm, what are two advantages of implementing the layer of a Salesforce application using Aura Component-based development over Visualforce? Choose 2 answers

Question96: Consider the following code snippet:

Given the multi-tenant architecture of the Salesforce platform, what Is a best practice a developer should Implement and ensure successful execution of the method?

Question97: A developer has two custom controller extensions where each has a save() method.
Which save() method will be called for the following Visualforce page?
<apex:page standardController ="Account", extensions="ExtensionA, ExtensionB">
<apex:commandButton action ="{!save}" value="Save"/>
</apex:page>

Question98: Universal Containers stores Orders and Line Items in Salesforce. For security reason, financial representatives are allowed to see information on the Order such as order amount, but they are not allowed to see the Line items on the Order. Which type of relationship should be used?

Question99: Given the following Apex statement:
Account myAccount = [SELECT Id, Name FROM Account];
What occurs when more than one Account is returned by the SOQL query?

Question100: As a part of class implementation a developer must execute a SOQL query against a large data ser based on the contact object. The method implementation is as follows.

Which two methods are best practice to implement heap size control for the above code? (Choose 2 Answers)

Question101: AW Computing (AWC) handles orders In Salesforce and stores Its product Inventory In a fter, inventory__c, on a custom object, Product__c. When en order for a Product__c Is placed, the inventory__c field Is reduced by the quantity of the order using an Apex trigger.

AWC wants the real-time inventory reduction for a product to be sent to many of Its external systems, Including some future systems the company Is currently planning.
What should a developer add to the code at the placeholder to meet these requirements?
A)

B)

C)

D)

Question102: Universal Containers decides to use exclusively declarative development to build out a new Salesforce application. Which three options should be used to build out the database layer for the application? Choose 3 answers

Question103: A developer is creating a test coverage for a class and needs to insert records to validate functionality. Which method annotation should be used to create records for every method in the test class?