Explore questions associated with Salesforce. Review the source details, then use the workspace for code, notes, and diagrams.
83 questions in the library. A source association does not guarantee a future interview question.
Behavioral and leadership · Coding · Machine learning · Object-oriented design · System design
Loading questions…
Showing 51–75
The interviewer focused on a conflict that comes from different perspectives or ideas on how to execute a certain task.
Companies: Salesforce, Adyen, Amazon, Capital One +18
Last reported Jun 2025
Given a DAG of course prerequisites where each course has a duration and any number of courses can run in parallel once prerequisites are satisfied…
Companies: Salesforce, Google, Meta, Modular +1
Array · Directed Acyclic Graph · Dynamic Programming · Graph Theory
Last reported May 2025
Count the number of distinct non-empty palindromic subsequences in a string (n ≤ 1000, alphabet {a,b,c,d}), returning the result modulo 1e9+7. The core challenge is…
Companies: Salesforce
Last reported May 2025
Given a grid maze where a ball, once rolled, continues in a direction until it hits a wall, determine whether the ball can reach and…
Companies: Salesforce, Meta
Last reported May 2025
Given a binary tree and a start node, compute how many minutes it takes for an infection that spreads each minute to adjacent nodes (parent/children)…
Companies: Salesforce, Microsoft
Binary Tree · Breadth-First Search · Depth-First Search · Hash Table
Compute the positions of the clock's hour and minute hands (noting the hour hand moves continuously with minutes) and return the smaller angular difference between…
Companies: Salesforce, Microsoft, Zoho
Math
Given signed integers for asteroid sizes and directions, determine which asteroids remain after sequential collisions where only opposite-moving neighbors (positive then…
Companies: Salesforce, Amazon, D. E. Shaw, JPMorgan Chase +2
Array · Simulation · Stack
Count the number of contiguous substrings that consist only of vowels and contain all five vowels (a, e, i, o, u) at least once. The…
Companies: Salesforce, D. E. Shaw, Expedia, Snowflake
Hash Table · String
Given courses as nodes and prerequisite pairs as directed edges, determine whether the directed graph is acyclic — return true if a topological ordering exists…
Companies: Salesforce, Amazon, Anduril, Cloudflare +6
Breadth-First Search · Depth-First Search · Directed Acyclic Graph · Graph Theory
Given numCourses and prerequisite pairs, return any ordering of courses that satisfies all prerequisites or an empty array if impossible — this is essentially computing…
Companies: Salesforce, Amazon, Anduril, Apple +11
Breadth-First Search · Depth-First Search · Graph Theory · Topological Sort
Given an undirected graph, return for every vertex the shortest distance to the nearest vertex that lies on any cycle. Key idea: identify cycle vertices…
Companies: Salesforce
Breadth-First Search · Depth-First Search · Graph Theory · Topological Sort
Companies: Salesforce
ML Fundamentals · Model Evaluation
Given an array of fruit types where you can pick from a contiguous sequence while carrying at most two distinct types (two baskets), return the…
Companies: Salesforce, Adobe, Amazon, Meta
Array · Hash Table · Sliding Window
Given an array where nums[i] is the maximum forward jump from index i, compute the minimum number of jumps needed to reach the last index…
Companies: Salesforce, Amazon, Flipkart
Array · Dynamic Programming · Greedy
Given an array of stone weights, repeatedly take the two heaviest stones, remove them, and if their weights differ push back the difference; return the…
Companies: Salesforce, Apple
Array · Heap (Priority Queue)
Given a list of meeting time intervals, determine the minimum number of conference rooms required so that no meetings overlap. The core challenge is computing…
Companies: Salesforce, Amazon, Apple, Google +9
Array · Greedy · Heap (Priority Queue) · Prefix Sum
Companies: Salesforce, Amazon, Meta, NVIDIA +3
Divide and Conquer · Heap (Priority Queue) · Linked List · Merge Sort
Given a directed graph whose underlying undirected graph is a tree, compute for every node the minimum number of edge reversals required so that starting…
Companies: Salesforce, Microsoft, Uber
Breadth-First Search · Depth-First Search · Dynamic Programming · Graph Theory
Given n, you may add or subtract any power of two per operation; find the minimum number of such operations to reach 0. The core…
Companies: Salesforce, Uber
Bit Manipulation · Dynamic Programming · Greedy
Given nums and k, remove the fewest elements so the remaining array has max ≤ k * min. Equivalently, find the largest subset of numbers…
Companies: Salesforce
Array · Binary Search · Sliding Window · Sorting
Given an integer array where you may replace any element with two positive integers summing to it, find the minimum number of such split operations…
Companies: Salesforce
Array · Greedy · Math
Given a list of money transfers among people, compute the minimum number of transactions required to settle all debts so every person's net balance becomes…
Companies: Salesforce, Pinterest, Visa
Array · Backtracking · Bit Manipulation · Bitmask
Partition the input string s into substrings so that every substring is a palindrome, and return all possible such partitions. This is typically solved by…
Companies: Salesforce
Backtracking · Dynamic Programming · String
Partition the 2n integers into two equal-sized groups (choose n elements for one group) to minimize the absolute difference of their sums — a constrained…
Companies: Salesforce
Array · Binary Search · Bit Manipulation · Bitmask