EMT Practice Test

1. Question Content...


Question List

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

Question2: Which two automation tools include a graphical designer? Choose 2 answers

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

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

Question5: A developer writes the following code:

What is the result of the debug statement?

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

Question7: A company wants to create an employee rating program that allows employees to rate each other. An employees average rating must be displayed on the employee record. Employees must be able to create rating records, but are not allowed to create employee records. Which two actions should a developer take to accomplish this task?

Question8: A developer has the controller class below.

Which code block will run successfully in an execute anonymous window?

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

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

Question11: What are two testing consideration when deploying code from a sandbox to production? Choose 2 answers

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

Question13: What is the result of the debug statements in testMethod3 when you create test data using testSetup in below code?

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

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

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

Question17: What can used to delete components from production?

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

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

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

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

Question22: A developer creates a new Visualforce page and Apex extension, and writes test classes that exercise 95% coverage of the new Apex extension.Change set deployment to production fails with the test coverage warning: "Average test coverage across all Apex classes and triggers is 74%, at least 75% test coverage is required."What can the developer do to successfully deploy the new Visualforce page and extension?

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

Question24: 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 < 250; 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?

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

Question26: From which two locations can a developer determine the overall code coverage for a sandbox? Choose two answers

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

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

Question29: A developer has created a Visualforce Page and Apex Controller that uses the With Sharing keyword. The page will be used of by Sales Managers and should only display Accounts owned by Sales Representatives who report to the running Sales Manager. The organization-wide sharing for Accounts is set to Private. Which additional set of stops should the developer take?

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

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

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

Question33: A Visualforce page is required for displaying and editing Case records 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?

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

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

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

Question37: Which two statements are true regarding formula fields? Choose 2 answers

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

Question39: Which declarative method helps ensure quality data? (Choose 3)

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

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

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

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

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

Question45: A developer needs to import customer subscription records into salesforce and attach them to existing account records. Which 2 actions should the developer take to ensure the subscription records are related to the correct account records? Choose 2 answers

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

Question47: What would a developer do to update a picklist field on related Opportunity records when a modification to the associated Account record is detected?

Question48: Which three resources in a Lightning Component Bundle can contain JavaScript functions? Choose 3

Question49: When an Account's custom picklist field called Customer Sentiment is changed to a value of "Confused", a new related Case should automatically be created.
Which two methods should a developer use to create this case? (Choose two.)

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

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

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

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

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

Question55: What should a developer use to implement an automate approval process submission for case?

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

Question57: Which data type or collection of data types can SOQL statements populate or evaluate to? (Choose 3)

Question58: Which two statement can a developer use to throw a custom exception of type MissingFieldValueException?Choose 2 answers

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

Question60: A developer declared a class as follow.
public class wysiwyg { // Properties and methods including DML }
Which invocation of a class method will obey the organization-wide defaults and sharing settings for the running user in the Salesforce Organization?

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

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

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

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

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

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

Question67: When loading data into an operation, what can a developer do to match records to update existing records? (Choose 2)

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

Question69: Which is a valid Apex assignment?

Question70: What is a valid source and destination pair that can send or receive change sets? (Choose 2)

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

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

Question73: Why would a developer use Test. startTest( ) and Test.stopTest( )?

Question74: A developer created a Visualforce page with a custom controller to show a list of accounts. The page uses the <apex:SelecList> component, with a variable called "selection", to show the valid values for Account.Type. The page uses an <apex:pageBlockTable> component to display the list of accounts, where the iteration variable is "acct". The developer wants to ensure that when a user selects a type on the <apex : selectList> component, only accounts with that type are shown on the page. What should the developer do to accomplish this?

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

Question76: A candidate may apply to multiple jobs at the company Universal Containers by submitting a single application per job posting, that application cannot be modified to be resubmitted to a different job posting.What can the administrator do to associate an application with each job posting in the schema for the organization?

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

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

Question79: Which is a valid apex assignment?

Question80: Which three options allow a developer to use custom styling in a Visualforce page? (Choose three.)

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

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

Question83: The Account object has a custom formula field,Level__c, that is defined as a Formula(Number) with two decimal places. Which three are valid assignments? Choose 3.

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

Question85: What si the debug output of the following apex code? Decimal thevalue; system.debug(thevalue);

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

Question87: hat are three techniques that a developer can use to invoke an anonymous block of code? Choose 3 answers

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

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

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

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

Question92: Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.)

Question93: A developer is creating an application to track engines and their parts. An individual part can be used in different types of engines.What data model should be used to track the data and to prevent orphan records?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Question116: Which three methods help ensure quality data?

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

Question118: Which approach should a developer use to add pagination to a Visualforce page?

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

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

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

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

Question123: A developer needs to create a Visualforce page that will override the standard Account edit button. The page will be used to validate the account's address using a SOQL query. The page will also allow the user to make edits to the address. Where would the developer write the Account address verification logic?

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

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

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

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