EMT Practice Test

1. Question Content...


Question List

Question1: 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

Question2: What are two features of Heroku Connect? Choose 2 answers

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

Question4: Which type of code represents the Model in the MVC architecture on the Force.com platform?

Question5: A developer created a helper class with a method that can be called from Visualforce pages, web services, triggers, and of even anonymous code. When the method is called from a trigger, the developer needs to execute logic that should not be executed If the method Is called from anywhere else. How can the developer determine if the code Is executed in a trigger context?

Question6: A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console?

Question7: How many levels of child records can be returned in a single SOQL query from one parent object?

Question8: How should a developer make sure that a child record on a custom object, with a lookup to the Account object, has the same sharing access as its associated account?

Question9: Which two queries can a developer use in a Visualforce controller to protect against SOQL injection vulnerabilities? Choose 2 answers

Question10: A developer created an Apex trigger using the Developer Console and now wants to debug codeHow can the developer accomplish this in the Developer Console?

Question11: A developer needs to include a Visualforce page in the detail section of a page layout for the Account object, but does not see the page as an available option in the Page Layout Editor. Which attribute must the developer include in the <apex:page> tag to ensure the Visualforce page can be embedded in a page layout?

Question12: A developer executes the following query in Apex to retrieve a list of contacts for each account:
List<account> accounts = [Select ID, Name, (Select ID, Name from Contacts) from Account] ; Which two exceptions may occur when it executes? (Choose two.)

Question13: A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. What step should the developer take to resolve the issue and properly test the exception?

Question14: Which statement results in an Apex compiler error?

Question15: Which actions can a developer perform using the Schema Builder?Choose 2 answers

Question16: Managed Packages can be created in which type of org?

Question17: What declarative method helps ensure quality data? Choose 3 answers

Question18: A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URLWhich statement is unnecessary inside the unit test for the custom controller?

Question19: Which collection type provides unique key/value pairings of data?

Question20: How should a developer prevent a recursive trigger?

Question21: Which three statements are true regarding the @istest annotation? Choose 3 answers

Question22: Which action can a developer take to reduce the execution time of the following code? List<account> allaccounts = [select id from account]; list<account> allcontacts = [select id, accountid from contact]; for (account a :allaccounts){ for (contact c:allcontacts){ if(c.accountid = a.id){ //do work }
} }

Question23: A developer needs to test an Invoicing system integration. After reviewing the number of transactions required for the test, the developer estimates that the test data will total about 2 GB of data storage.
Production data is not required for the integration testing.
Which two environments meet the requirements for testing? (Choose two.)

Question24: A developer uses a before insert trigger on the Lead object to fetch the Territory__c object, where the Territory__c.PostalCode__c matches the Lead.PostalCode. The code fails when the developer uses the Apex Data Loader to insert 10,000 Lead records. The developer has the following code block: Line-01: for (Lead l : Trigger.new){Line-02: if (l.PostalCode != null) {Line-03: List<Territory__c> terrList = [SELECT Id FROM Territory__c WHERE PostalCode__c = :l.PostalCode];Line-04: if(terrList.size() > 0) Line-05:
l.Territory__c = terrList[0].Id; Line-06: }Line-07: }Which line of code is causing the code block to fail?

Question25: A developer wants to display all of the available record types for a Case object. The developer also wants to display the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom Visualforce page. Which action can the developer perform to get the record types and picklist values in the controller? (Choose 2)

Question26: A platform developer at Universal Containers needs to create a custom button for the Account object that, when clicked, will perform a series of calculations 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 three.)

Question27: A Lightning component has a wired property, searcResults, that stores a list of Opportunities. Which definition of the Apex method, to which the searchResults property is wired, should be used?

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

Question29: A developer created a Lightning component to display a short text summary for an object and wants to use it with multiple Apex classes.
How should the developer design the Apex classes?

Question30: A platform developer needs to implement a declarative solution that will display the most recent closed won date for all opportunity records associated with an account. Which field is required to achieve this declaratively?

Question31: Where would a developer build a managed package?

