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

Associate Software Engineer

Salesforce
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures, Dynamic Programming, OOPS, OS, DBMS.
Tip
Tip

Tip 1 : For fresher role, System design is not very important.
Tip 2 : Do at least 1-2 good quality projects.
 

Application process
Where: Other
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Have 1-2 good engaging projects in resume.
Tip 2 : Internships are helpful.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date8 Jan 2021
Coding problem2

Timing - flexible 12 hours window to take the test. (9AM - 9PM)
Test was proctored

1. Combination Sum

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

You have been given three numbers ‘X’, ’Y’ and ‘Z’. You have to find the sum of all the numbers formed by the combination of the digits 3, 4 and 5. You can use 3 at most ‘X’ times, 4 at most ‘Y’ times, and 5 at most ‘Z’ times as a digit in numbers.

Note:
 Output the sum modulo 10 ^ 9 + 7.
For example :
If ‘X’ = 1, ‘Y’ = 1 and ‘Z’ = 0 then the output will be 84.

Explanation : 3 + 4 + 34 + 43 = 84
Problem approach

This was a online test.
This is a standard DP question.
I solved it in Time Complexity: O(N*m)

Try solving now

2. Longest Path In Directed Graph

Moderate
30m average time
70% success
0/80
Asked in companies
Tata Consultancy Services (TCS)SalesforceCodenation

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

This is a problem of topological sorting.

Time complexity of topological sorting is O(V+E). After finding topological order, the algorithm process all vertices and for every vertex, it runs a loop for all adjacent vertices.

overall time complexity of this algorithm is O(V+E).

Try solving now
02
Round
Easy
Video Call
Duration40 minutes
Interview date27 Jan 2021
Coding problem2

Timing - 9:00 AM - 9:40 AM

1. Smallest Number With At least N Trailing Zeros In Factorial

Easy
10m average time
90% success
0/40
Asked in companies
SalesforceOYO

You are given a positive integer N. Your task is to find the smallest number whose factorial contains at least N trailing zeroes.

Example :
Let N = 1. The smallest number whose factorial contains at least 1 trailing zeroes is 5 as 5! = 120.
Problem approach

Step 1 - Trailing 0s in x! = Count of 5s in prime factors of x!
= floor(x/5) + floor(x/25) + floor(x/125) + ....
Step 2 - We can notice that, the maximum value whose factorial contain n trailing zeroes is 5*n.

Step 3 -So, to find minimum value whose factorial contains n trailing zeroes, use binary search on range from 0 to 5*n. And, find the smallest number whose factorial contains n trailing zeroes.

Try solving now

2. Reverse Linked List

Moderate
15m average time
85% success
0/80
Asked in companies
QuikrMicrosoftSAP Labs

Given a singly linked list of integers. Your task is to return the head of the reversed linked list.

For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Follow Up :
Can you solve this problem in O(N) time and O(1) space complexity?
Problem approach

We return the pointer of next node to his previous(current) node and then make the previous node as the next node of returned node and then returning the current node.
We first traverse till the last node and making the last node as the head node of reversed linked list and then applying the above procedure in the recursive manner.

Try solving now
03
Round
Easy
Video Call
Duration40 minutes
Interview date27 Jan 2021
Coding problem2

Timing - 12:00 Pm to 12:40 PM

1. Implement a priority queue

Moderate
0/80
Asked in companies
AmazonOracleOYO

You have to implement the pop function of Max Priority Queue and implement using a heap.


Functions :
a) push(int x) : 'x' has to be inserted in the priority queue. This has been implemented already

b) pop() : return the maximum element in the priority queue, if priority queue is empty then return '-1'.


Example:
We perform the following operations on an empty priority queue:

When operation push(5) is performed, we insert 1 in the priority queue.

When operation push(2) is performed, we insert 2 in the priority queue. 

When operation pop() is performed, we remove the maximum element from the priority queue and print which is 5.

When operation push(3) is performed, we insert 1 in the priority queue.

When operation pop() is performed, we remove the maximum element from the priority queue and print which is 3.
Problem approach

A typical priority queue supports the following operations:
Insertion
Deletion
top

Try solving now

2. Largest BST subtree

Easy
10m average time
90% success
0/40
Asked in companies
FlipkartSalesforceOla

You have been given a Binary Tree of 'N' nodes, where the nodes have integer values. Your task is to return the size of the largest subtree of the binary tree which is also a BST.


A binary search tree (BST) is a binary tree data structure which has the following properties.

• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.


Example:
Given binary tree:

Explanation

In the given binary tree, subtree rooted at 2 is a BST and its size is 3.
Problem approach

1) Whether the subtree itself is BST or not 
2) If the subtree is left subtree of its parent, then maximum value in it. And if it is right subtree then minimum value in it. 
3) Size of this subtree if this subtree is BST

Try solving now
04
Round
Medium
Video Call
Duration40 minutes
Interview date27 Jan 2021
Coding problem1

Timing - 6:00 PM - 6:30 PM

1. System Design Question

Design Splitwise and change 3 features that you dont like about it.

Problem approach

Tip 1: Be comfortable with all OOPS concepts.
Tip 2: They expected me to code in JAVA though I practiced DS algo in c++. So make sure you know atleast basics of java/python.

Here's your problem of the day

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

Skill covered: Programming

How many times will the loop execute? for(int i = 0; i < 5; i++)

Choose another skill to practice
Similar interview experiences
company logo
Technical Associate
2 rounds | 3 problems
Interviewed by Salesforce
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Salesforce
1142 views
0 comments
0 upvotes
company logo
MTS 1
3 rounds | 6 problems
Interviewed by Salesforce
781 views
0 comments
0 upvotes
company logo
MTS
3 rounds | 3 problems
Interviewed by Salesforce
757 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Associate Software Engineer
3 rounds | 10 problems
Interviewed by Amdocs
2100 views
0 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 4 problems
Interviewed by Amdocs
1645 views
0 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 5 problems
Interviewed by Optum
1674 views
0 comments
0 upvotes