Professional Documents
Culture Documents
SFDC MCQ3 Ad
SFDC MCQ3 Ad
further updates and if you leave groups after your TFA and stream tests
you will miss your further updates for sure so just stay connected.
Dm - https://t.me/angelnndevil
Club - https://t.me/accentureclub
All Streams -
https://t.me/accenturstreamgroup
Materials/Channel/dumps -
https://t.me/adaccenturematerials
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
1. A developer wrote an APEX code with SOQL embeded as given below. There are five positions for IT
department. What error message will be displayed ?
Position_c position =
FROM Position_c
2. Which of the following clause is used in SOQL query to specify the maximum number of rows to
return?
a. Order By
b. Where
c. Group By
d. Limit ✓
4. What would be the value of old context variable when 3 records are inserted in an object.
a. null ✓
b. new values
c. current values
d. old values
5. Which clause will be used in SOSL statement to restrict search in specific objects.
a. Limit
b. Returning ✓
c. Using
d. Order By
6. In a Data Model of an application, Job application and Review objects has Master-Detail relationship
where Job Application is parent of Review. What will be the relationshipName for parent-to-child
relationship?
a. Review_c
b. Reviews_r ✓
c. Job_application_c
d. Job_application_r
7. What should be the minimum code coverage % before deploying an Apex code?
a. 71
b. 73
c. 75 ✓
d. 72
8. A developer wrote an Apex code with SOQL embeded as given below. The Accounts Manager position
does not exist in the database. What type of exception will be thrown?
Position_c position =
FROM Position_c
a. DmlException
b. QueryException ✓
c. NullPointerException
d. IndexException
9. In which salesforce instances would there be identical record IDs? Choose most appropriate.
10. Refer the given code & select the correct option for checking whether the set has an element 1 or
not?
mySet.add(1);
mySet.add(3);
System.assert(…………);
a. mySet.r(1)
b. mySet.Index(1)
c. mySet.contains(1) ✓
d. mySet.present(1)
11. Identify the correct trigger context variable which shows the currently executing code is Apex
trigger.
a. isInsert
b. isExecuting ✓
c. isAfter
d. isDelete
12. What is the default option related to scope of fields to search in SOSL statement?
a. NAME FIELDS
b. SLIDEBAR FIELDS
c. ALL FIELDS ✓
d. PHONE FIELDS
13. An org has a Candidate object with First Name and Last Name field as required. A developer is trying
to insert a candidate programmatically by following code. What exception will be raised?
insert candidate;
a. IndexException
b. QueryException
c. NullPointerException
d. DmlException ✓
14. What would fit into the Model category of MVC paradigm? Choose two most appropriate options.
a. VF
b. Custom Object ✓
c. Apex Class
d. Custom Component ✓
e. Controller Extensions
a. True ✓
b. False
16. A developer created an email service and wants to deploy the classes it references in production.
How can the developer write a test method to sufficiently test these classes? Choose most appropriate
options.
a. The developer uses the Messaging.sendEmail().method address for the email service.
b. Classes that only contain email services are not subject requirements.
c. Developer creates Messaging.Inbound Email & pass them to Messaging inboundEmailHandler.
✓More
d. The developer creates a Messaging.outbound Email method of the Messaging.InboundEmail
Handler class.
17. Match the Dynamic Apex features with the corresponding syntax.
Features:
a) Describe Object/ Field
b) Dynamic SOQL
c) Dynamic DML
d) Dynamic SOSL
Syntax:
1. Scheme.DescribeFieldResult f = Schema.sObjectType.Account.fields.AccountNumber;
2. List<sObject> s = Database.query(querSTring);
3. Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.AccountNumber;
Sobject s = Database.query(‘SELECT AccountNumber FROM Account LIMIT 1’);
s.put(f.getsObjectField(),’12345’);
4. List<List SObject> o = Database.search(queryString);
Choose most appropriate option.
18. In a Data Model of an application, Account & Contact objects has a look-up relationship where
Account is parent of contact. Refer the given SOQL statement and identify the type of query.
a. Above code will fail to execute during compile time since the name field accessed without
being queried.
b. Above code will fail to execute only during run time since the name accessed without being
queried. ✓More
c. Above code will throw exception.
d. Above code will not saved.
21. In an APEX class, to declare a method as Test method, which of the following annotation or keyword
you will see? ( Select 2 )
a. “@Test”
b. testing method
c. “@” is Test ✓
d. testMethod ✓
22. What does use of “with sharing” keyword enforce ? Choose appropriate option.
a. Only the record sharing and FLS for the running use
b. Only CRUD permission for the running user.
c. Record sharing, FLS, CRUD permission for the running user
d. Only the record sharing for the running user ✓
23. For the following Apex code. Select the correct option to fill in the blank to retrieve the index 0
);
…………………….;
a. myList.pull(0);
b. myList.get(0); ✓
c. myList.get(1);
d. myList.retrieve(0);
Laler in the code of Apex, developer try to print status_c field value. Identify the type of exception
raised.
a. Index Exception
b. Query Exception ✓
c. SObject Exception
d. DML Exception
What would be returned by statement assuming the search text present in 4 records ?
a. Finds every account that is associated with any of the triggering contacts
b. Finds every contact that is associated with any of the triggering accounts ✓
c. Finds every contact that is associated with any of the triggering contacts
d. Finds every account that is associated with any of the triggering accounts
a. before undelete ✓
b. after insert
c. before update
d. after delete
28. A user inserts data on a VF page that invokes an Apex Trigger, which calls an SObject.addError()
method. Which statement is true ? Choose most appropriate option.
a. The error message will be displayed, provided the <Apex> included in the page ✓
b. The error message will be displayed next to the field
c. The error message will not be displayed unless the field method is used
d. The error message will not be displayed as the Apex Errors are only records
29. Below given is the code for a Map. Identify the correct option to add 2 elements to the Map.
a. m.add(1,’First Entry’);
m.add(2,’Second Entry’);
b. m.insert(1,’First Entry’);
m.insert(2,’Second Entry’);
c. m.push(1,’First Entry’);
m.push(2,’Second Entry’);
d. m.put(1,’First Entry’);
m.put(2,’Second Entry’); ✓
30. What are valid data types in Apex? (Select three)
a. Integer ✓
b. Row Number
c. Date ✓
d. ID ✓
31. Which method causes the entire set of operation to be rolled back ?
a. error()
b. showError()
c. isError
d. addError() ✓
32. You as a Apex Developer want to execute a code when 4 records of Offer_c object are updated.
When you will use to write your code ?
33. Which context variable provide a list of SObjects which we can use only in insert, update & undelete
triggers?
a. old
b. oldMap
c. new ✓
d. newMap
Double x = 87.60;
Integer y = 56;
Integer Y = 67;
System.debug(x+” “ +y +” “ +y);
a. Redeclaration of y ✓
b. Double is not a valid datatype
c. values are not properly concatenated
d. printData() definition is incorrect
35. A developer wrote an Apex code with SOQL embeded below. The account manager position does
not exist in the database. What error message will be displayed ?
FROM Position_c
36. In a Data Model of an application. Account and Contact Object has a look-up relationship where
Accounts is parent of contact. Refer the given SOQL statement & identify the type of query.
37. Which of the following clause is used in a SELECT statement of a SOQL query to control the order of
the query results.
a. ORDER BY ✓
b. WHERE
c. GROUP BY
d. LIMIT
38. In a Data Model of an application, Job application and Review objects has Master-Detail relationship
where Job Application is parent of Review. What will be the relationshipName for child-to-parent
relationship?
a. Review_c
b. Reviews_r
c. Job_Application_c
d. Job_Application_r ✓
• When retrieving data from a single object or multiple objects that are related to one another.
• When counting the number of records that meet a specified criteria.
• Sorting results as part of a query.
• When retrieving data from number, date or checkbox fields.
63. In which Salesforce instances would there be identical record ids? Choose most appropriate option
A. Production, full sandbox
Later in the code of Apex,developer try to print Status__c field value. Identify the type of Exception
raised?
A. IndexException
B. QueryException
C. SObjectException
D. DMLException
3. A developer wrote an Apex Code with SOQL embedded as given below. The Accounts Manager
position does not exist in the database. What type of exception will be thrown?
1. DML exception
2. Query exception
3. NullPointer exception
4. Index exception
12. What is true about Encrypted Fields? Choose most appropriate option
1. They are available in Validation Rules or Apex Scripts even if the user is not having the permission
“View Encrypted Data”
4. In Email Templates, if an encrypted field needs to be displayed without the mask character, the User
who receives the email, should have ‘View Encrypted Data’ permission.
136) Before code can be deployed in production, what percentage of test coverage must be achieved ?
a) 25
b) 100
c) 50
d) 75
137) What are the three different custom tabs you can create?(Select 3)
a) APEX Tab
b) Web Tab
c) Visualforce Tab
147. Which context variable provides a list of sObjects which ………………………. undelete triggers?
Ans. TRIGGER.NEW()
148. ……………. Job Application and Review objects has Master-Detail…………….. is parent of Review. What
will be the RelationshipName for
a. Review__c
b. Reviews__r
c. Job_Application__c
d. Job_Application__r
153. Consider the following trigger code. Identify what SOQL will return?
Trigger simpleTrigger on Account (after insert) { Contact[] cons = [SELECT LastName FROM Contact
WHERE AccountId IN :Trigger.new]; //some other code }
a. Finds every account that is associated with any of the triggering contacts.
b. Finds every contact that is associated with any of the triggering accounts.
c. Finds every contacts that is associated with any of the triggering contacts.
d. Finds every account that is associated with any of the triggering accounts.
160.In Developer Edition how much storage space we get when we sign-up for org?
A. 5MB
B. 10MB
C. 15MB
D. 20MB
A. error()
B. showError()
C. isError()
D. addError()
169)Which function we used to put server side apex method call in queue?
$A.queueAction()
$A.enqueueAction()
$Lightning.queueAction()
$Lighthning.enqueueAction()
No triggers
“@”RestResource
“@”ResourceRest
“@”HttpResource
“@”RestHttp
TRUE
FALSE
a. Before undelete
b. After insert
c. Before update
d. After delete
Which context variable provides a list of sObjects which we can use only in insert, update and undelete
triggers?
A. Old
B. oldMap
C. new
D. newMap
272) Identify the valid statements with respect to Encrypted fields. (They mentioned (*Skip) in the PDF)
Choose four most appropriate options.
D. They are not available for use in …………………. and rule filters
E. Encrypted fields are not available ………. formula fields, outbound mess ………form
282. A user inserts data on a VF page that invokes an Apex Trigger, which calls an SObject.addError()
method. Which statement is true?
A. The error message will be displayed, provided the component included the page
B. The error message will be displayed next to the field causing the error
C. The error message will not be displayed unless the field specific sObject.field.addError() method is
used
D. The error will not be displayed as the Apex Errors are only recorded in the debug log
288. Identify the valid statements with respect to the encrypted fields. Choose four most appropriate
options.
A. Encrypted text fields can be an external ID and can have default value
D. They are not available for use in filters such as list views, reports and rule filters
E. Encrypted fields are not available in lead conversion, workflow, formula fields, outbound messages,
default values and .........forms.
291. You as a Apex Developer want to execute a code when 4 records of Offer__c object are updated.
Which you will use to write your code?
B. Apex Trigger
C. Apex Unit Test
D. Apex Callouts
293. A developer wrote an Apex code with SOQL embedded as given below. The Accounts Manager
position does not exist in the database. What error message will be displayed?
Q 302: Below given is the code for a Map. identify the correct option to add 2 elements to the Map
Mapinfeger, String m= new Map
Q 306: Identify the correct trigger context variable which shows the currently executing code is Apex
trigger. Choose most appropre option:
A- isinsert
B- isExecuting
C- isAfter
D- isDelete
310. What is the default option to scope of fields to search in SOSL statement?
A. NAME FIELDS
B. SIDE FIELDS
C. ALL FIELDS
D. PHONE FIELDS
311. Which triggers are invoked when two contacts are merged? Choose most appropriate option.
C. No triggers
D. Delete and update contact and triggers and triggers on the parent account.
321. An org has a Candidate object with First Name and Last Name fields as required. A developer is
trying to insert a candidate programmatically by following code. What execption will be raised?
Candidate__c candidate = new Candidate__c(First Name__c = ‘Andrew’); Insert candidate;
A. Index Exception
B. Query Exception
C. NullPointer Exception
D. DmlException
366. In Developer Edition how much storage space we get when we sign-up for org?
A. 5MB
B. 10MB
C. 15MB
D. 20MB
417. In which salesforce instances would there be identical record IDs? Choose most appropriate option
461) A developer wrote an APEX code write SOQL embedded as given below. There are five positions for
IT dept. What error message will be displayed?
Position__C position = (select Status_C, Approval_Status_c From position__c Where department_C=
‘IT’)
Which of the following clause is used in SOQL query to specify the maximum no of rows to return?
a) order by
b) where
c)group by
d) limit
c) no triggers
What would be the value of old context variable when 3 records are in selected in an object
a) null
b) new values
c) current values
d) old values
Which clause will be used in SOSL statement to restrict search in specific objects
a) limit
b) returning
c) using
d) order by
In a data model of an application. Job application than and review objects has master-detail relationship
where job application is parent of review. What will be the relationships for parent-to-child
relationship?
a) Review__c
c) Job_application_c
d) Job _application_k
What should be the minimum code coverage % before displaying an apex code?
a) 71
b) 73
c) 75
d) 72
A developer wrote an Apex code with SOQL embedded as given below. The Accounts manager position
as given below. The accounts manager position does not exist in database. What type of exception will
be the own?
a) Dual Exception
b) Query Exception
d) Index Exception
In which salesforce instances would be identical record IDs? Choose most appropriate.
Refer the given code & select the correct option for checking whether the set has an element on not?
Set myset = new set (); Myset.add(1)
Myset.add(3)
System.assert(……….);
a) myset.t (1)
b) myset.index(1)
c) myset.contains(1)
d) myset.present(1)
Identify the correct trigger context varaiable which shows the currently executing code is apex trigger
a) is Insent
b) is Executing
c) is After
d) is Delete
What is the default option related to scope of fields to search in SOSL statement ?
a) NAME FIELDS
b) SLIDEBAR FIELDS
c) ALL FIELDS
d) PHONE FIELDS
2) A developer wrote an apex code with soql embedded as given below. The account manager position
does not exist in database what type of exception will be thrown. QUERY:
a) DML Exception
b) Query Exception
(https://developer.salesforce.com/docs/atlas.enus.apexref.meta/apexref/apex_classes_exception_m
ethods.htm)
d) Index Exception
4) Refer the given code and choose the correct option for checking whether set has an element 1 or
not? CODE: Set myset = new set(); myset.add(1); myset.add(3); system.assert(……);
a) myset.remove(1)
b) myset.index(1)
c) myset.contains(1)
(https://developer.salesforce.com/docs/atlas.enus.apexcode.meta/apexcode/langCon_apex_collecti
ons_sets.htm)
d) myset.present(1)
a) True
(https://developer.salesforce.com/docs/atlas.enus.apexcode.meta/apexcode/langCon_apex_data_ty
pes.htm)
b) False
10) A developer created an email service and wants to deploy the classes it references in production.
How can a developer write a test method to sufficiently test these classes?
a) The developer uses messaging send.email() method address to the email service.
b) Class that only contains email services are not subject requirements.
c) Developer create messaging inbound email and pass them to messaging inbound email handler
( Need to be discuss)
d) The developer creates messaging outbound email method of messaging. Inbound email handler class
7) An org has candidate object with firstname and lastname field is required. A developer is trying to
insert a candidate programmatically by following code. What exception will be made? Code:
Candidate__c Candidate = new Candidate__c (First_Name__c = ‘Andrew’); Insert Candidate;
a) Index exception
b) Query exception
c) Nullpoint exception
d) Dml exception
(https://developer.salesforce.com/docs/atlas.enus.apexref.meta/apexref/apex_classes_exception_m
ethods.htm)
8) What would fit into the model category of MVC paradigm? Choose two appropriate options.
a) VF
b) Custom object
c) Apex class
d) Custom component
11) Match the dynamic Apex features with the corresponding syntax. Features:
a) Describe object/field
b) Dynamic SOQL
c) Dynamic DML
Syntax
12) In a data model of an application, account & contact objects have a look up relation where account
is parent of contact. Refer the below SOQL statements and identify the type of query. Select
Contact.FirstName, Contact.Account.Name from Contact.
c) Sort results
(https://developer.salesforce.com/docs/atlas.enus.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.ht
m)
List <Account>acclist = [select id, account, number from Account limit 20;]
a) Above code will fail to execute during compile time since the name field accessed without being
queried.
b) Above code will fail to execute during run time since the name field accessed without being queried.
(Need to be discuss)
15) In an Apex class, to declare a method as test method, which of the following annotation on keyword
will u use? (select 2)
a) “@Test”
b) Testing Method
c) “@”isTest
(https://trailhead.salesforce.com/en/content/learn/modules/apex_testing/apex_testing_intro)
CheckOnce
d) testMethod
16) What does use of “with sharing” keyword enforce? Choose appropriate option.
a) Only the record sharing and FLS for the running use
17) For the following Apex code select the correct option to fill the blank to retrieve the index 0. > mylist
= newList ();
a) mylist.pull(0);
b) mylist.get(0);
(https://developer.salesforce.com/docs/atlas.enus.apexcode.meta/apexcode/langCon_apex_collecti
ons_lists.htm)
c) mylist.get(1);
d) mylist.retrive(0);
18) A developer used following query to retrieve Position object records. List Position = [Select Name,
Department__C, Location__c from Position__c]. Later in the code of Apex, developer try to print
Status__c field value. Identify the type of exception made.
a) Index
b) Query Exception
c) SObject
d) Dml Exception
19) Consider the following SOSL statement. “Find {Joe Smith}”. What would be returned by statement
assuming the saved text present in records?
c) Return the owner ids of the record where Joe Smith is found.
d) Return the external ids of the record where Joe Smith is found.
20) Consider the following the trigger code. Identify what SOQL will return? Trigger simple trigger on
Account (After insert) {Contact [] cons = {select lastname from contact where Accountid in:
trigger.name}; some other code}
a) Finds every account that is associated with any of the triggering contacts.
b) Finds every contact that is associated with any of the triggering accounts.
c) Finds every contact that is associated with any of the triggering contacts.
d) Finds every account that is associated with any of the triggering accounts.
a) before undelete
b) after insert
c) before update
d) after delete
22) A user insert data into VF page that contains an apex trigger which calls an SObject.adderror()
method. Which statement is true. Choose most appropriate.
b) The error message will be displayed next to the field. (CHECK ONCE)
(https://trailhead.salesforce.com/en/content/learn/modules/apex_triggers/apex_triggers_intro)
c) The error message will not be displayed unless the filed method is used.
d) The error message will not be displayed as the apex errors are only records.
23) Below given is a code for a Map. Identify the correct option to add 2 elements to the Map.
a) Integer
b) Row Number
c) Date (https://www.c-sharpcorner.com/article/apex-data-types-in-salesforce/)
d) Id
a) error()
b) showerror()
c) iserror
d) adderror()
26) You as an Apex developer want to execute a code when 4 records of Offer__c object are updated.
When will use to write your code?
b) Apex triggers
c) Apex unittest
d) Apex callouts
27) Which context variable provide a list of SObects which we can use only in inset, update & undelete
triggers?
a) Old
b) OldMap
c) New
d) NewMap
28) Identify the error in following code. Public Class Test { Double x=87,60; integer y = 56; Integer Y=67;
Print public void printdata() { System.debug(x+” ”+y+” “+Y); } }
a) Redeclaration of Y
30) In a data model of an application, Accounts and contacts objects have a look up relation where
account is the parent of contact. Refer the given soql statement & identify the types of query. Select
account.name. (select contact.firstname, contact.lastname from account.contacts) from account.
31) which of the following clause is used on a select statement of soql query to control the order of the
Query results.
a) order by
b) where
c) group by
d) limit
In a data model of an application, Job application and review objects has Master-Detail relationship
where job application is parent of review.What will be the relationship name for child-to-parent
relationship?
a)Review___c
b)Review___r
c)Jobapplication___c
d)Jobapplication___r
39) You can obtain an instance of an sObject, such as Account, in one of the following ways:
a) By creating the sObject only.
b) Either by creating the sObject or by retrieving a persistent record from Salesforce using SOQL.
c) A generic sObject variable can be assigned to any specific sObject, standard or custom. Such as
Account or Book__c.
A
D
D
C
D
C
C
D
B
A
A
B
B
B
C
B,D
B,C
B
B
B
B
C
A
A
A,D
B
DC
C
B
A
D
B
C
B,D
B
B
B
A,D
A
A
C
D
B,C
C
1. A developer wrote an APEX code with SOQL embeded as given below. There are five positions for IT
department. What error message will be displayed ?
Position_c position =
FROM Position_c
2. Which of the following clause is used in SOQL query to specify the maximum number of rows to
return?
a. Order By
b. Where
c. Group By
d. Limit ✓
4. What would be the value of old context variable when 3 records are inserted in an object.
a. null ✓
b. new values
c. current values
d. old values
5. Which clause will be used in SOSL statement to restrict search in specific objects.
a. Limit
b. Returning ✓
c. Using
d. Order By
6. In a Data Model of an application, Job application and Review objects has Master-Detail relationship
where Job Application is parent of Review. What will be the relationshipName for parent-to-child
relationship?
a. Review_c
b. Reviews_r ✓
c. Job_application_c
d. Job_application_r
7. What should be the minimum code coverage % before deploying an Apex code?
a. 71
b. 73
c. 75 ✓
d. 72
8. A developer wrote an Apex code with SOQL embeded as given below. The Accounts Manager position
does not exist in the database. What type of exception will be thrown?
Position_c position =
FROM Position_c
a. DmlException
b. QueryException ✓
c. NullPointerException
d. IndexException
9. In which salesforce instances would there be identical record IDs? Choose most appropriate.
10. Refer the given code & select the correct option for checking whether the set has an element 1 or
not?
mySet.add(1);
mySet.add(3);
System.assert(…………);
a. mySet.r(1)
b. mySet.Index(1)
c. mySet.contains(1) ✓
d. mySet.present(1)
11. Identify the correct trigger context variable which shows the currently executing code is Apex
trigger.
a. isInsert
b. isExecuting ✓
c. isAfter
d. isDelete
12. What is the default option related to scope of fields to search in SOSL statement?
a. NAME FIELDS
b. SLIDEBAR FIELDS
c. ALL FIELDS ✓
d. PHONE FIELDS
13. An org has a Candidate object with First Name and Last Name field as required. A developer is trying
to insert a candidate programmatically by following code. What exception will be raised?
insert candidate;
a. IndexException
b. QueryException
c. NullPointerException
d. DmlException ✓
14. What would fit into the Model category of MVC paradigm? Choose two most appropriate options.
a. VF
b. Custom Object ✓
c. Apex Class
d. Custom Component ✓
e. Controller Extensions
a. True ✓
b. False
16. A developer created an email service and wants to deploy the classes it references in production.
How can the developer write a test method to sufficiently test these classes? Choose most appropriate
options.
a. The developer uses the Messaging.sendEmail().method address for the email service.
b. Classes that only contain email services are not subject requirements.
c. Developer creates Messaging.Inbound Email & pass them to Messaging inboundEmailHandler.
✓More
d. The developer creates a Messaging.outbound Email method of the Messaging.InboundEmail
Handler class.
17. Match the Dynamic Apex features with the corresponding syntax.
Features:
a) Describe Object/ Field
b) Dynamic SOQL
c) Dynamic DML
d) Dynamic SOSL
Syntax:
1. Scheme.DescribeFieldResult f = Schema.sObjectType.Account.fields.AccountNumber;
2. List<sObject> s = Database.query(querSTring);
3. Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.AccountNumber;
Sobject s = Database.query(‘SELECT AccountNumber FROM Account LIMIT 1’);
s.put(f.getsObjectField(),’12345’);
4. List<List SObject> o = Database.search(queryString);
Choose most appropriate option.
18. In a Data Model of an application, Account & Contact objects has a look-up relationship where
Account is parent of contact. Refer the given SOQL statement and identify the type of query.
a. Above code will fail to execute during compile time since the name field accessed without
being queried.
b. Above code will fail to execute only during run time since the name accessed without being
queried. ✓More
c. Above code will throw exception.
d. Above code will not saved.
21. In an APEX class, to declare a method as Test method, which of the following annotation or keyword
you will see? ( Select 2 )
a. “@Test”
b. testing method
c. “@” is Test ✓
d. testMethod ✓
22. What does use of “with sharing” keyword enforce ? Choose appropriate option.
a. Only the record sharing and FLS for the running use
b. Only CRUD permission for the running user.
c. Record sharing, FLS, CRUD permission for the running user
d. Only the record sharing for the running user ✓
23. For the following Apex code. Select the correct option to fill in the blank to retrieve the index 0
);
…………………….;
a. myList.pull(0);
b. myList.get(0); ✓
c. myList.get(1);
d. myList.retrieve(0);
Laler in the code of Apex, developer try to print status_c field value. Identify the type of exception
raised.
a. Index Exception
b. Query Exception ✓
c. SObject Exception
d. DML Exception
What would be returned by statement assuming the search text present in 4 records ?
a. Finds every account that is associated with any of the triggering contacts
b. Finds every contact that is associated with any of the triggering accounts ✓
c. Finds every contact that is associated with any of the triggering contacts
d. Finds every account that is associated with any of the triggering accounts
a. before undelete ✓
b. after insert
c. before update
d. after delete
28. A user inserts data on a VF page that invokes an Apex Trigger, which calls an SObject.addError()
method. Which statement is true ? Choose most appropriate option.
a. The error message will be displayed, provided the <Apex> included in the page ✓
b. The error message will be displayed next to the field
c. The error message will not be displayed unless the field method is used
d. The error message will not be displayed as the Apex Errors are only records
29. Below given is the code for a Map. Identify the correct option to add 2 elements to the Map.
a. m.add(1,’First Entry’);
m.add(2,’Second Entry’);
b. m.insert(1,’First Entry’);
m.insert(2,’Second Entry’);
c. m.push(1,’First Entry’);
m.push(2,’Second Entry’);
d. m.put(1,’First Entry’);
m.put(2,’Second Entry’); ✓
30. What are valid data types in Apex? (Select three)
a. Integer ✓
b. Row Number
c. Date ✓
d. ID ✓
31. Which method causes the entire set of operation to be rolled back ?
a. error()
b. showError()
c. isError
d. addError() ✓
32. You as a Apex Developer want to execute a code when 4 records of Offer_c object are updated.
When you will use to write your code ?
33. Which context variable provide a list of SObjects which we can use only in insert, update & undelete
triggers?
a. old
b. oldMap
c. new ✓
d. newMap
Double x = 87.60;
Integer y = 56;
Integer Y = 67;
System.debug(x+” “ +y +” “ +y);
a. Redeclaration of y ✓
b. Double is not a valid datatype
c. values are not properly concatenated
d. printData() definition is incorrect
35. A developer wrote an Apex code with SOQL embeded below. The account manager position does
not exist in the database. What error message will be displayed ?
FROM Position_c
36. In a Data Model of an application. Account and Contact Object has a look-up relationship where
Accounts is parent of contact. Refer the given SOQL statement & identify the type of query.
37. Which of the following clause is used in a SELECT statement of a SOQL query to control the order of
the query results.
a. ORDER BY ✓
b. WHERE
c. GROUP BY
d. LIMIT
38. In a Data Model of an application, Job application and Review objects has Master-Detail relationship
where Job Application is parent of Review. What will be the relationshipName for child-to-parent
relationship?
a. Review_c
b. Reviews_r
c. Job_Application_c
d. Job_Application_r ✓
• When retrieving data from a single object or multiple objects that are related to one another.
• When counting the number of records that meet a specified criteria.
• Sorting results as part of a query.
• When retrieving data from number, date or checkbox fields.
63. In which Salesforce instances would there be identical record ids? Choose most appropriate option
A. Production, full sandbox
Later in the code of Apex,developer try to print Status__c field value. Identify the type of Exception
raised?
A. IndexException
B. QueryException
C. SObjectException
D. DMLException
3. A developer wrote an Apex Code with SOQL embedded as given below. The Accounts Manager
position does not exist in the database. What type of exception will be thrown?
1. DML exception
2. Query exception
3. NullPointer exception
4. Index exception
12. What is true about Encrypted Fields? Choose most appropriate option
1. They are available in Validation Rules or Apex Scripts even if the user is not having the permission
“View Encrypted Data”
4. In Email Templates, if an encrypted field needs to be displayed without the mask character, the User
who receives the email, should have ‘View Encrypted Data’ permission.
136) Before code can be deployed in production, what percentage of test coverage must be achieved ?
a) 25
b) 100
c) 50
d) 75
137) What are the three different custom tabs you can create?(Select 3)
a) APEX Tab
b) Web Tab
c) Visualforce Tab
147. Which context variable provides a list of sObjects which ………………………. undelete triggers?
Ans. TRIGGER.NEW()
148. ……………. Job Application and Review objects has Master-Detail…………….. is parent of Review. What
will be the RelationshipName for
a. Review__c
b. Reviews__r
c. Job_Application__c
d. Job_Application__r
153. Consider the following trigger code. Identify what SOQL will return?
Trigger simpleTrigger on Account (after insert) { Contact[] cons = [SELECT LastName FROM Contact
WHERE AccountId IN :Trigger.new]; //some other code }
a. Finds every account that is associated with any of the triggering contacts.
b. Finds every contact that is associated with any of the triggering accounts.
c. Finds every contacts that is associated with any of the triggering contacts.
d. Finds every account that is associated with any of the triggering accounts.
160.In Developer Edition how much storage space we get when we sign-up for org?
A. 5MB
B. 10MB
C. 15MB
D. 20MB
A. error()
B. showError()
C. isError()
D. addError()
169)Which function we used to put server side apex method call in queue?
$A.queueAction()
$A.enqueueAction()
$Lightning.queueAction()
$Lighthning.enqueueAction()
No triggers
“@”RestResource
“@”ResourceRest
“@”HttpResource
“@”RestHttp
TRUE
FALSE
a. Before undelete
b. After insert
c. Before update
d. After delete
Which context variable provides a list of sObjects which we can use only in insert, update and undelete
triggers?
A. Old
B. oldMap
C. new
D. newMap
272) Identify the valid statements with respect to Encrypted fields. (They mentioned (*Skip) in the PDF)
Choose four most appropriate options.
D. They are not available for use in …………………. and rule filters
E. Encrypted fields are not available ………. formula fields, outbound mess ………form
282. A user inserts data on a VF page that invokes an Apex Trigger, which calls an SObject.addError()
method. Which statement is true?
A. The error message will be displayed, provided the component included the page
B. The error message will be displayed next to the field causing the error
C. The error message will not be displayed unless the field specific sObject.field.addError() method is
used
D. The error will not be displayed as the Apex Errors are only recorded in the debug log
288. Identify the valid statements with respect to the encrypted fields. Choose four most appropriate
options.
A. Encrypted text fields can be an external ID and can have default value
D. They are not available for use in filters such as list views, reports and rule filters
E. Encrypted fields are not available in lead conversion, workflow, formula fields, outbound messages,
default values and .........forms.
291. You as a Apex Developer want to execute a code when 4 records of Offer__c object are updated.
Which you will use to write your code?
B. Apex Trigger
C. Apex Unit Test
D. Apex Callouts
293. A developer wrote an Apex code with SOQL embedded as given below. The Accounts Manager
position does not exist in the database. What error message will be displayed?
Q 302: Below given is the code for a Map. identify the correct option to add 2 elements to the Map
Mapinfeger, String m= new Map
Q 306: Identify the correct trigger context variable which shows the currently executing code is Apex
trigger. Choose most appropre option:
A- isinsert
B- isExecuting
C- isAfter
D- isDelete
310. What is the default option to scope of fields to search in SOSL statement?
A. NAME FIELDS
B. SIDE FIELDS
C. ALL FIELDS
D. PHONE FIELDS
311. Which triggers are invoked when two contacts are merged? Choose most appropriate option.
C. No triggers
D. Delete and update contact and triggers and triggers on the parent account.
321. An org has a Candidate object with First Name and Last Name fields as required. A developer is
trying to insert a candidate programmatically by following code. What execption will be raised?
Candidate__c candidate = new Candidate__c(First Name__c = ‘Andrew’); Insert candidate;
A. Index Exception
B. Query Exception
C. NullPointer Exception
D. DmlException
366. In Developer Edition how much storage space we get when we sign-up for org?
A. 5MB
B. 10MB
C. 15MB
D. 20MB
417. In which salesforce instances would there be identical record IDs? Choose most appropriate option
461) A developer wrote an APEX code write SOQL embedded as given below. There are five positions for
IT dept. What error message will be displayed?
Position__C position = (select Status_C, Approval_Status_c From position__c Where department_C=
‘IT’)
Which of the following clause is used in SOQL query to specify the maximum no of rows to return?
a) order by
b) where
c)group by
d) limit
c) no triggers
What would be the value of old context variable when 3 records are in selected in an object
a) null
b) new values
c) current values
d) old values
Which clause will be used in SOSL statement to restrict search in specific objects
a) limit
b) returning
c) using
d) order by
In a data model of an application. Job application than and review objects has master-detail relationship
where job application is parent of review. What will be the relationships for parent-to-child
relationship?
a) Review__c
c) Job_application_c
d) Job _application_k
What should be the minimum code coverage % before displaying an apex code?
a) 71
b) 73
c) 75
d) 72
A developer wrote an Apex code with SOQL embedded as given below. The Accounts manager position
as given below. The accounts manager position does not exist in database. What type of exception will
be the own?
a) Dual Exception
b) Query Exception
d) Index Exception
In which salesforce instances would be identical record IDs? Choose most appropriate.
Refer the given code & select the correct option for checking whether the set has an element on not?
Set myset = new set (); Myset.add(1)
Myset.add(3)
System.assert(……….);
a) myset.t (1)
b) myset.index(1)
c) myset.contains(1)
d) myset.present(1)
Identify the correct trigger context varaiable which shows the currently executing code is apex trigger
a) is Insent
b) is Executing
c) is After
d) is Delete
What is the default option related to scope of fields to search in SOSL statement ?
a) NAME FIELDS
b) SLIDEBAR FIELDS
c) ALL FIELDS
d) PHONE FIELDS
2) A developer wrote an apex code with soql embedded as given below. The account manager position
does not exist in database what type of exception will be thrown. QUERY:
a) DML Exception
b) Query Exception
(https://developer.salesforce.com/docs/atlas.enus.apexref.meta/apexref/apex_classes_exception_m
ethods.htm)
d) Index Exception
4) Refer the given code and choose the correct option for checking whether set has an element 1 or
not? CODE: Set myset = new set(); myset.add(1); myset.add(3); system.assert(……);
a) myset.remove(1)
b) myset.index(1)
c) myset.contains(1)
(https://developer.salesforce.com/docs/atlas.enus.apexcode.meta/apexcode/langCon_apex_collecti
ons_sets.htm)
d) myset.present(1)
a) True
(https://developer.salesforce.com/docs/atlas.enus.apexcode.meta/apexcode/langCon_apex_data_ty
pes.htm)
b) False
10) A developer created an email service and wants to deploy the classes it references in production.
How can a developer write a test method to sufficiently test these classes?
a) The developer uses messaging send.email() method address to the email service.
b) Class that only contains email services are not subject requirements.
c) Developer create messaging inbound email and pass them to messaging inbound email handler
( Need to be discuss)
d) The developer creates messaging outbound email method of messaging. Inbound email handler class
7) An org has candidate object with firstname and lastname field is required. A developer is trying to
insert a candidate programmatically by following code. What exception will be made? Code:
Candidate__c Candidate = new Candidate__c (First_Name__c = ‘Andrew’); Insert Candidate;
a) Index exception
b) Query exception
c) Nullpoint exception
d) Dml exception
(https://developer.salesforce.com/docs/atlas.enus.apexref.meta/apexref/apex_classes_exception_m
ethods.htm)
8) What would fit into the model category of MVC paradigm? Choose two appropriate options.
a) VF
b) Custom object
c) Apex class
d) Custom component
11) Match the dynamic Apex features with the corresponding syntax. Features:
a) Describe object/field
b) Dynamic SOQL
c) Dynamic DML
Syntax
12) In a data model of an application, account & contact objects have a look up relation where account
is parent of contact. Refer the below SOQL statements and identify the type of query. Select
Contact.FirstName, Contact.Account.Name from Contact.
c) Sort results
(https://developer.salesforce.com/docs/atlas.enus.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.ht
m)
List <Account>acclist = [select id, account, number from Account limit 20;]
a) Above code will fail to execute during compile time since the name field accessed without being
queried.
b) Above code will fail to execute during run time since the name field accessed without being queried.
(Need to be discuss)
15) In an Apex class, to declare a method as test method, which of the following annotation on keyword
will u use? (select 2)
a) “@Test”
b) Testing Method
c) “@”isTest
(https://trailhead.salesforce.com/en/content/learn/modules/apex_testing/apex_testing_intro)
CheckOnce
d) testMethod
16) What does use of “with sharing” keyword enforce? Choose appropriate option.
a) Only the record sharing and FLS for the running use
17) For the following Apex code select the correct option to fill the blank to retrieve the index 0. > mylist
= newList ();
a) mylist.pull(0);
b) mylist.get(0);
(https://developer.salesforce.com/docs/atlas.enus.apexcode.meta/apexcode/langCon_apex_collecti
ons_lists.htm)
c) mylist.get(1);
d) mylist.retrive(0);
18) A developer used following query to retrieve Position object records. List Position = [Select Name,
Department__C, Location__c from Position__c]. Later in the code of Apex, developer try to print
Status__c field value. Identify the type of exception made.
a) Index
b) Query Exception
c) SObject
d) Dml Exception
19) Consider the following SOSL statement. “Find {Joe Smith}”. What would be returned by statement
assuming the saved text present in records?
c) Return the owner ids of the record where Joe Smith is found.
d) Return the external ids of the record where Joe Smith is found.
20) Consider the following the trigger code. Identify what SOQL will return? Trigger simple trigger on
Account (After insert) {Contact [] cons = {select lastname from contact where Accountid in:
trigger.name}; some other code}
a) Finds every account that is associated with any of the triggering contacts.
b) Finds every contact that is associated with any of the triggering accounts.
c) Finds every contact that is associated with any of the triggering contacts.
d) Finds every account that is associated with any of the triggering accounts.
a) before undelete
b) after insert
c) before update
d) after delete
22) A user insert data into VF page that contains an apex trigger which calls an SObject.adderror()
method. Which statement is true. Choose most appropriate.
b) The error message will be displayed next to the field. (CHECK ONCE)
(https://trailhead.salesforce.com/en/content/learn/modules/apex_triggers/apex_triggers_intro)
c) The error message will not be displayed unless the filed method is used.
d) The error message will not be displayed as the apex errors are only records.
23) Below given is a code for a Map. Identify the correct option to add 2 elements to the Map.
a) Integer
b) Row Number
c) Date (https://www.c-sharpcorner.com/article/apex-data-types-in-salesforce/)
d) Id
a) error()
b) showerror()
c) iserror
d) adderror()
26) You as an Apex developer want to execute a code when 4 records of Offer__c object are updated.
When will use to write your code?
b) Apex triggers
c) Apex unittest
d) Apex callouts
27) Which context variable provide a list of SObects which we can use only in inset, update & undelete
triggers?
a) Old
b) OldMap
c) New
d) NewMap
28) Identify the error in following code. Public Class Test { Double x=87,60; integer y = 56; Integer Y=67;
Print public void printdata() { System.debug(x+” ”+y+” “+Y); } }
a) Redeclaration of Y
30) In a data model of an application, Accounts and contacts objects have a look up relation where
account is the parent of contact. Refer the given soql statement & identify the types of query. Select
account.name. (select contact.firstname, contact.lastname from account.contacts) from account.
31) which of the following clause is used on a select statement of soql query to control the order of the
Query results.
a) order by
b) where
c) group by
d) limit
In a data model of an application, Job application and review objects has Master-Detail relationship
where job application is parent of review.What will be the relationship name for child-to-parent
relationship?
a)Review___c
b)Review___r
c)Jobapplication___c
d)Jobapplication___r
39) You can obtain an instance of an sObject, such as Account, in one of the following ways:
a) By creating the sObject only.
b) Either by creating the sObject or by retrieving a persistent record from Salesforce using SOQL.
c) A generic sObject variable can be assigned to any specific sObject, standard or custom. Such as
Account or Book__c.
1. Refer the code given below.
Class Library{
Private Book book ;
Public Library(Book book){
This.book = book;}
}
ANS: B
<bean id=”library” class=”com.accenture.lkm.library”>
<constructor-arg>
<bean class=”com.accenture.lkmBook”>
<constructor-arg value=”book1”>< constructor-arg>
</bean>
</constructor-arg>
</bean>
ANS:B
Employee Address:Bangalore-Maharasthra
3. Package com.accenture.lkm:
@Component(“employee”)
/// common word(@Autowired,Gettors and Setters,UITester
_____Line1_____
_____Line2_____
_____Line3_____
House,room1,room2
ANS:A
@Autowired,@Qualifier(“room1”),com
ANS:A
Address address= (Address ) ctx.getBean(“createAddress”);
OR
ANS:B
……
Address address= (Address ) ctx.getBean(“Address”);
11.From the Following identify two INCORRECT statements about ServletConfig Object
(i)it is not created for each servlet during servlet initialization
(ii)it will be available to all servlets of an application
(iii)Its lifetime ….object is destroyed
(iv)one object per servlet class
ANS:A
I and ii only
12.Which object is created by web container for each Servlet during servlet initialization?
ANS:B
ServletConfig
13.Mr.john has been assigned the task of creating a servlet filter to log IP address of the
computers ……servlet filters in web.xml file
ANS: A
<web-app>
..
<filter>
<filter-name>..</filter-name>
<filter-class>..</filter-class>
</filter>
….
14.Blessie is a web developer wants to create a web page which always lands in
portal.accenture.com..
Common word(“ index.html,Blessie,unavoidable reasons,MyServlet.java
@WebServlet(urlPatterns=”/MyServlet”),
serialVersionUID=1L;
/**code is missing**/
ANS:B
Response.sentRedirect(http://portal.accenture.com);
15.When you want to remove the user data from session, what all the various options available
in JSP?(choose 3)?
ANS:A,B,C
(i)To delete the session..
(ii)by invoking public..
(iii)in web.xml file use<session-timeout>…
16.Sadana wants to share the common database data throughout the application,Help her to
identify the appropriate code to achieve this task?
ANS:C
<%
String username = (String)application.getAttribute(“dbname”);
%>
29.Identify the correct hierarchy of servlets assuming you are required to create a registration
ANS: A
RegistrationServlet,java…
HTTPServlet…..
GeneralServlet ..
30.Which is an abstract class which provides the basic implementation of Servlet interface except
Service() method?
ANS:C
Generic Servlet
31.from the following tables match the JSP implicit Objects given in table A with APIs in servlets
package given in table B.
Table A Table B
1) Out i)ServletContext,
//Common word(“application,JSPWriter,exception,Object,page,throwable.
ANS: A
1-ii,2-I,3-iv,4-iii
33.Assume that class “Employee” is created with property “empid” and its setter method.
Refer the spring configuration given below
<bean id =”emp” class=”com.Employee”>
<property name=”empid” value=”john”>
</bean>
Employee object ///applicationContext///
ANS: A
1
43./springormdemos”/>
<property name =”username” value….;
<property name=”password” value….;
</bean>
<bean>
Id-“cst_entityManagerFactory” class=*org.springframework.com…
/// dataSource , JpaVendorAdapter”
Class=”org.springframework.orm.jpa.vendor.hibernate.jpavendoradapter
<property name=”showSql”….
<property name=”generate..
Value=”org.hibernate.dialect.MySQL5Dialect”/>
ANS: A
driverManagerDatasource,LocalCOntainerEntityManagerFactoryBean,@Repository,@Auto f
48.Which method is used to retrieve the recent access time of a request by user from session?
ANS:D
getLastAccessedTime().
i.
<% java.util.Data date = new java.util.Date():
out.print(data);
%>
iii.
<%
Java.util.Data data = new java.utilDate():
%>
<%=data%>
55.which lifecycle method of jsp is invoked by the container to perform the actual task also the method is
invoked by the container each ….
ANS:B
_jsp service
56.farhan wants to write a code to add 2 number and return the result…..
ANS:B
<..
<..
58.refer code
@entity
Public class EmployeeEntity
@Id
Private int empId;
…string name;
,,,,double salary ;
//getter and setter methods
60.ClassRunner.class
“myprofile”);
ANS: A, classes, @ActiveProfiles
JSR-330 annotations JSR-330 annotations can not beuesd along with Spring framework annotations
To delete the session attribute we can call public void removeAttributes(String name) , By invoking public void
invaliddate(), In web.xml file use <session->
@RunWith(Spring.Junit4ClassRunner.class)
@ContextConfiguration(_________=MyConfig.class)
_____
@RunWith(SpringJUNIT4ClassRunner.class) @ContextConfiguration(----------=MyConfig.class) ----------(profiles="myProfile") Public class TestSpringCustomClass{
public class TestSpringCustomClass{ @Autowired private Employee employee; } ___
___
}
Choose from below a valid combination to complete the above code____
@Configuration public class AppConfig { @Bean("address") public Address creatAddress() { Adsress address= new Address(); ApplicatonContext ctx=new AnnotationConfigApplicationContext(AppConfig.class); Address address=(Address)
return Address; }} ctx.getBean("addres");
Header.jsp:
<% @ page language = "java" contentType= "text/html; charset = ISO-8859-1" pageEncoding = "ISO-8859-1" %>
<!DOCTYPE html PUBLIC "//W3C//DTD HTML 4.01 Transitional//EN" "HTTP://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1">
<title> insert title here </title>
</head>
<body>
1
<h2> <font color = "blue"> This is content of Header </font> </h2>
</body>
</html>
Footer.jsp
<%@ page languages = "java" contentType = "text html; charset = ISO-8859-1" %>
How many Employee objects will be created if the below code executes successfuly in a main method?
Assume that "context" referes to spring container ApplicationContext
1
1 public static void main(String[] args) {
2 // code for ApplicationContext creation goes here
3 Employee emp1 = (Employee) context.getBean("emp");
4 Employee emp2 = (Employee) context.getBean("emp");
5 Employee emp3= emp1;
6 }
1 @RunWith(SpringJUnit4ClassRunner.class)
2 @ContextConfiguration(__________ = MyConfig.class)
3 __________________(profiles = "myProfile")
4 public class TestSpringCustomClass (
5 @Autowired
6 private Employee employee:
7 // test cases goes here
8 }
Choose from below a valid combination to complete the above code in the order as it appears.
Refer the code given below:
@Entity
class BookEntity{
@ld
private int bookld;
private String title; findByPublisherType(String pType)
private String authorName;
private String publisher Type;
// getters and setters
}
Choose from below the valid option to retrieve the books based on given publisher type by using Query Method Approach
Already Repeated Question
1 @Entity
2 public class CustomerEntity{
@Modifying
3 @Id
4 private int cid;
@Query("delete from CustomerEntity & where k where k.credit*cname)
5 private String cname;
int delete @Param(credit) double credit
6 private double credit;
7 // getter and setter methods
answer is not visible clearly
Choose the valid implementation of the delete query to delete customers who has credit less than a particular value.
Already Repeated Question
Which of the following is correct statement with respect to Spring test @DirtiesContext
<body>
<h3>
<%!
int bookld = 1;
int publish Year = 2000;
public int incrementBookld(int bookld) {
return bookld++;
}
Book Id: 2
%> publish Year: 2001
<%
publish Year++;
bookid++;
%>
</h3>
<h3> Book Id: <% = bookld %> </h3>
<h3> Publish Year: <% = publish Year %> </h3>
</body>
Mr. john has been assigned the task of creating a servlet filter to log IP addresses of the computers from which the
request originate. help him from the follwing options to identify the correct order of tags meant for servlet filters
in web.xml file.
When you want to remove the user data from session, what all the various options available in JSP? All option, other than Perform log out ...
From the following tables match the jsp implicit objects given in table A with Api's in servlets package given in table B
Table A Table B
1.out 1.Servlet c 1. OUT - JSPWRITER 2. APPLICATION- SERVLETCONFIG 3.
2.application 2.JSPWriter EXCEPTION . THROWABLE 4. PAGE - OBJECT
3.exception 3. Object
4.page 4.Throwable
which provides the basic implementation of Servlet interface except Generic Servlet
Which is an abstract class which provides the basic implementation of servlet interface except service() method? Generic Servlet
Refer the code given below
package com.model;
@component("prodObject")
@Profile("myProdProfile")
public classs Product
{
private int productid;
private String productName;
}
@ActiveProfiles(profiles="myorderProfile")
package com.model;
@component("orderObject")
@Profile("myOrderProfile")
public classs Order
{
private int orderId;
private String orderDetail;
}
<named-query name="getPatientsData">
@Query(name="getPatientData")
<query>select p.pName,p.appointmentDate from patients p </query>
List<String> getPatientsData();
</named-query>
Select the correct methid declaration in DAO interface. Refer the patients class and patients table.
Raghav has added a method to update the details of the patients as below
public interface PatientsDAO
{
@Query(name="updateQuery1") @Modifying is not used on the method output should return the string data which i.. the updated
int updateAppointmentSlot(Patients patients, String new Appointment(Time); appointment time.
}
But he getting exception as "DML operation is not supported".What went wrong?
Raghav added the following methods in Service and DAO implementation classes to add paitent's information in db.
//service implementation
@transactional(propagation=Propagation.REQUIRED)
Integer addPatientInService(Patients patient)
{
//calling DAO method
}
addPatientInDAO() method always exceutes in a new transaction rather than the interface started in service
//DAO implementation layer of addPatientInService() method.
@transactional(propagation=Propagation.REQUIRES_NEW)
Integer addPatientInService(Patients patient)
{
//implementation
}
@Component
class Customer(
_____ @Value("#(cartObj")
private Cart cart;
}
Assume instance of the Cart is managed by Spring Container ________
Choose from below a valid SpEL to inject the cart object in Customer bean;
DriverManagerDataSource, LocalContainerEntityManagerFactoryBean,@repository,@A
Which of the following is correct statement with respect to Spring test @DirtiesContext
<web-app>
--------------
<filter>
<filter-name>...</filter-name>
<filter-class>...</filter-class>
</filter>
the task of creating a serviet filter to log IP addresses of the requesis originate. help him from the following
options to identify meant for serviet filters in web.xmi file.
<web-mapping>
<filter-name>...</filter-name>
<urt-pattern>...</urt-pattern>
</filter-mapping>
----------
</web-app>
<servlet>
<servlet-name>Magazine</servlet-name>
<servlet-class>com.accenture.MagazineServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
</web-app>
Choose from below valid options which provides complete support for creation of JPA specific EntityManagerFactory and
LocalContainerEntityManagerFactoryBean
Transaction Management.
Please Refer the following JSP pages Header.jsp <h1> This is Content of Header</h1> 1
<web-app>
<filter>
<filter-name>...</filter-name>
<filter-class>...</filter-class>
Mr. john has been assigned the task of creating a servlet filter to log IP addresses of the computers from which the </filter>
request originate. help him from the follwing options to identify the correct order of tags meant for servlet filters
in web.xml file.(Option is not Visible but answer is correct. just cross check in exam) <filter-mapping>
<filter-name>...</filter-name>
<url-pattern>...</url-pattern>
</filter-mapping>
</web-app>
@RunWith(SpringJUNIT4ClassRunner.class) @ContextConfiguration(----------=MyConfig.class) ----------(profiles="myProfile")
Option 1(options not visible)
public class TestSpringCustomClass{ @Autowired private Employee employee; }
Which is an Abstract class which provides the basic implementation of Sevlet interface except Service method? Generic Servlet
Consider the code below package com.accenture.lkm @Component("address") public class Address @Value("Hyderabad-
Employee Address Banglore,Maharashtra
Telangana")
Refer the code given below @Component @Profile("myProfile") class Product{} Choose from below a valid option to activate
System.setProperty("spring.profiles.active", "myProfile");
the profile "myprofile"
@Componet public class Customer{ @Value("${customerID}")
John has created properties file as below config properties CustomerName: James,CustomerID:1009090(Once Verify once.
private int customerID; @Value("${customerName}")
As options are not visible.Go with the Syntax)
private int customerName;
which of the following statements are correct? 1.JVM supports IOC 2. Spring Container manages the instance of the beans
only II
mentioned in the configuration and provides them back to code when needed.
which of the following statements are correct? 1. @Configuration is used to declare a XML file as a Spring configuration 2.
only II
@ComponentScan is used to scan stereotype annotation.
(i) To delete the session...........
want to remove user data from session, what all various options available in (ii) by invoking public void invalidate().
(iii) in web.xml file use<session-timeout>15</session-timeout>
Which of the following is correct statement with respect to Spring test @DirtiesContext
about @DirtiesContext annotation it is used to closed and load the application context.......
to retrieve the recent access times of a request by user from session? getLastAccessedTime()
(i)When you makes any changes in the...........
When Servlet destroy() method will be invoked by servlet container?
(ii)Whwn you stop the server, Destroy method of the.....
Refer the incomplete code given below:
<beans>
<!--Assume rest of the configuration is written-->
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="txManager"class="org.springframework.orm.jpa.jpa">
<property name="entityManagerFactory"ref="cst_entityManagerFactory">
</bean>
</beans>
____Line1_______ @Repository,@PersistenceContext,@Transactional(value="txManager")
public class EmployeeDAolmpl implements EmployeeDAO{
_____Line2______
private EntityManager entityManager;
____Line3_______
public Integer addEmployee(EmployeeBean employeeBean)
Integer employeeID = 0;
return employeeID;
}
Which of the following is correct statement with respect to Spring test @DirtiesContext
Assume that class "Employee" is created with property 'empid" and its setter metod
Refer teh spring configuration below
<bean id="emp" class ='com.Employee">
<property name="empID' value ="john">
</bean>
How many Emplotyees objects will be created if the below code executes successfully?
1
public static void main(String[] arg){
Employee emp1 =(Employee) context.getBean("emp");
Employee emp2 =(Employee) context.getBean("emp");
Employee emp3 = emp1;
}
Which of the following is correct statement with respect to Spring test @DirtiesContext
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(_________=MyConfig.class)
_____________(profiles="myProfile")
classes, @ActiveProfile
public class TestSpringCustomClass{
@Autowired
(Option was not visible properly spelling may be different)
private Employee employee;
Test cases goes here
}
@Entity
public class CustomerEntity{
@Id @Modifying
private int cid; @Query("delete from CustomerEntity k where ......0
private String cname; int delete(@Param("cpoint") double ....
private double credit;
??getter and setter (the words which are not visible is marked as dots)
}
index.html
-----------------------
<form action="MyServelet" method="POST">
<input type="submit" value="welcome">
</form>
Now Blessie started writing the code, all of a sudden, she handed over the job of completing it to you due to unavoidable reasons. Incomplete code is attached below for your reference.
MyServlet.java
--------------------------- response.sendRedirect("https:/portal.accenture.com");
@WebServlet(urlPatterns="/MyServlet)
public class MyServlet extends HttpServlet{
public static final long serialVersionUID = 1L;
public myServlet(){
super();
}
..........................................
Which of the following is correct statement with respect to Spring test @DirtiesContext
@Entity
Which of the following are with respect to Spring transaction propagation types:
(i) propagation type Propagation.REQUIRED starts a new transaction, if a method is provided from another method and a transaction does not exist.
both (i) and (ii)
(ii) propagation type Propagation.REQUIRED_NEW starts a new transaction, if a method is invoked from another method and a transaction already exists.
index.html
.......................................
..................Not Visible....................................
when you want to remove the user data from the session,what all the various options available in JSP option starting with(to,by,in)
mr.john has been assigned the task of creating a servlet filter to log IP addresses.......................web.xml file answer not clear but i guess <web>(option 1)
Refer the following JSP pages,
Header.jsp:
<% @ page language="java" content type="text/html:charset=ISO-8859-1" 1
From the following table match the JSP implicit objects given in tabe A with APIs in servlet package given in table B 1-ii,2-i,3-iv,4-iii
.....which provide the basic implementation of servlet interface except GenericServlet
choose from the below the INCORRECT statement about JSR-300 annotation JSR-300 annotation.....
which of the following is/are CORRECT statement with respect to "spring Test" @DirtiesContext is used to mark the context dirty....
which is an abstract class which provide the basic implementation of servlet interface except service() method GenericServlet
Which of the following is correct statement with respect to Spring test @DirtiesContext
<web-app>
........
<filter>
<filter-name>...</filter-name>
<filter-class>...</filter-class>
</filter>
Mr John has been assigned the task of creating a servlet flter to log IP addresses
of the computers from which the requests originate. Help him to identify the correct snippet
<filter-mapping>
<filter-name>...</filter-name>
<url-pattern>...</url-pattern>
</filter-mapping>
..........
</web-app>
Which of the following is CORRECT with respect to spring transaction propogation ?
<bean id="transactionManager"
class=org.springframework.orm.jpa.JpaTransactionManager">
<property name="entitymanagerFActory" ref="csf_entityMAnagerFactory"/>
</bean>
</beans>
<web-app>
<filter>
<filter-name>....</filter-name>
<filter-class>...</filter-class>
</filter>
Shed the task of creating a servlet filter to log IP addressess of the requests originate.help him from the following options
<filter-mapping>
to identify meant for servelet filters on web.xml file
<filter-name>....</filter-name>
<uri-pattern>...<uri-pattern>
</filter-mapping>
.....
</web-app>
Which of the following is correct statement with respect to Spring test @DirtiesContext
<bean id="messageSource"
rohit wants to externalize the validation error messages. So, he defined the messages in
class="org springframework.support
'com/accenture/lkm/resoruces/messages_en.properties files'.Help rohit to configure the MesageSource beam in the context file
<property name="name" value="classpath\com\accenture\lkm\resources/messages_en.properties"/>
by choosing a valid option from beiow
</bean>
Rohit deployed the application in the Apache Tomcat Server. But he got an exception as "org.springframework.beans.factory. A) Configure<context:component-scan base-package="com.accenture.lkm.dao"/> in the root context
NoSuchBeanDefinitionException:No qualifying vean of type [com.accenture.lkm.dao.PruchaseDAO]". Choose from below valid confifuration
options to succesfully execute his application C) Configure <mvc:annotation-driven/> in the child context configuration
Rohit wants to display all the validation error messages in purchase jsp. <form:form method="POST" modelAttribute="bean" action="store.html">
Help him to display those messages at the bottom of the page. <table border="3">
Choose from below a valid option. Asssume the below taglib <!--Assume form elements are mentioned appropriately -->
directives are added in the jSP. </table>
<%@taglib url="http://springframework.org/tags/form" prefix="form"%> <spring:hasBindErrors name="bean">
<%@taglib
Consider theurl="http://springframework.org/tags"
code given below: prefix="spring"%> <h3>All Errors</h3>
package com.accenture.lkm; <form:errors path="*" cssClass="error"/>
public class Employee { </spring:hasBindErrors>
private list<String>hobbies: </form:form>
//Getters and Setters are already coded
}
<beans>
<bean id ="employee" class="com.accenture.lkm.Employees">
<property name="hobbies">
<list> Employee 2 hobbies [Playing Cricket Watching Movies]
<value Playing Cricket </value>
<value Watching Movies </value>
<list>
</property>
</bean>
</beans>
public class UIT Tester {
public static void main(String
<web-app>
.......
<filter>
<filter-name>...</filter-name>
<filter-class>...</filter-class>
</filter>
the task of creating a servlet filter to log IP addresses of the request originate. Help him from the following options to identify
meant forservlet filters in web.xml file.
<filter-mapping>
<filter-name>....</filter-name>
<urf-pattern>....</urf-pattern>
</filter mapping>
.......
</web-app>
Which of the following is correct statement with respect to Spring test @DirtiesContext
Which method is used to retrieve the recent access time of a equeste by user from session?
getLastAccessedTime()
choose from below valid option.
Rohit wants to validate the quantity entered by the customer as mentioned in requirement 2. Choose from the below valid Add @Range(min=1, max=10)anotation in the Bean class
option.[Choose 2] The request handler method should include @Valid to @ModelAnnotation parameter
Rohit wants to receive the requests from customers and forward those request to other components of the application for
further processing . Choose from the most appropriate option, which Rohit performs as his first step as per Spring-MVC
workflow.
A
<bean class="org.springframework>
<property name="prefix">
Rohit wants to navigate to success.jsp page on successful submission. Assume he wrote a handler method to return <value>/WEB-INF/jspViews/</value>
ModelAndView with logical view name as success. He needs to configure a View Resolver bean in child configuration file to </property>
resolve the logical view name.Choose from below a valid option <property name="suffix">
<value>jsp</value>
</property>
</bean>
Rohit wants to create a request handler method in controller that can handle customer request and send the response back to Create a request handler method in the controller to map the request using @RequestMapping annotation and
the response back to the customer. Help rohit to achieve this with a valid option given below. return the ModelAndView object.
Rohit wants to auto populate the items available for the selected SportsType to the respective drop-down box. Assume he A
defined the respective method in the controller which can return Map<String,Double>. Rohit is supposed to bind the key as OPTION NOT VISIBLE
label attribute, value as value attribute in the drop-down box. Choose from below a valid option.
Rohit wants to create an auto populated drop-down box in purchase.jsp page. Help Rohit to implement a proper handler Create a method in the controller to invoke DAO layer method which returns the Map of SportsType with
method in controller that can retrieve sportsType defined in DAO layer. Choose from below a valid option. @ModelAttribute annotation.
Which of the following is correct statement with respect to Spring test @DirtiesContext
From the following tables match the JSP implicit objects given in table A with APIs in
sevlets package given in table B. 1 - ii
Table A Table B 2-i
1) out i) ServletContext
2) application ii) JSPWriter 3 - iv
3) exception
4) page
iii) Object
iv) Threwable
4 - iii
Refer the folowing JSP pages
Header.jsp:
<% @ page language = "java" contentType= "text/html; charset = ISO-8859-1" pageEncoding = "ISO-8859-1" %>
<!DOCTYPE html PUBLIC "//W3C//DTD HTML 4.01 Transitional//EN" "HTTP://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1">
<title> insert title here </title>
</head>
<body>
1
<h2> <font color = "blue"> This is content of Header </font> </h2>
</body>
</html>
Footer.jsp
<%@ page languages = "java" contentType = "text html; charset = ISO-8859-1" %>
How many Employee objects will be created if the below code executes successfuly in a main method?
Assume that "context" referes to spring container ApplicationContext
1 @RunWith(SpringJUnit4ClassRunner.class)
2 @ContextConfiguration(__________ = MyConfig.class)
3 __________________(profiles = "myProfile")
4 public class TestSpringCustomClass (
5 @Autowired
6 private Employee employee:
7 // test cases goes here
8 }
Choose from below a valid combination to complete the above code in the order as it appears.
Refer the code given below:
@Entity
class BookEntity{
@ld
private int bookld;
private String title; findByPublisherType(String pType)
private String authorName;
private String publisher Type;
// getters and setters
}
Choose from below the valid option to retrieve the books based on given publisher type by using Query Method Approach
1 @Entity
2 public class CustomerEntity{
@Modifying
3 @Id
4 private int cid;
@Query("delete from CustomerEntity & where k where k.credit*cname)
5 private String cname;
int delete @Param(credit) double credit
6 private double credit;
7 // getter and setter methods
answer is not visible clearly
Choose the valid implementation of the delete query to delete customers who has credit less than a particular value.
Which of the following is correct statement with respect to Spring test @DirtiesContext
<body>
<h3>
<%!
int bookld = 1;
int publish Year = 2000;
public int incrementBookld(int bookld) {
return bookld++;
}
Book Id: 2
%> publish Year: 2001
<%
publish Year++;
bookid++;
%>
</h3>
<h3> Book Id: <% = bookld %> </h3>
<h3> Publish Year: <% = publish Year %> </h3>
</body>
Answer : A) @Value(“#{cartObj}”)
2 Consider the code given below:
Package com.accenture.lkm;
Answer :
3 Refer the incomplete code given below
Package com.accenture.lkm;
Answer : A) 1
Answer : A) @Transaction(value="txManager",propogation.REQUIRED_NEW)
7 From the following identify which is NOT a session management technique?
Answer:- A) Request…………
10 Farhan wants to write a code to add 2 numbers and return the result……….
……………………………………….. JSP scripting element.
Answer :- B
11 Miss Ashrey has beed asked to add headers and footers while designing login
and home page………………………………………..Header.jsp and footer.jsp
Answer :- A
12 Which of the following is/are CORECT statement(S) with respect to spring Test?
Answer :- B
15 Refer the code given below.
@Entity
Public class EmployeeEntity{
Answer:- A
16 Refer the incomplete code given below:
<beans>
<!..
Answer : A & B (A) Use @Autowired at LineX and (B) Use @Autowired at LineY
Answer : (A)
21 Refer the incomplete code
Answer :- A) When you make any change in the servlet class and save
C) When you stop the server, destroy method of all existing servlet objects………
23 Which is an abstract class which provides the basic implementation of Servlet interface except
Service() method ?
Answer :- C) GenericServlet
24 Refer the Below Entity class.
Answer : (A)
25 Which method is used to retrive the recent access time of a request by user from session?
Answer : D) getLastAccessedTime()
1 Refer the code given below:
Class Library{
<constructor-arg>
<bean class=”com.accenture.lkm.Book”>
<constructor-arg value=”book1”></constructor=ard>
</bean>
</constructor-arg>
</bean>
2 Refer the incomplete code given below:
Package com.accenture.lkm;
Class House{
Answer :- A and D
4 Refer the Spring configuration code given below.
Identify the correct code to create spring container object and get the address object
Answer :- A
5 Choose from below the valid option which provides the complete support for creation of JPA
specific EntityManagerFactory and Transaction Management.
Answer : B) LocalContainerEntityManageFactoryBean
6 Which of the following is/are Correct with respect to spring transaction methods?
Choose the valid implementation of the delete query to delete customers who has credit less
Answer : A
8 Which of the following statement(s) is/are CORRECT with respect to JSP?
9 From the following identify TWO INCORRECT statements about ServletConfig object.
Answer :- b) ServletConfig
11 Mr.John has been assigned the task of creaing servlet filter to log IP address of the computers
Answer : A
12 Blessie is a web developer wants to create a wep page…………………whenever user hits on
welcome button on index.html given below
Answer :- B) response.sendRedirect(“https://portal.accenture.com”);
1 Sadana wants to share the common database date throughout the application. Help her to identify
the appropriate code to achieve thi task.
Answer : C) <%
String username=(String)application.getAttribute(“dbname”);
%>
2 Refer the following code:
Answer : (A)
3) Refer the following JSP Pages.
Header.jsp:
4) Refer the incomplete code given below.
Package com.model;
Answer : C) @ContextConfiguration(locations=”/com/resources/my_springbeam_xml”),@test
5) Which of the following is/are CORECT statement(S) with respect to spring Test?
Answer :- B) system.setProperty("spring.profiles.active","myprofile");
2 Consider the code given below
Package com.accenture.lkm;
@component(“address”)
Answer :- A
Answer : - Only 2
5 Which of the following statement(S) is/are correct.
6 Which of the following is CORRECT with respect to spring transaction pro… types ?
Answer :- A
10 Which is an abstract class which provides the basic implementation of servlet interface except
service() method?
Answer :- C) GenericServlet
11 Mr.john has been assigned the task of creating a servlet After to log IP…………………………………………
The correct order of tags meant for servlet filters in web.xml file.
Answer :- A) <web-app>
12 Consider a web application is created with a welcome file index.html mapped with a servlet class
Answer :- B
13 When you want to remove the user data from sessions, what all the various options available in
JSP? [Choose 3].
Answer : A) To delete the session attribute we can call public void removeAttribute(String Name)
@Entity
Class BookEntity