Question32: Which two are true regarding a Dyno? Choose 2 answers

Question33: What is a characteristic of the Lightning Component Framework? Choose 2 answers:

Question34: What should a developer use to implement an automatic Approval Process submission for Cases?

Question35: What is a good practice for a developer to follow when writing a trigger? (Choose 2)

Question36: What is the data type returned by the following SOSL search? {FIND 'Acme*' in name fields returning account,opportunity};

Question37: developer created this Apex trigger that calls MyClass .myStaticMethod: trigger myTrigger on Contact(before insert) ( MyClass.myStaticMethod(trigger.new, trigger.oldMap); } The developer creates a test class with a test method that calls MyClass.mystaticMethod, resulting in 81% overall code coverage. What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exist?

Question38: Which resource can be included in a Lightning Component bundle? Choose 2 answers

Question39: Which three process automations can immediately send an email notification to the owner of an Opportunity when its Amount is changed to be greater than $10,000? Choose 3 answers

Question40: Which two platform features allow for the use of unsupported languages? Choose 2 answers

Question41: Which two platform features align to the Controller portion of MVC architecture? (Choose two.)

Question42: Candidates are reviewed by four separate reviewers and their comments and scores which range from 1 (lowest) to 5 (highest) are stored on a review record that is a detail record for a candidate what is the best way to indicate that a combined review score of 15 of better is required to recommend that the candidate come in for an interview?

Question43: For which example task should a developer use a trigger rather than a workflow rule?

Question44: A company has a custom object named Region. Each account in salesforce can only be related to one region at a time, but this relationship is optional. Which type of relantionship should a developer use to relate an account to a region?

Question45: Which statement about change set deployments is accurate? (Choose 3)

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

Question47: Opportunity opp=[select id ,stagename from opportunity limit 1] Given the code above, how can a developer get the label for the stagename field?

Question48: A developer has JavaScript code that needs to be called by controller functions in multiple Aura components by extending a new abstract component.
Which resource in the abstract Aura component bundle allows the developer to achieve this?

Question49: A developer creates a custom controller and a custom Visualforce page by using the code block below:
public class MyController {
public String myString {
get {
if (myString == null) { myString = 'a';
}
return myString;
} private set; } public string getMyString (){
return 'getMyString';
} public string getStringMethod () {
if (myString == null) {
myString = 'b';
} return myString;
}
} <apex:page controller = "MyController"> {!StringMethod}, {!myString}, {!myString} </apex:page> What can the user expect to see when accessing the custom page?

Question50: What is the accurate statement about with sharing keyword? choose 2 answers

Question51: A Platform Developer needs to write an Apex method that will only perform an action if a record is assigned to a specific Record Type.
Which two options allow the developer to dynamically determine the ID of the required Record Type by its name? (Choose two.)

Question52: Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order will be imported into Salesforce.

Question53: What are two valid options for iterating through each Account in the collection List<Account> named AccountList? (Choose two.)

Question54: What is the maximum number of SOQL queries used by the following code? List<Account> aList =
[SELECT Id FROM Account LIMIT 5]; for (Account a : aList){ List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id); }

