Salesforce Integration Interview Questions & Answers from a Recent Infosys Interview

Introduction

Yesterday, one of our students at GradX Academy appeared for a Salesforce Developer interview at Infosys. The interview heavily focused on Salesforce integrations. To help aspiring candidates, we’ve compiled a detailed answer key for the exact questions asked during the interview.

This guide includes:
✔️ Key Salesforce Integration Questions
✔️ Best Practices & Common Mistakes
✔️ Verified Apex Code for Real-world Implementation

If you’re preparing for a Salesforce interview, this is a must-read!


📌 Infosys Salesforce Interview Questions

1️⃣ How would you implement an asynchronous integration using Queueable Apex?
2️⃣ How do you integrate Salesforce with an external system using OAuth 2.0?
3️⃣ How would you connect Salesforce with an external SOAP API using a WSDL file?
4️⃣ How do you integrate Salesforce with SAP using MuleSoft?
5️⃣ How do you implement real-time order tracking using WebSockets in Salesforce?
6️⃣ How do you integrate Salesforce with Google Drive for file storage?


✅ Answer Bank with Verified Code

1️⃣ How would you implement an asynchronous integration using Queueable Apex?

Solution:
Queueable Apex is used to handle long-running external callouts asynchronously. It allows retry logic, error handling, and chaining.

✅ Correct Code Implementation:

public class ExternalSystemQueueable implements Queueable, Database.AllowsCallouts {
public void execute(QueueableContext context) {
HttpRequest req = new HttpRequest();
req.setEndpoint('https://external-system.com/api/data');
req.setMethod('GET');
    Http http = new Http();
    HttpResponse res = http.send(req);

    if (res.getStatusCode() == 200) {
        System.debug('External System Data: ' + res.getBody());
    } else {
        System.debug('Error: ' + res.getStatusCode() + ' - ' + res.getBody());
    }
}

}

Common Mistakes:
❌ Not handling API failures properly.
❌ Not considering governor limits (especially for multiple callouts).
❌ Forgetting to implement Database.AllowsCallouts in the Queueable class.


2️⃣ How do you integrate Salesforce with an external system using OAuth 2.0?

Solution:
OAuth 2.0 enables secure authentication for API callouts. The recommended approach is to use Named Credentials for simplicity.

✅ Correct Code Implementation (Using Named Credentials):

HttpRequest req = new HttpRequest();
req.setEndpoint('callout:MyOAuthNamedCredential/external-api/endpoint');
req.setMethod('GET');
Http http = new Http();
HttpResponse res = http.send(req);
if (res.getStatusCode() == 200) {
System.debug('OAuth API Response: ' + res.getBody());
} else {
System.debug('Error: ' + res.getStatusCode() + ' - ' + res.getBody());
}

Common Mistakes:
❌ Not refreshing OAuth tokens dynamically.
❌ Using the wrong OAuth flow (e.g., Client Credentials vs. Authorization Code Grant).
❌ Hardcoding credentials instead of using Named Credentials.


3️⃣ How would you connect Salesforce with an external SOAP API using a WSDL file?

Solution:
Salesforce allows integrating with SOAP APIs using Apex classes generated from WSDL.

✅ Correct Code Implementation:

// Generated Apex class from WSDL
WebServiceCallout.WS_Service ws = new WebServiceCallout.WS_Service();
WebServiceCallout.SomeResponse response = ws.SomeMethod('parameter');
if (response != null) {
System.debug('SOAP API Response: ' + response);
} else {
System.debug('Error: No response from SOAP API.');
}

Common Mistakes:
❌ Not handling SOAP faults and timeouts.
❌ Not testing the integration in a sandbox before production deployment.


4️⃣ How do you integrate Salesforce with SAP using MuleSoft?

Solution:
MuleSoft acts as middleware to connect Salesforce and SAP using the Salesforce REST API.

✅ Correct Steps for Integration:
1️⃣ Trigger: API request from Salesforce.
2️⃣ Transform: Convert JSON (Salesforce format) to XML (SAP format).
3️⃣ Connect: Use MuleSoft’s SAP connector to push data.
4️⃣ Response: Send success or error status back to Salesforce.

Common Mistakes:
❌ Not handling SAP system downtime.
❌ Skipping validation checks, leading to incorrect data updates.


5️⃣ How do you implement real-time order tracking using WebSockets in Salesforce?

Solution:
Use CometD (Bayeux protocol) to subscribe to Platform Events for real-time updates.

✅ Correct Code Implementation (JavaScript for WebSockets Client):

const cometd = new CometD();
cometd.configure({ url: 'https://your-instance.salesforce.com/cometd/57.0/' });

cometd.handshake(response => {
    if (response.successful) {
        cometd.subscribe('/event/Order_Tracking__e', message => {
            console.log('Order Update:', message.data.payload);
        });
    }
});

Common Mistakes:
❌ Not handling WebSocket handshake failures properly.
❌ Using an incorrect API version for CometD subscriptions.


6️⃣ How do you integrate Salesforce with Google Drive for file storage?

Solution:
Salesforce can call Google Drive API to upload files and store links.

✅ Correct Code Implementation:

apex

CopyEdit

public class GoogleDriveUploader { public static void uploadFileToDrive(String fileName, Blob fileContent) { HttpRequest req = new HttpRequest(); req.setEndpoint('https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart'); req.setMethod('POST'); req.setHeader('Authorization', 'Bearer YOUR_ACCESS_TOKEN'); req.setHeader('Content-Type', 'multipart/form-data'); Http http = new Http(); HttpResponse res = http.send(req); System.debug('Response: ' + res.getBody()); } }

Common Mistakes:
❌ Hardcoding OAuth tokens instead of refreshing them dynamically.
❌ Exceeding Google API’s file size and rate limits.


Conclusion

🚀 If you’re preparing for a Salesforce Developer interview, these Infosys interview questions and solutions will help you master integrations.

📢 Found this useful? Share your thoughts in the comments & tag someone preparing for a Salesforce interview!

#Salesforce #SalesforceInterview #Infosys #SalesforceDeveloper #SalesforceJobs #MuleSoft #QueueableApex #GoogleDriveIntegration #WebSocketsSalesforce #GradXAcademy

Sign up for our Newsletter

To get the blog notification by email subscribe to the GradX Academy Newsletters.

Book Your Seat For FREE

GradX Enquiry Form

By creating an account I have read and agree toTerms and Privacy Policy