Salesforce interview experience Real time questions & tips from candidates to crack your interview

AMTS

Salesforce
upvote
share-icon
2 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
My interview journey with Salesforce was a valuable learning experience. I started my preparation by strengthening my fundamentals in Data Structures, Algorithms, DBMS, and Operating Systems, while also practicing coding problems regularly. This helped me clear the initial screening round. In the second round, the focus shifted toward system design, which exposed some gaps in my preparation. Although I was not able to move forward after that round, the experience helped me understand the importance of structured problem-solving and system design concepts. It also motivated me to prepare more deeply for future product-based company interviews.
Application story
I applied for the opportunity at Salesforce through an off-campus hiring drive by submitting my application online via their careers portal. After applying, I received an invitation for the initial assessment round. Candidates who cleared the assessment were shortlisted for the interview rounds. The overall process consisted of multiple stages, including screening and technical interviews, and communication regarding each stage was shared via email. The entire process was smooth and professionally managed.
Why selected/rejected for the role?
I was able to clear the initial stages of the process at Salesforce, but I was rejected in the later stage because the interview focused heavily on system design concepts. My preparation at that time was more focused on DSA and core subjects, so I realized that I needed a deeper understanding and more practice in system design to perform better in such interviews.
Preparation
Duration: 15 Months
Topics: Data Structures, Algorithms, Object-Oriented Programming (OOP), Database Management Systems (DBMS), Operating Systems (OS), System Design, Computer Networks, SQL
Tip
Tip

Tip 1: Practice DSA problems regularly and focus on strengthening core concepts like arrays, strings, trees, and dynamic programming.

Tip 2: Revise core subjects such as DBMS, Operating Systems, and Computer Networks thoroughly for technical interviews.

Tip 3: Prepare basic system design concepts and practice explaining solutions in a structured way during interviews.

Application process
Where: Other
Eligibility: Above 7 CPI (Salary Package: 45 LPA)
Resume Tip
Resume tip

Tip 1: Keep your resume concise and clearly highlight relevant projects, internships, and technical skills.

Tip 2: Only mention the technologies and concepts that you are confident about explaining in an interview.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration100 minutes
Interview date1 Apr 2026
Coding problem3

1. Bellman Ford

Moderate
30m average time
70% success
0/80
Asked in companies
DirectiShareChatSalesforce

You have been given a directed weighted graph of ‘N’ vertices labeled from 1 to 'N' and ‘M’ edges. Each edge connecting two nodes 'u' and 'v' has a weight 'w' denoting the distance between them.


Your task is to calculate the shortest distance of all vertices from the source vertex 'src'.


Note:
If there is no path between 'src' and 'ith' vertex, the value at 'ith' index in the answer array will be 10^8.
Example :

Alt text

3 3 1
1 2 2
1 3 2
2 3 -1

In the above graph: 

The length of the shortest path between vertex 1 and vertex 1 is 1->1 and the cost is 0.

The length of the shortest path between vertex 1 and vertex 2 is 1->2 and the cost is 2.

The length of the shortest path between vertex 1 and vertex 3 is 1->2->3 and the cost is 1.

Hence we return [0, 2, 1].

Note :

It's guaranteed that the graph doesn't contain self-loops and multiple edges. Also, the graph does not contain negative weight cycles.
Problem approach

Step 1: I first discussed the problem with the interviewer and clarified that the graph could contain negative edge weights, so algorithms like Dijkstra’s would not work correctly.

Step 2: I decided to use the Bellman-Ford algorithm, which works for graphs with negative edge weights and can also detect negative cycles.

Step 3: I initialized the distance of all nodes to infinity and set the distance of the source node to 0.

Step 4: I relaxed all edges V−1 times (where V is the number of vertices). For every edge (u, v), if dist[u] + weight < dist[v], I updated dist[v].

Step 5: After performing V−1 relaxations, I ran one more iteration over all edges to check whether any distance could still be reduced.

Step 6: If any distance was updated in this extra iteration, it meant that a negative-weight cycle existed in the graph.

Step 7: Finally, I returned the shortest distances from the source node to all other nodes or reported the presence of a negative cycle.

Try solving now

2. Min Cost Path

Moderate
25m average time
65% success
0/80
Asked in companies
OYOSalesforceSprinklr

You have been given a matrix of ‘N’ rows and ‘M’ columns filled up with integers. Find the minimum sum that can be obtained from a path which starts from the top left corner and ends with the bottom right corner.

From any cell in a row, we can move to the right, down or the down-right diagonal cell. So from a particular cell (row, col), we can move to the following three cells:

Down: (row+1,col)
Right: (row, col+1)
Down right diagonal: (row+1, col+1)
Problem approach

Step 1: I first considered solving the problem using recursion by exploring all possible paths from the starting cell.

Step 2: I realized that many subproblems were repeating, which would make the recursive solution inefficient.

Step 3: I then applied Dynamic Programming using a DP table, where dp[i][j] represents the minimum cost to reach cell (i, j).

Step 4: I initialized the first row and first column based on cumulative costs.

Step 5: For each cell, I calculated the minimum cost using:
dp[i][j] = cost[i][j] + min(dp[i-1][j], dp[i][j-1], dp[i-1][j-1]).

Step 6: The value at dp[m-1][n-1] gives the final minimum path cost.

Try solving now

3. Longest Path In Directed Graph

Moderate
30m average time
70% success
0/80
Asked in companies
SalesforceCodenationSaas labs