Question55: A developer has the following code:try {List nameList;Account a;String s = a.Name;nameList.add(s);} catch (ListException le ) {System.debug(' List Exception ');} catch (NullPointerException npe)
{System.debug('
NullPointer Exception ');} catch (Exception e) {System.debug(' Generic Exception ');} What message will be logged?

Question56: Which standard field needs to be populated when a developer inserts new Contact records programmatically?

Question57: What is the return data type when ApexPages.currentPage().getParameters() is used to retrieve URL parameters from a visualforce controller?

Question58: Which standard field is required when creating a new contact record?

Question59: An Approval Process is defined in the Expense_Item__c. A business rule dictates that whenever a user changes the Status to 'Submitted' on an Expense_Report__c record, all the Expense_Item__c records related to the expense report must enter the approval process individually. Which approach should be used to ensure the business requirement is met?

Question60: An after trigger on the account object performs a DML update operation on all of the child opportunities of an account. There are no active triggers on the opportunity object, yet a "maximum trigger depth exceeded" error occurs in certain situation. Which two reasons possibly explain the account trigger firing recursively? choose 2 answers

Question61: What is the preferred way to reference web content such as images, style sheets, JavaScript, and other libraries that is used in Visualforce pages?

Question62: A developer needs to apply the look and feel of lightning experience to a number of applications built using a custom third-party javascript framework and rendered in visualforce pages which option achieves this?

Question63: Which statement should a developer avoid using inside procedural loops? (Choose 2)

Question64: In which order does SalesForce execute events upon saving a record?

Question65: A developer needs to provide a Visualforce page that lets users enter Product-specific details during a Sales cycle. How can this be accomplished? (Choose 2)

Question66: Which three steps allow a custom SVG to be included in a Lightning web component? Choose 3 answers

Question67: When a task is created for a contact, how can a developer prevent the task from being included on the activity timeline of the contact's account record?

Question68: A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public class without sharing OpportunityService( public static List<OpportunityLineItem> getOpportunityProducts(Set<Id> opportunityIds){ List<OpportunitylineItem> oppLineItems = new List<OpportunityLineItem>(); for(Id thisOppId :
opportunityIds){ oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; } return oppLineItems; } } The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit?

Question69: Potential home buyers working with a real estate company can make offers on multiple properties that are listed with the real estate company. Offer amounts can be modified; however, the property that has the offer cannot be modified after the offer is placed. What should be done to associate offers with properties in the schema for the organization?

Question70: A company would like to send an offer letter to a candidate, have the candidate sign it electronically, and then send the letter back.What can a developer do to accomplish this?

Question71: Universal Containers wants to back up all of the data and attachments in its Salesforce org once month.
Which approach should a developer use to meet this requirement?

Question72: 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?

Question73: What should a developer working in a sandbox use to exercise a new test Class before the developer deploys that test production?Choose 2 answers

Question74: Which statement is true about a hierarchical relationship as it pertains to user records?

Question75: 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?

Question76: Account acct = {SELECT Id from Account limit 1}; Given the code above, how can a developer get the type of object from acct?

Question77: 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?

Question78: What is the result of the following code block ?
Integer x = 1;Integer Y = 0;While(x < 10){Y++;}

Question79: A developer needs to create a Visualforce page that displays Case dat
a. The page will be used by both support reps and support managers. The Support Rep profile does not allow visibility of the Customer_Satisfaction__c field, but the Support Manager profile does.
How can the developer create the page to enforce Field Level Security and keep future maintenance to a minimum?

Question80: Which option should a developer use to create 500 Accounts and make sure that duplicates are not created for existing Account Sites?

Question81: How can a developer set up a debug log on a specific user?

Question82: Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'?

Question83: A developer needs to prevent the creation of request records when certain conditions exist in the system. A RequestLogic class exists to checks the conditions. What is the correct implementation?

Question84: A developer has javascript code that needs to be called by controller functions in multiple components by extending a new abstract component. Which resource in the abstract component bundle allows the developer to achieve this

Question85: Using the Schema Builder, a developer tries to change the API name of a field that is referenced in an Apex test class.
What is the end result?

Question86: How many level of child records can be returned in a single SOQL query from one parent object

Question87: 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?

Question88: Which tool allows a developer to send requests to the Salesforce REST APIs and view the responses?

Question89: A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for that object. What happens when a user updates a record?

Question90: A developer executes the following code in the Developer Console:
List<Account> fList = new List <Account> ();For(integer i= 1; I <= 200; i++){fList.add(new Account ( Name
= 'Universal Account ' + i));}Insert fList;List <Account> sList = new List<Account>();For (integer I = 201; I
<=
20000; i ++){sList.add(new Account (Name = 'Universal Account ' + i));}Insert sList;How many accounts are created in the Salesforce organization ?

Question91: 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?

Question92: Application Events follow the traditional publish-subscribe model. Which method is used to fire an event?

Question93: 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?

Question94: What is the debug output of the following Apex code?
Decimal theValue;
System.debug (theValue);

Question95: How can a developer warn users of SOQL governor limit violations in a trigger?

Question96: A developer needs to avoid potential system problems that can arise in a multi-tenant architecture.
Which requirement helps prevent poorty written applications from being deployed to a production environment?

Question97: A developer created a visualforce page using a custom controller that calls an apex helper class. A method in the helper class hits a governor limit. what is the result of the transaction?

Question98: What is a benefit of using an after insert trigger over using a before insert trigger?

Question99: A developer needs to create a custom Visualforce button for the Opportunity object page layout that will cause a web service to be called and redirect the user to a new page when clicked. Which three attributes need to be defined in the <apex:page> tag of the Visualforce page to enable this functionality? Choose three answers.

Question100: What can a Lightning Component contain in its resource bundle? Choose 2 answer

Question101: Which Apex collection is used to ensure that all values are unique?

Question102: A developer wants to display all of the available record types for a Case object. The developer also wants to display the picklist values for the Case.Status field. The Case object and the Case Status field are on a custom visualforce page.
Which action can the developer perform to get the record types and picklist values in the controller?
Choose 2 answers

Question103: Which two combined methods should a developer use to prevent more than one open Opportunity on each Account? Choose 2 answers

Question104: Which two components are available to deploy using the METADATA API? Choose 2 answers

Question105: A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Whithin the class, the developer identifies the following method as a security threat:
List<Contact> performSearch(String lastName){ return Database.query('Select Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%); } What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers

Question106: Which set of roll-up types are available when creating a roll-up summary field?

Question107: To which data type in Apex a currency field automatically assigned?

Question108: What is a capability of cross-object formula fields? Choose 3 answers

Question109: Which two sosl searches will return records matching search criteria contained in any of the searchable text fields on an object? choose 2 answers

Question110: Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct?

Question111: A developer is asked to set a picklist field to 'Monitor' on any new Leads owned by a subnet of Users.
How should the developer implement this request?

Question112: What is an accurate constructor for a custom controller named "MyController"?

Question113: Which two ways can a developer instantiate a PageReference in Apex? Choose 2 answers

Question114: Which two statements can a developer use to throw a custom exception of type MissingFieldValueException? Choose 2 answers.

Question115: A company that uses a Custom object to track candidates would like to send candidate information automatically to a third -party human resource system when a candidate is hired. What can a developer do to accomplish this task?

Question116: A developer uses an 'after update' trigger on the Account object to update all the Contacts related to the Account. The trigger code shown below is randomly failing.
List<Contacts> theContacts = new List<Contacts>(); for(Account a : Trigger.new){ for(Contact c : [SELECT Id, Account_Date__c FROM Contact WHERE AccountId = :a.Id]){ c.Account_Date__c = Date.today(); theContacts.add(c);
}
} updates theContacts;
Which line of code is causing the code block to fail?

Question117: A developer uses a Test Setup method to create an Account named 'Test'. The first test method deletes the Account record. What must be done in the second test method to use the Account?

Question118: A Visualforce page has a standard controller for an object that has a lookup relationship to a parent object. How can a developer display data from the parent record on the page?

Question119: Which aspect of Apex programming is limited due to multitenancy?

Question120: A developer must write an Apex method that will be called from a Lightning component. The method may delete an account stored in the accountRec variable. Which method should a developer use to ensure only users that should be able to delete Accounts can succesfully perform deletions?

Question121: A developer wants to list all of the Tasks for each Account on the Account detail page. When a task is created for a Contact, what does the developer need to do to display the Task on the related Account record?

Question122: What are two valid options for iterating through each Account in the collection List <Account> named AccountList? Choose 2 answers.

Question123: A developer wants to use all of the functionality provided by the standard controller for an object, but needs to override the Save standard action in a controller extension. Which two are required in the controller extension class?

Question124: A developer is creating a Visualforce page that allows users to create multiple Opportunities. The developer is asked to verify the current user's default Opportunity record type, and set certain default values based on the record type before inserting the record. How can the developer find the current user's default record type?

Question125: Where are two locations a developer can look to find information about the status of asynchronous or future cals? Choose 2 answers

Question126: Where can a developer identify the time taken by each process in a transaction using Developer Console log inspector?

Question127: Which two Apex data types can be used to reference a Salesforce record ID dynamically? (Choose two.)

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

Question129: What are two uses for External IDs? (Choose two.)

Question130: Which statement would a developer use when creating test data for products and pricebooks?

Question131: A developer has the following code block:
public class PaymentTax {public static decimal SalesTax = 0.0875;} trigger OpportunityLineItemTrigger on OpportunityLineItem (before insert, before update) {PaymentTax PayTax = new PaymentTax();decimal ProductTax = ProductCost * XXXXXXXXXXX;} To calculate the productTax, which code segment would a developer insert at the XXXXXXXXXXX to make the value the class variable SalesTax accessible within the trigger?

Question132: A developer has a Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?

Question133: In which two org types can a developer create new Apex Classes? Choose 2 answers

Question134: What is a capability of the <ltng:require> tag that is used for loading external Javascript libraries in Lightning Component? (Choose three.)

Question135: A developer writes the following code:

What is the result of the debug statement?

Question136: A developer tasked with creating a schema to track Movies, Actors, and contracts. A single movie can have many contracts and a single actor can have many contracts. Each contract is owned and actively managed by a single user. Which schema should be created to enable user to easily manage the contract they own; without requiring access to the movie or the actor records?

Question137: A developer has the following trigger that fires after insert and creates a child Case whenever a new Case is created. List<Case> childCases = new List<Case>();for (Case parent : Trigger.new){Case child = new Case (ParentId = parent.Id, Subject = parent.Subject);childCases.add(child);}insert childCases; What happens after the code block executes?

Question138: 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?

Question139: Which data structure is returned to a developer when performing a SOSL search?

Question140: A developer has to Identify a method in an 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 DML statement to save the changes to the database. Which two techniques should the developer implement as a best practice to esure transaction control and avoid exceeding governor limits? Choose
2 answers

Question141: What is the easiest way to verify a user before showing them sensitive content?

Question142: The Review__c object has a lookup relationship up to the Job_Application__c object. The Job_Application__c object has a master-detail relationship up the Position__c object. The relationship field names are based on the auto-populated defaults. What is the recommended way to display field data from the related Review__c records on a Visualforce page for a single Position__c record?

Question143: Which tag should a developer include when styling from external CSS is required in a Visualforce page?

Question144: What is a correct pattern to follow when programming in Apex on a Multi-tenant platform?

Question145: What is a benefit of the Lightning Component framework?Choose 3 answers

Question146: Given the code block: Integer x; for (x =0; x<10; x+=2){
if (x==8) break; if (x==10) break;
} system.debug(x); Which value will the system.debug display?

Question147: A developer considers the following snippet of code: Boolean isOK; integer x; String theString = 'Hello'; if (isOK == false && theString == 'Hello') { x = 1; } else if (isOK == true && theString =='Hello') { x = 2;
} else if (isOK != null && theString == 'Hello') { x = 3; } else { x = 4; } Based on this code, what is the value of x?

Question148: How can a developer use a Set<Id> to limit the number of records returned by a SOQL query?

Question149: Which two statement are acceptable for a developer to use Inside procedural loops?

Question150: 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?

Question151: A developer is asked to write negative tests as part of the unit testing for a method that calculates a person's age based on birth date. What should the negative tests include?

Question152: Which two practices should be used for processing records in a trigger? Choose 2 answers

Question153: 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?

Question154: How should the developer overcome this problem? While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard Pricebook since one already exist in the org.

Question155: A developer wants to display all of the picklist entries for the Opportunity StageName field and all of the available record types for the Opportunity object on a Visualforce page. Which two actions should the developer perform to get the available picklist values and record types in the controller? Choose 2 answers.

Question156: A developer wants to create a custom object to track Customer Invoices.How should Invoices and Accounts be related to ensure that all Invoices are visible to everyone with access to an Account?