Font size
WorksheetsWipro Salesforce Assesment
Total questions: 100
Worksheet time: 2hrs 40mins
What will be the output of this Apex code?
Integer sum = 0;
List
12
6
0
10
What is the result of the following Apex code?
Map
10
20
30
Null
What does the following Apex code do?
Set
Deletes the account records
Creates duplicate account IDs
Stores unique Account Ids
Throws compile-time error
What will be the result of this Apex code?
List
Deletes only one record
Deletes two records
Causes an error
Updates records
What is the correct bulkified version of this trigger logic? trigger AutoTask on Opportunity (after insert) { for(Opportunity opp : Trigger.new){ Task t = new Task(Subject='Follow Up', WhatId=opp.Id); insert t; } }
Move loop inside insert
Create one task per opportunity
Use a List to collect and insert tasks outside the loop
Use SOQL inside loop
What does this code snippet do?
List
Inserts 3 accounts with same name
Inserts 3 accounts with unique names
Fails due to duplicate
Fails due to null values
What exception is thrown when a DML statement fails partially?
try {
insert new List
NullPointerException
QueryException
DmlException
ListException
Which method correctly avoids hardcoding record types? Id recTypeId = [SELECT Id FROM RecordType WHERE SObjectType='Account' AND Name='Customer' LIMIT 1].Id;
Hardcoding the ID
Querying RecordType object
Using static string
Using Metadata API
What will be the result of this SOQL query in Apex?
List
0
3
10
Compile Error
What does the following test class do? @isTest private class AccountTest { static testMethod void validateInsert(){ Account a = new Account(Name='Test Acc'); insert a; System.assertNotEquals(null, a.Id); } }
Tests DML update
Tests account deletion
Validates insert operation
Creates contact
Which of the following controls record-level access in Salesforce?
Profiles
Permission Sets
Role Hierarchy
Object Settings
Which feature is used to restrict field-level access in Salesforce?
Record Types
Profiles
Roles
Sharing Rules
What is the highest level in the Salesforce sharing model that determines baseline access for all records?
Permission Sets
Role Hierarchy
Organization-Wide Defaults (OWD)
Profile
Which of the following CANNOT be controlled by a Profile?
Tab Visibility
Record Sharing
Field-Level Security
Object Permissions
If a user needs temporary access to additional objects without changing their profile, what should be used?
Sharing Rules
Permission Sets
Role Hierarchy
Manual Sharing
Which security feature ensures sensitive data like passwords are not exposed during API calls?
Object Permissions
Encrypted Fields
Role Hierarchy
Sharing Settings
Which of the following enforces security at the database level in Apex?
With Sharing
Without Sharing
Inherited Sharing
Enforced Sharing
Which sharing model allows the most granular sharing by users manually?
Role Hierarchy
Permission Sets
Manual Sharing
OWD
Which type of relationship in Salesforce allows a child record to exist without a parent record?
Lookup Relationship
Master-Detail Relationship
Hierarchical Relationship
Junction Object
In a Master-Detail relationship, what happens when a parent record is deleted?
Child records remain unchanged
Child records get deleted
Child records are archived
Child records convert to lookups
Which relationship allows many-to-many connections between two objects?
Lookup
Master-Detail
Junction Object
External Lookup
How many Master-Detail relationships can a custom object have?
1
2
3
Unlimited
Which relationship type can reference an external object?
Master-Detail
Lookup
Hierarchical
Junction Object
Which type of relationship is only available on the User object?
Master-Detail
Hierarchical
Lookup
External Lookup
In a Master-Detail relationship, who controls the security of child records?
Child Profile
Parent Record Owner
Role Hierarchy
Sharing Rules
Which relationship field is NOT supported on external objects?
Indirect Lookup
External Lookup
Master-Detail
Lookup
What is true about a Junction Object in Salesforce?
It contains at least one Master-Detail relationship
It contains two Master-Detail relationships
It cannot have lookups
It must be a standard object
Which of the following is used to avoid hard coding record IDs in Apex?
Static Variables
Custom Labels
Schema Methods
Maps
Which collection type in Apex does NOT allow duplicate values?
List
Map
Set
Array
Which Apex annotation is required for asynchronous methods?
@testSetup
@future
@AuraEnabled
@isTest
Which governor limit applies per SOQL query?
Maximum 100 Queries per Transaction
Maximum 50,000 Records Retrieved
Maximum 150 Queries per Transaction
Maximum 10 Queries per Transaction
How do you declare a constant in Apex?
final String s = "Test";
const String s = "Test";
static String s = "Test";
constant String s = "Test";
Which exception type must always be handled explicitly in Apex?
Custom Exceptions
Checked Exceptions
DMLException
NullPointerException
What is the return type of the Database.insert() method when called with allOrNone = false?
Boolean
Savepoint
List
Void
Which of the following statements is TRUE for SOQL in Apex?
You can use more than 500 queries per transaction
You can retrieve related records using relationship queries
You cannot query standard objects
Queries always return Lists of Maps
How do you prevent recursive trigger execution in Apex?
Use @future
Use a Static Boolean Flag
Use Database.Stateful
Use Batch Apex
Which of the following trigger events is NOT valid in Salesforce?
before insert
after undelete
before update
before undelete
What is the maximum number of DML statements allowed in a single trigger execution context?
100
150
200
Unlimited
Which method is used to access the old version of records inside a trigger?
Trigger.new
Trigger.old
Trigger.newMap
Trigger.oldList
What type of trigger should be used to validate data before saving to the database?
after insert
before insert
after update
after delete
Which collection provides access to a map of record IDs to records in a trigger?
Trigger.old
Trigger.oldMap
Trigger.new
Trigger.list
What is a best practice to avoid hitting governor limits in triggers?
Use nested loops
Use SOQL queries inside loops
Use Bulkification
Use multiple triggers per object
How many triggers can you write per object in Salesforce?
1
2
Unlimited
5
Which statement is TRUE about after triggers?
You can change field values before commit
Records are already saved to the database
They run before validation
They don't allow relationship queries
Which method is used to check if the current context is executing as part of a batch Apex job?
System.isBatch()
System.isFuture()
System.isQueueable()
System.isScheduled()
Which decorator is used in LWC to expose a property to the parent component?
@wire
@track
@api
@AuraEnabled
Which LWC file defines the component's UI?
.js
.xml
.html
.css
Which method is used to call an Apex method imperatively in LWC?
@wire
import ApexMethod from '@salesforce/apex/...'
getRecord()
getFieldValue()
Which file is mandatory for every LWC component?
.css
.xml
.html
.js
Which directive in LWC is used for conditional rendering?
for:each
if:true
for:item
show:when
What is the correct way to bind a CSS file to a Lightning Web Component?
Inline CSS only
Static resource import
Use a .css file with the same name as component
CSS is not supported
Which LWC lifecycle hook is called after every render of the component?
connectedCallback
renderedCallback
disconnectedCallback
errorCallback
Which directive is used in LWC for iterating over a list of records?
for:each
for:item
loop:each
foreach
Which decorator should be used to make a property reactive in LWC?
@wire
@api
@track
@AuraEnabled
Which protocol is primarily used by Salesforce for web service integration?
FTP
SOAP
SMTP
POP3
Which Salesforce feature is best suited for real-time integration?
Outbound Messages
Platform Events
Batch Apex
Data Loader
What authentication mechanism does Salesforce recommend for REST API calls?
Username & Password
OAuth 2.0
API Key
Session ID in URL
Which Salesforce object stores details about connected apps and integrations?
ConnectedApplication
User
AuthSession
APIEvent
Which REST resource allows querying Salesforce data using SOQL?
/services/data/vXX.X/sobjects/
/services/data/vXX.X/query
/services/data/vXX.X/tooling/
/services/apexrest/
When calling a REST API in Salesforce, what format is used for request and response?
CSV
JSON
XML
Binary
Which Salesforce integration feature is best for large-volume, asynchronous data processing?
REST API
SOAP API
Bulk API
Metadata API
Which Salesforce feature allows external systems to subscribe to events published in Salesforce?
Web-to-Lead
Outbound Messaging
Platform Events
Connected App
Which of the following methods is required in a Batch Apex class?
start(), execute(), finish()
init(), run(), end()
begin(), process(), stop()
executeBatch(), start(), finish()
What is the default batch size in Batch Apex?
100
200
500
1000
Which annotation is used in a test class method?
@AuraEnabled
@future
@isTest
@testSetup
How many test classes can be executed simultaneously in Salesforce?
100
200
75
Unlimited
Which method in a test class ensures test data is created before any tests run?
@isTest
@testSetup
@future
@mock
Which of the following methods is required to schedule a batch Apex?
execute()
schedule()
start()
executeBatch()
What is the maximum number of lookup relationships a custom object can have?
Unlimited
50
40
25
Which method is used to send an email in Apex?
Messaging.send()
Mail.send()
Email.send()
Messaging.sendEmail()
What is the purpose of the @isTest annotation in Apex?
To enable debug logging
To indicate a method is asynchronous
To mark a method as a test method
To define a test class
What will happen when the button is clicked?
count = 0;
handleClick() {
this.count++;
}
<lightning-button label="Add" onclick={handleClick}></lightning-button>
<p>{count}</p>
A) Error occurs
B) Count decreases
C) Count increases by 1 on each click
D) Nothing happens
What will be the output of the following LWC code?
name = 'Salesforce';
get greeting() {
return 'Hello ' + this.name;
}
<p>{greeting}</p>
A) Hello
B) Salesforce
C) Hello Salesforce
D) greeting
What will be the output of the following LWC code after clicking the button once?
import { LightningElement, track } from 'lwc';
export default class Demo extends LightningElement {
@track count = 5;
handleClick() {
this.count = this.count + 10;
}
}
<lightning-button label="Click" onclick={handleClick}></lightning-button>
<p>{count}</p>
A) 5
B) 10
C) 15
D) Error
What will be displayed in the browser?
import { LightningElement } from 'lwc';
export default class Student extends LightningElement {
students = ['Aman', 'Rahul', 'Priya'];
}
<template for:each={students} for:item="std">
<p key={std}>{std}</p>
</template>
A) Aman Rahul Priya
B) Only Aman
C) Error because key is missing
D) Nothing
What is the output of the following getter method?
firstName = 'Sales';
lastName = 'Force';
get fullName() {
return `${this.firstName} ${this.lastName}`;
}
<p>{fullName}</p>
A) SalesForce
B) Sales Force
C) fullName
D) Undefined
Which value will be shown after component loading?
import { LightningElement } from 'lwc';
export default class Test extends LightningElement {
message = 'Hello';
connectedCallback() {
this.message = 'Welcome';
}
}
<p>{message}</p>
A) Hello
B) Welcome
C) Undefined
D) Error
Which option correctly updates a reactive property?
import { LightningElement, track } from 'lwc';
export default class Demo extends LightningElement {
@track value = 1;
increase() {
_____
}
}
A) value++
B) this.value++
C) track.value++
D) @track.value++
What will be the output of the following wire service code?
import { LightningElement, wire } from 'lwc';
import getRecord from '@salesforce/apex/AccountController.getRecord';
export default class Demo extends LightningElement {
@wire(getRecord) account;
}
A) account stores Apex response data
B) Apex method will not execute
C) Syntax error
D) account becomes undefined always
What happens if an Apex method used with @wire is marked as non-cacheable?
A) It works normally
B) Component crashes
C) Apex method must use @AuraEnabled(cacheable=true)
D) LWC automatically fixes it
What will happen when the following trigger executes?
trigger AccountTrigger on Account(before insert) {
for(Account acc : Trigger.new){
acc.Name = acc.Name.toUpperCase();
}
}
A) Trigger throws an error
B) Account names are converted to uppercase before saving
C) Account names remain unchanged
D) Trigger works only for update
What is wrong with the following Apex code?
Account acc = [SELECT Id, Name FROM Account];
System.debug(acc.Name);
A) SOQL syntax error
B) Query may return multiple rows exception
C) System.debug cannot be used
D) Id field cannot be queried
What will be the output?
Map<Integer, String> data = new Map<Integer, String>();
data.put(1, 'A');
data.put(2, 'B');
data.put(1, 'C');
System.debug(data.get(1));
A) A
B) B
C) C
D) Null
What is the issue in the following trigger?
trigger ContactTrigger on Contact(after insert) {
for(Contact con : Trigger.new){
Account acc = [SELECT Id, Name FROM Account WHERE Id = :con.AccountId];
acc.Name = 'Updated';
update acc;
}
}
A) Invalid SOQL query
B) DML operation not allowed in trigger
C) SOQL and DML inside loop causing governor limit issue
D) Trigger syntax is incorrect
What will happen after executing the trigger?
trigger OpportunityTrigger on Opportunity(before update) {
for(Opportunity opp : Trigger.new){
if(opp.Amount > 100000){
opp.addError('Amount cannot exceed 100000');
}
}
}
A) Record updates successfully
B) Trigger is skipped
C) Record update fails with error message
D) Amount becomes 100000 automatically
What issue exists in the following trigger?
trigger LeadTrigger on Lead(after insert) {
List<Task> taskList = new List<Task>();
for(Lead l : Trigger.new){
Task t = new Task(
Subject = 'Follow Up',
WhoId = l.Id
);
insert t;
}
}
A) Task creation is invalid
B) DML statement inside loop causing governor limit issue
C) Trigger syntax error
D) WhoId cannot store Lead Id
What is the output of the following code?
List<Integer> nums = new List<Integer>{2,4,6};
Integer result = 1;
for(Integer n : nums){
result *= n;
}
System.debug(result);
A) 12
B) 24
C) 48
D) 6
What is the major issue in this Apex code?
for(Account acc : [SELECT Id FROM Account]){
Contact con = new Contact(
LastName = 'Test',
AccountId = acc.Id
);
insert con;
}
A) Contact creation is invalid
B) SOQL query inside loop
C) DML inside loop causing governor limit issue
D) AccountId cannot be assigned
What is the output of the following trigger logic?
trigger OpportunityTrigger on Opportunity(before insert) {
for(Opportunity opp : Trigger.new){
if(opp.StageName == 'Closed Won'){
opp.Description = 'Opportunity Won';
}
}
}
If a record is inserted with StageName = 'Closed Won'
A) Description remains blank
B) Trigger fails
C) Description becomes "Opportunity Won"
D) StageName changes automatically
What will be the output of the following JavaScript code used in LWC?
let data = [1, 2, 3];
let result = data.map(num => num * 2);
console.log(result);
A) [1,2,3]
B) [2,4,6]
C) [1,4,9]
D) Error
What is the output of the following code?
let x = 5;
function test() {
let x = 10;
console.log(x);
}
test();
console.log(x);
A) 5 5
B) 10 10
C) 10 5
D) 5 10
What will be the output of the following SOQL query?
SELECT Name FROM Account LIMIT 3
A) Returns all Account records
B) Returns first 3 Account names
C) Returns only one Account
D) Query throws error
hat is wrong with the following Apex code?
List<Account> accList = [SELECT Id, Name FROM Account WHERE Name = 'ABC'];
System.debug(accList.Name);
A) SOQL syntax error
B) List cannot directly access field values
C) Account object is invalid
D) WHERE clause is incorrect
What will happen when this query executes?
Account acc = [SELECT Id FROM Account];
A) Always returns one record
B) Returns all Account records
C) May throw "List has more than 1 row for assignment" exception
D) Syntax error
Which SOQL query correctly fetches Contacts related to an Account?
A)
SELECT Name FROM Contact WHERE Account.Name = 'ABC'
B)
SELECT Name FROM Contact WHERE AccountId != null
C)
SELECT Name, Account.Name FROM Contact
D) Both B and C
What will be the output of the following code?
List<Account> accs = [SELECT Id FROM Account LIMIT 5];
System.debug(accs.size());
A) 0
B) 1
C) 5
D) Depends on available records up to 5
Which query is used to fetch child Contacts from Account?
A)
SELECT Name FROM Contact
B)
SELECT Name, (SELECT LastName FROM Contacts) FROM Account
C)
SELECT Contacts FROM Account
D)
SELECT LastName FROM Contacts
A) Invalid binding variable
B) SOQL inside loop causing governor limit issue
C) Contact object is invalid
D) Query cannot be used in loop
What will be the result of the following query?
SELECT Name FROM Account WHERE Name LIKE 'A%'
A) Accounts ending with A
B) Accounts containing A only in middle
C) Accounts whose names start with A
D) Query error
Which aggregate query correctly counts total Accounts?
A)
SELECT COUNT(Name) FROM Account
B)
SELECT COUNT() FROM Account
C)
SELECT TOTAL() FROM Account
D)
SELECT SUM(Account) FROM Account
