Round 1: Coding (Apex, Triggers, API Calls, Salesforce Security)

Time: 1 hour

The first round began with the interviewer, a senior Salesforce developer from Amazon, joining the call. Let’s call him Rajesh. He seemed quite friendly but got straight to business after a quick intro.

Part 1: Apex Coding Challenge

Rajesh shared a live coding platform and asked me to write an Apex class that calculates the total revenue for a list of opportunities based on their StageName. The twist was that the revenue should exclude opportunities owned by users belonging to a specific role.

Here’s what I coded:

I tested it with a sample roleIds set, and Rajesh nodded approvingly, but then he dropped the bomb:

“What happens if there’s a null value in the Amount field?”

I panicked for a second but quickly added a null check inside the loop:

if (opp.Amount != null) {

    totalRevenue += opp.Amount;

}

He smiled and moved on.

Part 2: Trigger Challenge

Next, I had to write a trigger that ensures any opportunity with an amount over $1M automatically gets flagged by setting a custom field High_Value__c to true.

This was my solution:

trigger HighValueOpportunityTrigger on Opportunity (before insert, before update) {

    for (Opportunity opp : Trigger.new) {

        if (opp.Amount != null && opp.Amount > 1000000) {

            opp.High_Value__c = true;

        } else {

            opp.High_Value__c = false;

        }

    }

}

Rajesh asked about bulkification, and I explained that the code runs efficiently even with multiple records because the loop processes all records from the Trigger.new collection. He seemed happy with my explanation.

Part 3: API Call and Security

Lastly, I had to write an Apex REST service that allows external systems to query contact data securely. The service needed to validate incoming API keys.

Here’s the service I wrote:

@RestResource(urlMapping=’/ContactData/*’)

global with sharing class ContactDataAPI {

    @HttpGet

    global static List<Contact> getContactData() {

        RestRequest req = RestContext.request;

        String apiKey = req.headers.get(‘API-Key’);

        // Hardcoded key for simplicity (just for interview purposes)

        if (apiKey != ‘12345’) {

            RestContext.response.statusCode = 401;

            RestContext.response.responseBody = Blob.valueOf(‘Unauthorized’);

            return null;

        }

        return [SELECT Id, Name, Email FROM Contact];

    }

}

Rajesh then asked how I’d secure the API in production. I mentioned using Named Credentials, OAuth for token-based authentication, and Salesforce Shield for monitoring access logs.

Round 2: Salesforce Design (Data Sync via MuleSoft)

Time: 1 hour

The second round was with a Salesforce architect named Meera. She asked me to design a real-time data sync between Salesforce and an ERP system using MuleSoft.

Scenario:

A new record is created in the ERP system, and it must reflect in Salesforce as a corresponding record within 5 seconds. Similarly, updates in Salesforce must sync back to the ERP in real-time.

My Solution:

1. Use a MuleSoft connector to listen to the ERP system’s outbound messages.

2. Transform the data in MuleSoft to match Salesforce’s record schema.

3. Use the Salesforce Connector to create or update records in Salesforce.

4. For the reverse sync, enable Salesforce Platform Events to notify MuleSoft of any updates, and let MuleSoft transform and push these changes to the ERP system.

I drew a quick diagram with APIs, queues, and error-handling mechanisms. Meera grilled me on edge cases, such as:

What if the ERP is down?

I explained that MuleSoft could queue the messages and retry periodically using a retry policy.

What if there’s a schema mismatch?

I suggested maintaining a mapping table in MuleSoft and using a validation step to catch errors early.

She seemed impressed but asked a follow-up: “How do you handle duplicate records?” I mentioned using Salesforce’s Duplicate Management and external IDs for deduplication.

Round 3: Collaboration with PO and PM

Time: 1 hour

This round was a role-play exercise. Two interviewers, Priya (a PM) and James (a PO), simulated a meeting to discuss a Salesforce project: building a custom app to track partner referrals.

They wanted to know:

1. How would you gather requirements?

I said I’d start with discovery workshops, interviewing stakeholders to understand pain points, and documenting requirements as user stories with clear acceptance criteria.

2. How do you handle scope creep?

I explained how I’d negotiate priorities, using Agile sprints to deliver incremental value while keeping an eye on the big picture.

3. What’s your approach to working with non-technical stakeholders?

I shared an example of how I use visuals, like wireframes and process flows, to simplify complex ideas.

They ended with a curveball: “What if the feature doesn’t work as expected during UAT?”

I said I’d:

• Analyze the feedback to pinpoint the issue.

• Prioritize fixes based on impact.

• Communicate timelines transparently.

Round 4: Salesforce Testing (JMeter, Postman, and Apex)

Time: 1 hour

The final round was technical but focused on testing. The interviewer, Vikram, walked me through three scenarios.

Scenario 1: Load Testing

Using JMeter, simulate 1,000 simultaneous API calls to Salesforce’s lead creation endpoint.

• I explained how I’d configure JMeter to send bulk requests and monitor response times for bottlenecks.

Scenario 2: API Testing with Postman

He asked me to test the ContactDataAPI service (from Round 1) using Postman.

• I set up the API call, added headers for the API key, and tested different scenarios (valid/invalid keys, missing fields). Vikram asked how I’d automate this, and I mentioned Postman Collections with Newman for CI/CD.

Scenario 3: Apex Unit Tests

He shared an Apex class for opportunity discount calculations and asked me to write test methods.

I quickly wrote:

@IsTest

public class OpportunityDiscountTest {

    @IsTest

    static void testCalculateDiscount() {

        Opportunity opp = new Opportunity(Name=’Test’, Amount=2000, StageName=’Prospecting’, CloseDate=Date.today());

        insert opp;

        Decimal discount = OpportunityDiscount.calculateDiscount(opp.Id);

        System.assertEquals(200, discount, ‘Discount should be 10% of the amount’);

    }

}

The Outcome

By the end of the day, I was exhausted but hopeful. I felt good about my performance, especially in the coding and design rounds. The testing round was a bit nerve-wracking, but I managed to answer most questions.

Drama: The wait was nerve-wracking. Days felt like weeks, but when I finally got the offer email, I knew all the effort had been worth it. Amazon had a fantastic package, and the role seemed like the perfect fit for my skills. 🎉

Leave a comment