Salesforce SMTS Interview

salesforce logo
salesforce
MTS II
January 16, 202536 reads

Summary

I interviewed for an SMTS role at Salesforce, which involved an online assessment followed by two coding rounds. The assessment and rounds featured a mix of standard LeetCode problems covering dynamic programming, tree data structures, and string manipulation, along with a custom sliding window problem.

Full Experience

My interview journey for the SMTS position at Salesforce began with an Online Assessment. The OA included the LeetCode problem 'Distinct Subsequences', and another medium-difficulty question whose specifics I couldn't recall. Following the OA, I had two distinct coding rounds.

In the first coding round, I was presented with the LeetCode problem 'Construct Quad Tree'. Additionally, there was a custom question that involved a sliding window technique. This problem required me to process a 2D list of person IDs and their card swipe times, determining the maximum number of swipes made by any single person within a specific time window.

The second coding round focused on more advanced data structure challenges. I was asked to solve 'Binary Tree Maximum Path Sum' and 'Encode and Decode Strings', both well-known problems from LeetCode.

Interview Questions (5)

Q1
Distinct Subsequences
Data Structures & AlgorithmsHard

Given two strings s and t, return the number of distinct subsequences of s which equals t. The test cases are generated so that the answer fits on a 32-bit signed integer.

Q2
Construct Quad Tree
Data Structures & AlgorithmsMedium

Given an n * n grid of 1s and 0s, construct a quad tree representation of the grid. A quad tree is a tree data structure in which each internal node has exactly four children. Quad trees are most often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions.

Q3
Max Card Swipes by Person in Window
Data Structures & AlgorithmsMedium

I was given a 2D list containing person IDs and their card swipe times in HHMM format, for example: [ ["d","0002"], ["e","0215"],["c","0808"], ["c","0809"], ["c","0829"], ["c","0850"],["c","0855"],["d","1410"],["d","1444"],["d","1508"],["d","1602"],]. The task was to identify and return the maximum number of swipes made by any single person within a specified time window (e.g., a 60-minute interval).

Q4
Binary Tree Maximum Path Sum
Data Structures & AlgorithmsHard

A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. The path does not necessarily need to pass through the root. Given the root of a binary tree, return the maximum path sum of any non-empty path.

Q5
Encode and Decode Strings
Data Structures & AlgorithmsMedium

Design an algorithm to encode a list of strings to a single string. The encoded string is then decoded back to the original list of strings. The problem statement usually implies the need for a robust method to handle special characters and an arbitrary number of strings.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!