EMT Practice Test

1. Question Content...


Question List

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

Question2: An org has a single account named 'NoContacts' that has no related contacts. Given the query:
List<Account> accounts = [Select ID, (Select ID, Name from Contacts) from Account where Name='NoContacts']; What is the result of running this Apex?

Question3: 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 statement display?

Question4: When creating a record with a Quick Action, what is the easiest way to post a feed item?

Question5: A developer has a block of code that omits any statements that indicate whether the code block should execute with or without sharing. What will automatically obey the organization-wide defaults and sharing settings for the user who executes the code in the Salesforce organization?

Question6: In a single record, a user selects multiple values from a multi-select picklist. How are the selected values represented in Apex?

Question7: A developer creates a custom controller and custom Visualforce page by using the following code block:public class myController {public String myString;public String getMyString() {return 'getmyString';}public String getStringMethod1() {return myString;}public String getStringMethod2() {if (myString == null)myString = 'Method2';return myString;}}{!myString}, {!StringMethod1}, {!StringMethod2}, {!myString}What does the user see when accessing the custom page?

Question8: What are two characteristics of partial copy sandboxes versus full sandboxes? Choose 2 answers

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

Question10: Requirements state that a child record be to deleted when its parent is deleted, and a child can be moved to a different parent when necessary. Which type of relationship should be built between the parent and child objects in Schema Builder to support these requirements?

Question11: A developer creates an Apex class that includes private methods. What can the developer do to ensure that the private methods can be accessed by the test class?

Question12: A developer needs an Apex method that can process Account or Contact records. Which method signature should the developer use?

Question13: What is a capability of the Force.com IDE? Choose 2 answers

Question14: Which governor limit applies to all the code in an apex transaction?

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

Question16: How would a developer determine if a CustomObject__c record has been manually shared with the current user in Apex?

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

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

Question19: Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a Master-Detail relationship with the standard Account object. Based on some internal discussion, the UC administrator tried to change the Master-Detail relationship to a Lookup relationship but was not able todo so. What is apossible reason that this change was not permitted?

Question20: 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 customizer outside the ISV's package namespace. Which approach should a developer take to ensure calculateBodyFat() is accessible outside the package namespace?

Question21: A company wants a recruiting app that models candidates and interviews; displays the total number of interviews on each candidate record; and defines security on interview records that is independent from the security on candidate records. What would a developer do to accomplish this task? Choose 2 answers

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

Question23: A developer must provide a custom user interface when users edit a Contact. Users must be able to use the interface in Salesforce Classic and Lightning Experience. What should the developer do to provide the custom user interface?

Question24: What is a valid way of loading external JavaScript files into a Visualforce page? (Choose 2)

Question25: The Review_c object have a lookup relationship to the job_Application_c object. The job_Application_c object has a master detail relationship up to the position_c object. The relationship is based on the auto populated defaults?
What is the recommended way to display field data from the related Review _C records a Visualforce page for a single Position_c record? Select one of the following:

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

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

Question28: A visualforce page uses the contact standard controller. How can a developer display the name from the parent account record on the page?

Question29: What are the eight officially supported languages on Heroku platform?

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

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

Question32: What is the advantage of Salesforce Lightning?

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

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

Question35: Which user can edit a record after it has been locked for approval? (Choose 2)

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

Question37: How can a developer get all of the available record types for the current user on the case object?

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

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

Question40: Which option would a developer use to display the Accounts created in the current week and the number of related Contacts using a debug statement in Apex?

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

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

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

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

Question45: A method is passed a list of generic sObjects as a parameter.
What should the developer do to determine which object type (Account, Lead, or Contact, for example) to cast each sObject?

Question46: Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers

Question47: A developer created a lightning component name accountList.cmp that display a list of Accounts. Client-side logic that is executed when a user hovers over an account in the list should be stored in which bundle member?

Question48: What can used to delete components from production?

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

