Salesforce Coding Round Questions 2026: Patterns + Code
Sourced from public job listings; aggregated by PapersAdda. Snapshot for editorial context, not an offer count. Parent: salesforce.
| Role | CTC |
|---|---|
| AMTS / MTS (New Grad)[1] | ₹32 LPA–₹42 LPA |
| SMTS[2] | ₹50 LPA–₹70 LPA |
Sources
- [1]Salesforce Hyderabad 2026
- [2]levels.fyi 2026
Bands aggregated from publicly disclosed JLs + verified Reddit/LinkedIn offer threads. PapersAdda does not republish private offer letters; ranges are editorial estimates.
- 1
Online Assessment
OA90 minMedium- •DSA (2)
- •CS MCQs
- •Apex/Lightning fragments
- 2
Coding Round
Coding60 minHard- •1 hard DSA
- •Discuss complexity
- 3
Technical Deep Dive
Tech60 minMedium- •Project + system design lite
- •Distributed system trade-offs
- 4
HM + Values
HM60 minMedium- •Why Salesforce
- •Ohana culture
- •Project ownership
Loop reconstructed from publicly shared candidate threads (r/developersIndia, LinkedIn). PapersAdda does not republish private question banks; rounds describe structure and difficulty, not specific problems.

What changed in 2026 drives
Salesforce Hyderabad expanded MTS hiring in 2025; AMTS / MTS New Grad band sits at ₹32-42L for 2026 batch. The interview loop is technically demanding - Round 2 is a hard DSA, Round 3 mixes system design with project deep-dive. Apex / Lightning fragments now appear in OA (added 2024) but are not mandatory for SDE roles.
What I'd actually study for Salesforce
- 01DSA - 1 hard problem in Round 2; tree / graph / DP at LeetCode hard level
- 02System design lite - Round 3 covers distributed systems trade-offs; scope is smaller than Microsoft / Amazon equivalents
- 03Project ownership - Salesforce interviewers focus heavily on what YOU built vs what the team built
- 04Ohana / values - HM round is values-fit screening; rehearse 'why Salesforce' with specific Trailblazer / Ohana references
Where most candidates trip up
Coming with weak project-ownership stories. Salesforce hires for ownership, and HM round will go deep on 'who decided X', 'who reviewed Y', 'when did you push back'. Vague 'we built it together' answers fail this round.
Editorial commentary by Aditya Sharma · written for PapersAdda · not generated, not aggregated. For the full source dataset behind these notes, see our methodology.
Quick answer (updated 8 June 2026): Salesforce's coding rounds in 2026 focus on core DSA, arrays and strings, hashing, trees, graphs, and dynamic programming, at medium difficulty, with clear communication and clean code valued over speed. For some roles an object-oriented design problem appears. The patterns and frequencies below are compiled from 2023 to 2025 candidate reports, not an official syllabus, so use them to prioritise and confirm specifics in your assessment invite from the Salesforce careers portal.
Salesforce coding rounds reward correct, well-explained, clean solutions and the ability to model a problem in objects. This guide gives you the repeating DSA patterns, worked solutions, and an object-oriented design primer.
Salesforce Coding Round Topics
Compiled from candidate reports across 2023 to 2025; relative frequency, not an official syllabus:
| Topic | Frequency | Typical problems |
|---|---|---|
| Arrays and strings | High | Two-pointer, sliding window, parsing |
| Hashing | High | Frequency, grouping, lookups |
| Trees | Medium-high | Traversal, BST operations, path sums |
| Graphs | Medium | BFS/DFS, connectivity |
| Dynamic programming | Medium | Subsequence, counting |
| Object-oriented design (some roles) | Medium | Class modelling for scenarios |
Relative frequencies from candidate aggregates (2023 to 2025), labelled approximate. Arrays, strings, hashing, and trees are the safest priorities.
Worked Solution 1: Hashing
Problem: Given an array, return the indices of the two numbers that add up to a target.
Approach: Single-pass hash map. For each number, check whether its complement (target minus number) has already been seen.
def two_sum(nums, target):
seen = {}
for i, x in enumerate(nums):
if target - x in seen:
return [seen[target - x], i]
seen[x] = i
return []
Complexity: O(n) time, O(n) space. The naive double loop is O(n squared); the hash map trade of space for time is the expected answer.
Worked Solution 2: Trees (BST)
Problem: Validate whether a binary tree is a valid binary search tree.
Approach: Recursive bounds checking. Each node must lie within an open range that tightens as you descend left or right.
def is_valid_bst(root, low=float('-inf'), high=float('inf')):
if not root:
return True
if not (low < root.val < high):
return False
return (is_valid_bst(root.left, low, root.val) and
is_valid_bst(root.right, root.val, high))
Complexity: O(n) time, O(h) recursion stack. The common bug is only comparing a node to its immediate children; the range-passing approach is what makes it correct.
Worked Solution 3: Strings (Sliding Window)
Problem: Find the length of the longest substring without repeating characters.
Approach: Sliding window with a last-seen index map; jump the left boundary past any repeat.
def length_of_longest_substring(s):
last = {}
left = 0
best = 0
for right, ch in enumerate(s):
if ch in last and last[ch] >= left:
left = last[ch] + 1
last[ch] = right
best = max(best, right - left + 1)
return best
Complexity: O(n) time, O(min(n, charset)) space. The last-seen-index variant is a cleaner one-pass version than removing characters one at a time.
Worked Solution 4: Graphs
Problem: Given an undirected graph, count the number of connected components.
Approach: Union-Find (disjoint set) or DFS. Here is the Union-Find version.
def count_components(n, edges):
parent = list(range(n))
def find(x):
while parent[x] != x:
parent[x] = parent[parent[x]]
x = parent[x]
return x
def union(a, b):
parent[find(a)] = find(b)
for a, b in edges:
union(a, b)
return len({find(i) for i in range(n)})
Complexity: Near O(n + e) with path compression. Union-Find is a strong tool to know; Salesforce graph problems often reduce to connectivity.
Worked Solution 5: Dynamic Programming
Problem: Given coin denominations and a target, count the number of distinct ways to make the amount.
Approach: Unbounded-knapsack-style DP. Iterate coins on the outer loop to count combinations (not permutations).
def coin_change_ways(coins, amount):
dp = [0] * (amount + 1)
dp[0] = 1
for c in coins:
for a in range(c, amount + 1):
dp[a] += dp[a - c]
return dp[amount]
Complexity: O(amount times number of coins) time, O(amount) space. The coin-outer ordering is the subtle point: swap the loops and you count permutations instead, a classic interview trap.
Object-Oriented Design Primer
For roles that include an OOD round, you might be asked to model something like a deck of cards, a vending machine, or a simple booking system. A clean approach:
- Clarify requirements. What operations must the system support?
- Identify entities. Nouns become classes; actions become methods.
- Define relationships. Composition, inheritance, interfaces where appropriate.
- Apply SOLID. Single responsibility, open-closed, and so on, so the design extends cleanly.
- Handle edge cases. Invalid operations, empty states, concurrency if relevant.
Practise three or four such designs out loud, sketching class diagrams, so you can model fluently under interview pressure.
How to Prepare for Salesforce Coding Rounds
- Drill arrays, strings, hashing, trees, graphs, and DP until automatic.
- Practise narrating your approach and stating complexity, since Salesforce values communication.
- If your role includes OOD, practise modelling three or four scenarios end to end.
- Be ready to explain your resume projects in technical depth.
See Salesforce interview process 2026 for the full loop.
How to Communicate in Salesforce Coding Rounds
Salesforce coding rounds reward clear communication and clean code as much as a correct answer, so how you conduct the round matters. The interviewers want to see your thought process, not just your final solution, which means the worst thing you can do is solve silently and present finished code at the end. Treat the round as a collaboration where you think out loud from the first minute.
A reliable structure is to restate the problem and clarify assumptions first, the input ranges, whether the input can be empty, what to return when there is no valid answer. Then state your approach before coding, including the brute force if that is your starting point, along with its time and space complexity, and explain how you will improve it. As you code, narrate what each section does, and when you finish, dry-run on a small example to catch your own bugs before the interviewer does. If a design question comes up, walk through your class model out loud, clarifying requirements, naming entities, and reasoning about extensibility, rather than silently sketching.
This communication discipline is especially important at Salesforce because its culture genuinely values collaboration and clarity, traits that show up in how you handle a coding round, not only in the dedicated values interview. A candidate who explains trade-offs clearly, responds well to a hint, and writes readable, well-named code signals that they would communicate well on a team. Practising out loud, ideally in mock interviews, is therefore one of the highest-leverage things you can do, because it improves the exact dimension Salesforce scores beyond raw correctness.
More Worked Solutions
Worked Solution 6: Merge Intervals
Sort by start, merge overlaps.
def merge(intervals):
intervals.sort(key=lambda x: x[0])
out = []
for s, e in intervals:
if out and s <= out[-1][1]:
out[-1][1] = max(out[-1][1], e)
else:
out.append([s, e])
return out
Time O(n log n), space O(n).
Worked Solution 7: Level Order Traversal (BFS)
Group tree nodes by level with a queue.
from collections import deque
def level_order(root):
if not root:
return []
out, q = [], deque([root])
while q:
level = []
for _ in range(len(q)):
n = q.popleft()
level.append(n.val)
if n.left: q.append(n.left)
if n.right: q.append(n.right)
out.append(level)
return out
Time O(n).
Worked Solution 8: Object-Oriented Design, a Vending Machine (OOD)
A representative Salesforce OOD prompt. Model Product, Inventory, and a VendingMachine with states (idle, collecting payment, dispensing) and methods to select a product, accept payment, and dispense with change. Use an enum for states and discuss how you would add new products or payment types. Interviewers score clean modelling, valid state transitions, and extensibility.
Pattern and Complexity Reference
A practical way to prepare for Salesforce coding rounds is to internalise the small set of patterns that recur and the complexity each implies, so you reach for the right tool the moment you recognise a problem. For arrays and strings, the two-pointer and sliding-window techniques solve most subarray and substring problems in linear time, replacing a naive O(n squared) scan. For lookups, frequency counts, and grouping, a hash map gives O(1) average access and turns many quadratic problems linear at the cost of O(n) space, which is exactly the trade Salesforce expects you to make and to explain.
For trees, recursion is the default: most problems reduce to solving for the children and combining, in O(n) time and O(h) stack space. Breadth-first search with a queue handles level-order problems, and the binary-search-tree ordering enables clean O(h) solutions for lookups, validation, and lowest-common-ancestor. For graphs, BFS and DFS cover traversal and connectivity, and union-find is a strong tool when the problem reduces to grouping connected elements. For optimisation and counting problems with overlapping subproblems, dynamic programming applies, and many one-dimensional DPs reduce from O(n) space to O(1) with rolling variables.
Knowing the expected complexity also lets you read the constraints as hints. If the input can be large, an O(n squared) approach will likely be too slow and you should aim for O(n log n) or better; if it is small, a simpler approach may suffice. For OOD-inclusive roles, the analogous skill is recognising the right modelling pattern, identifying entities, applying SOLID principles, and using a strategy or state pattern when behaviour varies. Training yourself to map a problem to its pattern and state the complexity before coding is one of the highest-leverage habits for any coding round, and it pairs naturally with the clear communication Salesforce rewards.
Why Candidates Lose Marks in the Salesforce Coding Round
Candidate reports point to recurring reasons strong candidates underperform:
- Coding in silence. Salesforce values communication; not narrating your approach loses signal.
- Skipping object-oriented design. For OOD-inclusive roles, an unstructured class model reads poorly.
- Ignoring edge cases. Empty input, single element, and duplicates are common hidden tests.
- Undefendable projects. Listing work you cannot explain in depth backfires.
- Cleverness over clarity. Salesforce prefers clean, readable solutions over obscure one-liners.
Preparation Timeline (6 to 8 Weeks)
- Weeks 1 to 2: Foundations. Arrays, strings, hashing, solved out loud with stated complexity.
- Weeks 3 to 4: Core DSA. Trees, graphs, and DP, plus object-oriented design practice for relevant roles.
- Weeks 5 to 6: OOD and projects. Model two or three scenarios (deck of cards, vending machine) and review resume projects.
- Weeks 7 to 8: Mocks. Timed mock coding interviews narrating out loud, plus values-aligned STAR stories for the behavioural round.
Related Resources
- Salesforce interview process 2026, the full round-by-round loop
- Salesforce placement papers 2026, solved past-drive papers
- Salesforce India placement papers 2026, India-specific solved papers
- System design interview questions freshers 2026, design fundamentals
- 7-day coding round crash plan 2026, last-week prep
- Off campus placement guide 2026, the master off-campus guide
FAQs: Salesforce Coding Round Questions 2026
Q: What topics does Salesforce focus on in coding rounds?
Arrays and strings, hashing, trees, graphs, and dynamic programming appear most in candidate reports, with object-oriented design for some roles. Prioritise the high-frequency DSA topics first.
Q: How hard are Salesforce coding questions?
Candidate reports place them at mostly medium difficulty, with clean code and clear explanation valued over raw speed or extreme difficulty. Communicate your approach and complexity throughout.
Q: Does Salesforce ask object-oriented design questions?
For some roles, yes. Candidate reports mention OOD problems like modelling a deck of cards or a vending machine. Practise clarifying requirements, identifying entities, and applying SOLID principles.
Q: What language should I use in the Salesforce coding round?
Use the language you are most fluent in, commonly Java, C++, or Python. The interviewer cares about correctness, complexity, and clarity, not which language you choose.
Q: How important is communication in Salesforce coding rounds?
Important. Salesforce values clear communication, narrating your approach, stating complexity, and self-testing. Silent coding loses signal even when the final solution is correct.
Q: Should I prepare behavioural answers along with coding for Salesforce?
Yes. Salesforce weights its core values heavily in dedicated behavioural rounds. Prepare STAR stories on trust, customer success, and collaboration alongside your coding practice.
Q: How do I make my code readable for Salesforce?
Use clear, descriptive names, keep functions short and focused, and structure your solution so the interviewer can follow it without explanation. Salesforce values clean, readable code over clever one-liners, so favour clarity and add a quick mental test as you go.
Q: What design patterns help in Salesforce OOD rounds?
For OOD prompts, the strategy pattern (varying behaviour like split or pricing logic), the state pattern (modelling state transitions in a vending machine or order), and clean use of interfaces all help. Focus on clarifying requirements, identifying entities, and applying SOLID principles rather than forcing patterns.
Q: How do I read constraints to choose my approach at Salesforce?
Large input sizes signal you need a sub-quadratic solution, a hash map, two-pointer, or sliding window, while small inputs may permit a simpler approach. Reading the constraints before coding and stating your target complexity is a habit Salesforce interviewers reward.
Methodology applied to this articlelast verified 8 Jun 2026
- No fabricated salary numbers or success rates. If we quote a range, it's sourced.
- No noun-substituted templates. This article was not generated by swapping company names in a stock prompt.
- No paid placements, sponsored coaching links, or affiliate-shilled course pushes.
Explore this topic cluster
More resources in Guides & Resources
Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.
Start with the pillar guide: Salesforce Interview Process 2026: Rounds + Prep Plan — the complete, source-anchored reference for this cluster.
Company hub
Explore all Salesforce resources
Open the Salesforce hub to jump between placement papers, interview questions, salary guides, and other related pages in one place.
Open Salesforce hubPaid contributor programme
Sat Salesforce this year? Share your story, earn ₹500.
First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story - with byline.
Submit your story →Ready to practice?
Take a free timed mock test
Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.
Start Free Mock Test →Related Articles
Salesforce Interview Process 2026: Rounds + Prep Plan
Quick answer (updated 8 June 2026): Salesforce's fresher and new-grad software hiring in 2026 typically runs an online...
Salesforce Placement Papers 2026 | Previous Year Questions, Syllabus & Hiring Process
_Last verified by [Aditya Sharma](/author/aditya-sharma/) · cross-checked against PapersAdda Hiring Pulse and...
2026 14-Day Aptitude Plan To Clear Services Cutoffs
This 14 day aptitude preparation plan is for freshers who are 2 weeks away from an aptitude-gated drive and do not have time...
30 DAY Placement Preparation Plan
Have a placement drive coming up in 30 days? Don't worry, this day-by-day plan will help you maximize your preparation in...
7-Day Coding Round Plan 2026: Clear OA With Daily Pattern Drills
Your highest-leverage move in the final week is not a 30-day DSA roadmap. It is one pattern per day, 6-8 problems per day,...
More from PapersAdda
Dynamic Programming Patterns 2026: 8 Core Patterns [20+ Problems Solved]
React Coding Questions with Solutions 2026, 25 Machine-Round Problems
TCS NQT 2026 Coding Section: 2-Q Format + Past Problems
Accenture Coding Assessment 2026: 2 Problems, 45 Minutes, The Silent Filter