Salesforce DSA rounds draw from stacks and design problems, sliding windows over strings and arrays, tree traversals, and matrix/graph problems — with interviewers frequently pushing candidates past a first working solution toward an optimal, O(1)-or-tighter one. The three problems below are real, recently reported (2025–2026) Salesforce questions with full solutions.
Design a stack that supports push, pop, top, and retrieving the maximum element, all in O(1) time.
Input: push(5), push(1), push(5), top() -> 5, popMax() -> 5, top() -> 1, peekMax() -> 5, pop() -> 1, top() -> 5
Output: as shown
A second stack tracking running maxima keeps peekMax O(1); popMax needs a bit more care to stay O(1) with an auxiliary doubly linked list.
Given a string, find the length of the longest substring that contains no repeating characters.
Input: s = "abcabcbb"
Output: 3
The answer is 'abc', with length 3.
- Be precise about the space complexity: it's bounded by the fixed character set size (e.g. 128 for ASCII), not the input length — interviewers specifically probe this distinction.
Given the heads of two singly linked lists, return the node at which the two lists intersect, or null if they don't intersect.
Input: listA = [4,1,8,4,5], listB = [5,6,1,8,4,5] (sharing tail node 8)
Output: Node with value 8
More DSA questions Salesforce has asked recently
These topics were reported in verified 2025–2026 Salesforce loops. Full problem statements, solutions and explanations for these are part of the Placement-Ready PYQ Kit.
5 more verified DSA questions with full solutions in the full Placement-Ready PYQ Kit
Includes every round they were asked in, from the online assessment through the technical interview.