Question50: A user selects a value from a multi-select picklist. How is this selected value represented in Apex?

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

Question52: Which requirement needs to be implemented by using standard workflow instead of Process Builder? Choose 2 answers

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

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

Question55: The initial value for a number field on a record is 1. A user updated the value of the number field to 10. This action invokes a workflow field update, which changes the value of the number field to 11. After the workflow field update, an update trigger fires.What is the value of the number field of the object that is obtained from Trigger.old?

Question56: What features are available when writing apex test classes?(Choose 2 Answers)

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

Question58: Which type of code represents the Model in the MVC architecture when using Apex and Visualforce pages?

Question59: A change set deployment from a sandbox to production fails due to a failure in a managed package unit test. The developer spoke with the manager package owner and they determined it is a false positive and can be ignored. What should the developer do to successfully deploy?

Question60: A developer writes a SOQL query to find child records for a specific parent. How many levels can be returned in a single query?

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

Question62: A developer can use the debug log to see which three types of information? Choose 3 answers

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

Question64: A developer needs to create records for the object Property__c. The developer creates the following code block:List propertiesToCreate = helperClass.createProperties();try { // line 3 } catch (Exception exp ) { //exception handling }Which line of code would the developer insert at line 3 to ensure that at least some records are created, even if a few records have errors and fail to be created?

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

Question66: A developer needs to provide a way to mass edit, update, and delete records from a list view. In which two ways can this be accomplished? Choose 2 answers

Question67: A developer runs the following anonymous code block:List<Account> acc = [SELECT Id FROM Account LIMIT 10];Delete acc;Database.emptyRecycleBin(acc);system.debug(Limits.getDMLStatements()+ ', '
+Limits.getLimitDMLStatements());What is the result?

Question68: In which two trigger types can a developer modify the new sObject records that are obtained by the trigger.new context? Choose 2 answers

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

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

Question71: Which two operations can be performed using a formula field? Choose 2 answers

Question72: An sObject named Application_c has a lookup relationship to another sObject named Position_c. Both Application _c and Position_c have a picklist field named Status_c.When the Status_c field on Position_c is updated, the Status_c field on Application_c needs to be populated automatically with the same value, and execute a workflow rule on Application_c.How can a developer accomplish this?

Question73: Why would a developer consider using a custom controller over a controller extension?

Question74: A custom exception "RecordNotFoundException" is defined by the following code of block.public class RecordNotFoundException extends Exception()which statement can a developer use to throw a custom exception?choose 2 answers

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

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

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

Question78: A developer creates an Apex Trigger with the following code block:List<Account> customers = new List<Account>();For (Order__c o: trigger.new){Account a = [SELECT Id, Is_Customer__c FROM Account WHERE Id =
:o.Customer__c];a.Is_Customer__c = true;customers.add(a);}Database.update(customers, false);The developer tests the code using Apex Data Loader and successfully loads 10 Orders. Then, the developer loads 150 Orders.How many Orders are successfully loaded when the developer attempts to load the 150 Orders?

Question79: When is an Apex Trigger required instead of a Process Builder Process?

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

Question81: In an organization that has enabled multiple currencies, a developer needs to aggregate the sum of the Estimated_value__c currency field from the CampaignMember object using a roll-up summary field called Total_estimated_value__c on Campaign.

Question82: What is a benefit of using a trigger framework?

Question83: How can a custom type be identified as unique when added to a Set?

Question84: Which approach should be used to provide test data for a test class?

Question85: A developer needs to have records with specific field values in order to test a new Apex class. What should the developer do to ensure the data is available to the test?

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

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

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

Question89: A developer working on a time management application wants to make total hours for each timecard available to applications users. A timecard entry has a Master-Detail relationship to a timecard. Which approach should the developer use to accomplish this declaratively?

Question90: On which object can an administrator create a roll-up summary field?

Question91: How should a developer avoid hitting the governor limits in test methods?

Question92: Which is a valid Apex assignment?

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

Question94: How can a developer avoid exceeding governor limits when using Apex Triggers? (Choose 2)

Question95: 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 <apx:page> tag of the visualforce page to enable this functionality?

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

Question97: Which two condition cause workflow rules to fire? Choose 2 answers

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

Question99: Which three statements are true regarding cross-object formulas? Choose 3 answers

Question100: A developer needs to confirm that an Account trigger is working correctly without changing the organization's data.What would the developer do to test the Account trigger?

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

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

Question103: An org has an existing Visual Flow that creates an Opportunity with an Update records element. A developer must update the Visual Flow also created a Contact and store the created Contact's ID on the Opportunity.

Question104: What must the Controller for a Visualforce page utilize to override the Standard Opportunity view button?

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

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

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

Question108: When creating unit tests in Apex, which statement is accurate?Choose 2

Question109: A developer created a Visualforce page and a custom controller with methods to handle different buttons and events that can occur on the page.
What should the developer do to deploy to production?

Question110: What is the requirement for a class to be used as a custom Visualforce controller?

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

Question112: How should a developer create a new custom exception class?

Question113: Which two conditions cause workflow rules to fire? Choose 2 answers

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

Question115: 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 } } }

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

