EMT Practice Test

1. Question Content...


Question List

Question1: Opportunity opp=[SELECT Id,StageName FROM Opportunity LIMIT 1]; Given the code above,how can a developer get the label for the StageName field?

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

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

Question4: Which three options can be accomplished with formula fields? (Choose three.)

Question5: Which type of code represents the Controller in MVC architecture on the Force.com platform? (Choose 2)

Question6: A developer writes a before insert trigger.How can the developer access the incoming records in the trigger body?

Question7: In the Lightning Component framework, where is client-side controller logic contained?

Question8: How should a developer prevent a recursive trigger?

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

Question10: Which SOQL query successfully returns the Accounts grouped by name?

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

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

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

Question14: Which two statements are true about Apex code executed in Anonymous Blocks? Choose 2 answers

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

Question16: A developer needs to write a method that searches for a phone number that could be on multiple object types.
Which method should the developer use to accomplish this task?

Question17: A developer writes the following code:

What is the result of the debug statement?

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

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

Question20: Which type of information is provided by the Checkpoints tab in the Developer Console? (Choose 2)

Question21: Which two number expressions evaluate correctly? (Choose two.)

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

Question23: 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 2 answers

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

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

Question26: What is an important consideration when developing in a multi-tenant environment?

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

Question28: A newly hireddeveloper discovers that there are multiple triggers on the case object.
What should the developer consider when working with triggers?

Question29: Which trigger event allows a developer to update fields in the Trigger.new list without using an additional DML statement?Choose 2 answers

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

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

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

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

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

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

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

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

Question38: What is a valid statement about Apex classes and interfaces? Choose 2 answers:

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

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

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

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

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

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

Question45: Universal Containers requires Service Representatives to update all Cases at least one every three days. To make sure of this policy is obeyed, a developer has been asked to implement a field that displays the number of days since the last Case update. What should the developer use to configure the solution?

Question46: A visualforce interface is created for Case Management that includes both standard and custom functionality defined in an Apex class called myControllerExtension. The visualforce page should include which
<apex:page> attribute(s) to correctly implement controller functionality?

Question47: Developer needs to automatically populate the Reports To field in a Contact record based on the values of the related Account and Department fields in the Contact record. Which type of trigger would the developer create? Choose 2 answers

Question48: In the code below, which type does String inherit from? String s = 'Hello World';

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

Question50: A developer wants to override a button using Visualforce on an object.
What is the requirement?

Question51: What are two considerations for custom Apex Exception classes? Choose 2 answers.

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

Question53: A developer wrote a workflow email alert on case creation so that an email is sent to the case owner manager when a case is created. When will the email be sent?

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

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

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

Question57: 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.
Which step should the developer take to resolve the issue and properly test the exception?

Question58: A developer wants to handle the click event for a lightning:button component. The on click attribute for the component references a JavaScript function in which resource in the component bundle?

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

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

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

Question62: A developer creates an Apex helper class to handle complex trigger logic. How can the helper class warn users when the trigger exceeds DML governor limits?

Question63: What is a valid Apex statement?

Question64: A developer is asked to create a custom visualforce page that will be used as a dashboard component. Which three are valid controller options for this page? Choose 3 answers

Question65: How would a developer change the field type of a custom field on the Account object from string to an integer?

Question66: How can a developer retrieve all Opportunity record type labels to populate a list collection?Choose 2 answers

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

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

Question69: The Sales Management team hires a new intern. The intern is not allowed to view Opportunities, but needs to see the Most Recent Closed Date of all child Opportunities when viewing an Account record. What would a developer do to meet this requirement?

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

Question71: A developer uses a test setup method to create an account named 'test'. The first method deletes the account record. What must be done in the second test method to use the account?

Question72: Which two queries can a developer use in a visualforce controller to protect against SOQL injection Vulnerabilities? Choose 2 answers

Question73: What is a capability of formula fields? (Choose 3)

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

Question75: The operation manager at a construction company uses a custom object called Machinery to manage the usage and maintenance of its cranes and other machinery. The manager wants to be able to assign machinery to different constructions jobs, and track the dates and costs associated with each job. More than one piece of machinery can be assigned to one construction job.
What should a developer do to meet these requirements?

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

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

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

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

Question80: How can a developer avoid exceeding governor limits when using an Apex Trigger?choose 2 answers

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

Question82: What are two considerations for deciding to use a roll-up summary field? Choose 2 answer's partner.

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

Question84: To which primitive data type is a text area (rich) field automatically assigned?

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

Question86: Which action can a developer perform in a before update trigger? (Choose 2)

Question87: A developer needs to find information about @future methods that were invoked. From which system monitoring feature can the developer see this information?

Question88: A developer has the following query: Contact c = [SELECT id, firstname, lastname, email FROM Contact WHERE lastname = 'Smith']; What does the query return if there is no Contact with the last name 'Smith'?

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

Question90: A developer creates a method in an Apex class and needs to ensure that errors are handled properly.What would the developer use? (There are three correct answers.)

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

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

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

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

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

Question96: An apex trigger fails because it exceeds governor limits. Which two techniques should a developer use to resolve the problem? Choose 2 answers

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

Question98: Which two number expression evaluate correctly? Choose 2 answers

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

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

Question101: What is an accurate statement about variable scope? (Choose 3)

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

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

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

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: How can a custom type be identified as unique when added to a Set?

Question107: A developer in a Salesforce org with 100 Accounts executes the following code using the Developer console:Account myAccount = new Account(Name = 'MyAccount');Insert myAccount;For (Integer x = 0; x <
150; x++)
{Account newAccount = new Account (Name='MyAccount' + x);try {Insert newAccount;} catch (Exception ex) {System.debug (ex) ;}}insert new Account (Name='myAccount');How many accounts are in the org after this code is run?

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

Question109: A developer runs the following anonymous code block in a Salesforce org with 100 accounts List acc= {select id from account limit 10}; delete acc; database.emptyrecyclebin(acc); system.debug(limits.getlimitqueries()+'
,'+Limits.getlimitDMLStatements()); What is the debug output?

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

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

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

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

Question114: What is true for a partial sandbox that is not true for a full sandbox? Choose 2 answers: