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

SDE - Intern

Salesforce
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Journey
I was not good at coding at the start of my carier but i practice a lot of question from code studio which helps me to excel in my life and also helped me in coding exam.
Application story
This company visited our campus for to hire for the FTE. From there i have applied for this job apportunty.
Why selected/rejected for the role?
I was rejected because i was not able to give a proper explanation for the question which are asked.
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practise 5 problems daily from websites like hackerrank, codechef, codeforces
Tip 2 : Participate in codechef, codeforces contest.
Tip 3 : Attend mock interviews and should have good communication skills

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Maintain atleast 2 different projects, write powerful summary statement.
Tip 2 : Maintain skills relevant to job description, include relevant experience.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date22 Jan 2022
Coding problem2

1. Min Steps to one

Easy
15m average time
90% success
0/40
Asked in companies
IBMAmazonSprinklr

You are given a positive integer 'N’. Your task is to find and return the minimum number of steps that 'N' has to take to get reduced to 1.

You can perform any one of the following 3 steps:

1) Subtract 1 from it. (n = n - ­1) ,
2) If n is divisible by 2, divide by 2.( if n % 2 == 0, then n = n / 2 ) ,
3) If n is divisible by 3, divide by 3. (if n % 3 == 0, then n = n / 3 ).

For example:

Given:
‘N’ = 4, it will take 2 steps to reduce it to 1, i.e., first divide it by 2 giving 2 and then subtract 1, giving 1.
Problem approach

You are given a positive integer 'N’. Your task is to find and return the minimum number of steps that 'N' has to take to get reduced to 1.

Try solving now

2. All Prime Numbers less than or equal to N

Moderate
10m average time
90% success
0/80
Asked in companies
OptumIBMAmazon

You are given a positive integer 'N'. Your task is to return all the prime numbers less than or equal to the 'N'.

Note:

1) A prime number is a number that has only two factors: 1 and the number itself.

2) 1 is not a prime number.
Problem approach

You are given a positive integer 'N'. Your task is to return all the prime numbers less than or equal to the 'N'.

Try solving now
02
Round
Hard
Video Call
Duration60 minutes
Interview date22 Jan 2022
Coding problem1

1. Shortest alternate colored path

Moderate
20m average time
80% success
0/80
Asked in companies
HSBCGrabGoogle inc

Consider a directed graph of ‘N’ nodes where each node is labeled from ‘0’ to ‘N - 1’. Each edge of the graph is either ‘red’ or ‘blue’ colored. The graph may contain self-edges or parallel edges. You are given two arrays, ‘redEdges’ and ‘blueEdges’, whose each element is of the form [i, j], denoting an edge from node ‘i’ to node ‘j’ of the respective color.

Your task is to compute an array ‘answer’ of size ‘N’, where ‘answer[i]’ stores the length of the shortest path from node ‘0’ to node ‘i’ such that the edges along the path have alternate colors. If there is no such path from node ‘0’ to ‘i’, then ‘answer[i] = -1’.

Example:
N = 4, redEdges = [[0, 1], [2, 3]], blueEdges = [[1, 2], [1, 3]]

example

The shortest paths for each node from node ‘0’ are:
1: 0->1         Length: 1
2: 0->1->2      Length: 2
3: 0->1->3      Length: 2
So, the ‘answer’ array will be: [0, 1, 2, 2].
Note:
1. The given graph could be a disconnected graph.

2. Any two nodes ‘i’ and ‘j’ can have at most one red edge from ‘i’ to ‘j’ and at most one blue edge from ‘i’ to ‘j’.
Problem approach

Consider a directed graph of ‘N’ nodes where each node is labeled from ‘0’ to ‘N - 1’. Each edge of the graph is either ‘red’ or ‘blue’ colored. The graph may contain self-edges or parallel edges. You are given two arrays, ‘redEdges’ and ‘blueEdges’, whose each element is of the form [i, j], denoting an edge from node ‘i’ to node ‘j’ of the respective color.
Your task is to compute an array ‘answer’ of size ‘N’, where ‘answer[i]’ stores the length of the shortest path from node ‘0’ to node ‘i’ such that the edges along the path have alternate colors. If there is no such path from node ‘0’ to ‘i’, then ‘answer[i] = -1’.

Try solving now

Here's your problem of the day

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

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Salesforce
2493 views
1 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 9 problems
Interviewed by Salesforce
1978 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 2 problems
Interviewed by Salesforce
0 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Salesforce
1072 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15605 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15499 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10216 views
2 comments
0 upvotes