# Salesforce Interview Experience | On-Campus for Internship 2020

• Difficulty Level : Medium
• Last Updated : 01 Nov, 2019

Salesforce recently visited our campus for internship recruitment.
Here’s my interview experience:

Online Coding Round:
Coding round consisted of 3 question which were of each with increasing difficulty.
Q1) Given an array of integers, and a number ‘sum’, find the number of pairs of integers in the array whose sum is equal to ‘sum’.
Q2) Given a String s, find the number of substrings when converted to integer gives you a prime number. Also given that all prime numbers generated should be less than 10^6.
constraint- len(s)<=10^8
Q3) Given a string S and a pattern k, you need to find the shortest length sub-sequence of S which contains all the character of pattern. And also the string is cyclic in which you can come back to the starting position when you have reached the end in cycling order.
solution:
You just need to find the pattern k in s+s(write s two times as repetition allowed for cyclic case). O(n) solution required using sliding windows algorithm.

Round 1:
He asked one puzzle : https://www.mathsisfun.com/puzzles/breaking-up-a-chocolate-bar.html
He then told a situation, suppose you are working on a project and you want the design to be different than the one told by the seniors, because you think its better, but the seniors want it their way, how would you approach with your idea?

We had to wait for the results and around 9 students got shortlisted for the next round.

Round 2:

Interview started with introductions.This was a longer round than the previous.She asked a lot of questions about OOP(polymorphism, inheritance, etc), DBMS, Operating system, scalability, projects in detail.She also asked a simple question about compound interest.She also asked what all data structure and algorithms I know.She then asked me a puzzle, given a cake you need to cut the cake in 8 parts, 3 cuts to cut the round cake into 8 equal pieces(you can google the answer).

I came out and was asked to go for the next round, where 6 students got selected for the next round.

Round 3:

This round was taken by a Senior Manager.