Question117: Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permission for the currently logged-in user while using the custom search tool?23wa

Question118: The sales team at universal container would like to see a visual indicator appear on both account and opportunity page layout to alert salespeople when an account is late making payments or has entered the collections process. What can a developer implement to achieve this requirement without having to write custom code?

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

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

Question121: A developer wants to store a description of a product that can be entered on separate lines by a user during product setup and later displayed on a Visualforce page for shoppers. Which field type should the developer choose to ensure that the description will be searchable in the custom Apex SOQL queries that are written?

Question122: What actions types should be configured to display a custom success message?

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

Question124: Given the following block code: try{ List <Accounts> retrievedRecords = [SELECT Id FROM Account WHERE Website = null]; }catch(Exception e){ //manage exception logic } What should a developer do to ensure the code execution is disrupted if the retrievedRecordslist remains empty after the SOQL query?

Question125: How many accounts will be inserted by the following block ofcode? for(Integer i = 0 ; i < 500; i++) { Account a = new Account(Name='New Account ' + i); insert a; }

Question126: For which three items can a trace flag be configured? (Choose three.)

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

Question128: 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.)

Question129: 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.

Question130: When would the use of Heroku Postgres be appropriate?

Question131: Manage package can be created in which type of org?

Question132: What are three characteristics of static methods? (Choose three.)

Question133: What is a benefit of the lightning component framework?

Question134: Where can the custom roll-up summary fields be created using Standard Object relationships (Choose 3)

Question135: When viewing a Quote, the sales representative wants to easily see how many discounted items are included in the Quote Line Items.
What should a developer do to meet this requirement?

Question136: What is the proper process for an Apex Unit Test

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

Question138: A developer wants multiple test classes to use the same set of test dat a. How should the developer create the test data?

Question139: The sales management team requires that the lead source field of the Lead record be populated when Lead is converted. What would a developer use to ensure that a user populates the Lead source field?

Question140: A developer needs to create an audit trail for records that are sent to the recycle bin. Which type of trigger is most appropriate to create?

Question141: Which statement results in an Apex compiler error?

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

Question143: A developer has the following requirements:
Calculate the total amount on an Order.
Calculate the line amount for each Line Item based on quantity selected and price.
Move Line Items to a different Order if a Line Item is not stock.
Which relationship implementation supports these requirements?

Question144: In which order does Salesforce execute events upon saving a record?

Question145: What is a key difference between a Master-Detail Relationship and a Lookup Relationship?

Question146: Which component is available to deploy using Metadata API? Choose 2 answers

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

Question148: Which approach should a developer take to automatically add a "Maintenance Plan" to each Opportunity that includes an "Annual Subscription" when an opportunity is closed?

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