You are given a Weighted Directed Acyclic Graph (DAG) consisting of ‘N’ nodes and ‘E’ directed edges. Nodes are numbered from 0 to ’N’-1. You are also given a source node ‘Src’ in it. Your task is to find the longest distances from ‘Src’ to all the nodes in the given graph.

Return an array of ‘N’ integers where ‘ith’ integer gives the maximum distance of the node ‘i’ from the source node ‘Src’.

A Directed Acyclic Graph (DAG) is a directed graph that contains no cycles.

Note:

Print -1 if a node is not reachable from the given source node.

Example:

Consider the following DAG consists of 5 nodes and 7 edges,  Let the source node ‘Src’ be 0.

alt text

Then the maximum distance of node 0 from the source node 0 is 0. (the distance of a node from itself is always 0).
The maximum distance of node 1 from the source node 0 is 3. The path that gives this maximum distance is 0 -> 1.
The maximum distance of node 2 from the source node 0 is 10. The path that gives this maximum distance is 0 -> 2.
The maximum distance of node 3 from the source node 0 is 15. The path that gives this maximum distance is 0 -> 2 -> 3.
The maximum distance of node 4 from the source node 0 is 54. The path that gives this maximum distance is 0 -> 1 -> 4.

Thus we should print 0 3 10 15 54
Problem approach

Step 1: I first clarified that the graph is a DAG, which allows the use of topological ordering.

Step 2: I performed topological sorting of the graph using DFS or Kahn’s algorithm.

Step 3: I initialized all distances to negative infinity and set the source distance to 0.

Step 4: I processed the nodes in topological order and relaxed all outgoing edges.

Step 5: For each edge (u, v) with weight w, I updated:
dist[v] = max(dist[v], dist[u] + w).

Step 6: After processing all nodes, the distance array contained the longest path from the source to all other nodes.

Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date7 Apr 2026
Coding problem3

The round was conducted during the daytime in an online mode. The overall environment was professional and comfortable. The interviewer was friendly and gave me time to think through the problems. The discussion was interactive, and the interviewer encouraged me to explain my approach step by step. The focus was mainly on problem-solving and understanding my thought process while designing the solution.

1. Word Ladder

Hard
10m average time
90% success
0/120
Asked in companies
DunzoDisney + HotstarSalesforce

You are given two strings BEGIN and END and an array of strings DICT. Your task is to find the length of the shortest transformation sequence from BEGIN to END such that in every transformation you can change exactly one alphabet and the word formed after each transformation must exist in DICT.

Note:

1. If there is no possible path to change BEGIN to END then just return -1.
2. All the words have the same length and contain only lowercase english alphabets.
3. The beginning word i.e. BEGIN will always be different from the end word i.e. END (BEGIN != END).
Problem approach

Step 1: I first clarified that the task is to find all the shortest transformation sequences between the begin word and the end word.

Step 2: I converted the word list into a hash set so that lookups could be done in constant time.

Step 3: I used Breadth-First Search (BFS) starting from the begin word because BFS guarantees the shortest path in an unweighted graph.

Step 4: For each word, I generated all possible words by changing one character at a time and checked whether the new word existed in the dictionary.

Step 5: I maintained a mapping of each word to its previous words to reconstruct the shortest paths later.

Step 6: Once the end word was reached in BFS, I stopped expanding further levels and started reconstructing all paths using backtracking.

Step 7: Finally, I returned all the shortest transformation sequences obtained from the backtracking process.

Try solving now

2. Number of Islands II

Hard
45m average time
55% success
0/120
Asked in companies
UberMakeMyTripSalesforce

You have a 2D grid of ‘N’ rows and ‘M’ columns which are initially filled with water. You are given ‘Q’ queries each consisting of two integers ‘X’ and ‘Y’ and in each query operation, you have to turn the water at position (‘X’, ‘Y’) into a land. You are supposed to find the number of islands in the grid after each query.

An island is a group of lands surrounded by water horizontally, vertically, or diagonally.

Problem approach

Step 1: I first understood that land is added dynamically, and after each addition, we must calculate the number of islands.

Step 2: I used the Union-Find (Disjoint Set) data structure to efficiently manage connected components.

Step 3: Initially, the grid contained only water, and the island count was zero.

Step 4: Whenever a new land position was added, I treated it as a new island and increased the island count.

Step 5: I checked its four neighboring cells (up, down, left, right).

Step 6: If any neighbor was already land, I performed a union operation to merge the islands and reduced the island count.

Step 7: After processing the neighbors, I recorded the current island count.

Step 8: Finally, I returned the list containing the island count after each land addition.

Try solving now

3. Feed System

Design a social media feed system (like Twitter).

Design a scalable system where users can post tweets, follow other users, and view a personalized news feed containing tweets from people they follow. The system should support millions of active users, handle high read/write traffic, and provide fast feed updates.

Key Requirements:

  • Users should be able to post tweets.
  • Users can follow or unfollow other users.
  • Each user should see a news feed with recent tweets from the users they follow.
  • The system should support high scalability and low latency.
  • Ensure efficient storage and retrieval of tweets.
Problem approach

Tip 1: Start by identifying functional and non-functional requirements such as scalability, latency, and availability.

Tip 2: Design a high-level architecture including components like load balancers, API servers, databases, caching systems, and message queues.

Tip 3: Discuss optimizations like feed generation strategies (fan-out on write vs. fan-out on read), caching, database sharding, and CDN usage to handle large-scale traffic.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

Which traversal uses a queue as its primary data structure?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Salesforce
3492 views
0 comments
0 upvotes
company logo
Technical Consultant
3 rounds | 7 problems
Interviewed by Salesforce
902 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Salesforce
1198 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3868 views
0 comments
0 upvotes