How I Passed the Salesforce HackerRank Assessment in 2026
Quick Facts
| Time limit | 75 minutes (most common) |
| Questions | 2 coding problems |
| Platform | HackerRank |
| Proctoring | Camera + microphone ON and recorded |
| Languages | No restriction (C, C++, Java, Python, etc.) |
| Scoring | Functionality, design, scalability, code quality (4-tier) |
When Salesforce recruiting sent the HackerRank link, I had maybe 150 LeetCode problems done and zero insider knowledge. The invite said 75 minutes, camera on, two coding questions. I spent the next three days reading every forum thread and cross-referencing what people reported seeing.
The array and graph problems in those threads looked harder than typical LeetCode mediums. I ran the question patterns through an AI interview assistant before my slot to test-run the recurring problem types. That prep surfaced edge cases I would have missed and clarified where to focus in the final hours.
This article covers my exact test questions, Salesforce's HackerRank proctoring, and the scoring system most candidates learn about too late. Everything here draws from my own 2026 test experience, confirmed against reports from recent candidates who shared their outcomes publicly.
The Real Questions on My Salesforce HackerRank Test
I applied for a general software engineer role at Salesforce in early 2026. The invite email came with a HackerRank link, a 75-minute timer, and a note that my camera and microphone would be on the whole time. Here are the two questions that appeared on my screen.
Question 1: Smallest Subarray With K Distinct Integers

The problem I got: Given an array of integers and an integer k, return the length of the shortest contiguous subarray that contains exactly k distinct integers. If no such subarray exists, return -1.
So for arr = [1, 2, 2, 3, 1, 3] and k = 2, the answer is 2, because [2, 2] has exactly one distinct integer (not enough), [2, 3] has two distinct integers and length 2, and [3, 1] also has length 2. No subarray shorter than 2 has exactly 2 distinct integers.
My approach: I recognized this as a sliding window problem right away. The tricky part is that we need exactly k distinct integers, not at most k. I knew the standard pattern: when the window has exactly k distinct elements, record its length. When it exceeds k, shrink from the left until we drop back to k. When it drops below k, expand from the right.
The key insight: I maintain two sliding windows simultaneously. One window tracks the smallest rightmost index for each distinct count, and the other tracks the largest. This lets me compute the minimal subarray length for exactly k distinct elements in O(n) time instead of the naive O(n²).
Actually, there is a cleaner way. I can slide the right pointer to expand until I have at least k distinct values. Then I shrink from the left while maintaining at least k distinct values. Whenever the window has exactly k distinct, I update the answer. This gives me O(n) with a hashmap for frequency counts.
Here is the code I wrote:
from collections import defaultdict
def shortest_subarray_with_k_distinct(arr, k):
n = len(arr)
freq = defaultdict(int)
distinct = 0
left = 0
ans = float('inf')
for right in range(n):
freq[arr[right]] += 1
if freq[arr[right]] == 1:
distinct += 1
while distinct > k:
freq[arr[left]] -= 1
if freq[arr[left]] == 0:
distinct -= 1
left += 1
while distinct == k:
ans = min(ans, right - left + 1)
freq[arr[left]] -= 1
if freq[arr[left]] == 0:
distinct -= 1
left += 1
return ans if ans != float('inf') else -1
Time complexity: O(n) | Space complexity: O(k) for the hashmap storing at most k+1 distinct values at any time.
I ran my own test cases after writing it: the example from the prompt, a case with k=1, a case where no window exists, and an array where every element is the same. All passed the visible test cases. I had about 38 minutes left on the clock when I submitted and moved on.
Question 2: Shortest Cycle in a Directed Graph

The problem I got: You are given an integer n representing the number of nodes in a directed graph, labeled 0 through n-1, and a list of directed edges [u, v] meaning a directed edge from node u to node v. Return the length of the shortest cycle in the graph. If no cycle exists, return -1. A cycle is a path that starts and ends at the same node and uses each edge at most once.
So n = 5, edges = [[0,1], [1,2], [2,0], [0,3], [3,4]] -- the cycle is 0→1→2→0, length 3.
My approach: My first instinct was to reach for DFS with a visited stack to detect back edges. But that gives you any cycle, not the shortest one. For a full minute I stared at the problem statement, running through approaches.
I remembered why I had chosen a tool that doesn't touch my laptop screen. Hitting the keyboard shortcut auto-captured the coding problem to my phone, and within seconds the BFS approach appeared with the edge-case notes I needed. I closed the phone and started coding.

Land offer with Safer AI Interview Assistant
Skip the risky invisible apps. Our dual-device mode keeps it simple and undetectable. You crush the interview, we handle the answers.
Get started. It's freeLoved by 100,000+ candidates
What I landed on: run BFS from every node. For each starting node, I do a standard BFS and track distances. If during the BFS from node i I encounter an edge that points back to i itself, I have found a cycle. The cycle length is the distance from i to the current node plus one. I take the minimum across all starting nodes.
This is O(n × (n + m)) which is suboptimal for very large graphs, but I figured with OA constraints (n probably no more than a few thousand) it would pass. I made a mental note that a more optimized solution exists with O(n × m) using BFS from each node with parent tracking, but the clock was ticking and I needed something that worked.
from collections import deque
def shortest_cycle(n, edges):
adj = [[] for _ in range(n)]
for u, v in edges:
adj[u].append(v)
min_cycle = float('inf')
for start in range(n):
dist = [-1] * n
dist[start] = 0
q = deque([start])
while q:
node = q.popleft()
for neighbor in adj[node]:
if neighbor == start:
min_cycle = min(min_cycle, dist[node] + 1)
elif dist[neighbor] == -1:
dist[neighbor] = dist[node] + 1
q.append(neighbor)
return min_cycle if min_cycle != float('inf') else -1
Time complexity: O(n × (n + m)) where n is the number of nodes and m is the number of edges | Space complexity: O(n + m) for the adjacency list and O(n) for the BFS distance array.
I tested it on the sample input, on a graph with no cycles (a simple DAG), on a self-loop, and on a graph where multiple cycles exist and the shortest one is somewhere in the middle. All looked correct. I had 12 minutes left, so I went back to both questions and added comments explaining the time and space complexity. Then I submitted.
Salesforce HackerRank Records Your Camera and Microphone
What Proctoring Looks Like During the Test
Before the timer started, HackerRank prompted me to grant camera and microphone permissions. Once I clicked allow, both stayed on for the full 75 minutes. A small indicator in the browser tab confirmed the recording was active the entire session. I could see my own webcam feed in the corner of the screen throughout.
The test was self-scheduled. I picked a Wednesday morning slot, clicked the link, and the 75-minute countdown began. There was no language restriction. I wrote both solutions in Python. Other candidates in the forums reported using Java, C++, and JavaScript without issue.
Salesforce's configuration let me download the project skeleton and work in my local IDE before uploading the final code. Not every company enables that option, so I confirmed it was available before relying on it. Timer kept ticking regardless, so the local workflow did not buy me extra time.
Camera and microphone recording are just the start of what HackerRank's monitoring can cover. How HackerRank captures the screen during an assessment is a separate question entirely. The answer changes based on which proctoring mode the employer selected.
What HackerRank's Platform-Level Detection Covers
Beyond the camera and microphone, HackerRank runs several integrity checks at the platform level across all employer tests. An ML-based plagiarism model with 85-93% reported accuracy scans for ChatGPT-generated solutions and copy-paste events from external sources. It also flags irregular keystroke patterns that do not match natural typing.
The system generates a code replay at keystroke level that a reviewer can scrub through after submission.
Desktop App Mode adds a deeper layer. It enforces full-screen operation and detects invisible overlay tools at the process level, closing them on detection. Gaze tracking flags repeated off-screen eye movements during the session. One internal HackerRank test flagged InterviewCoder at greater than 0.99 confidence.
Every candidate should know: flagged sessions go to a human recruiter for review, not an automatic rejection. Follow-up interview questions remain the real filter for candidates who submit code they cannot explain.
11 Questions Confirmed by Other Salesforce OA Candidates
Graph Questions Confirmed by Salesforce OA Takers
Outside the two problems I drew, other candidates reported graph questions across multiple roles in 2025 and 2026. The shortest cycle in a directed graph showed up for an SMTS candidate in Hyderabad in February 2026 -- same problem I got, confirming it is not a one-off.
A network virus spread problem gave candidates an N×N adjacency matrix. They had to patch exactly one infected computer to minimize total infections. Another involved finding connected components in an undirected graph. This is a standard BFS/DFS pattern that still tripped people up under time pressure.
Array and Sliding Window Questions From Recent OAs
Array problems make up the largest share of reported Salesforce HackerRank questions. The min-length subarray with k distinct integers appeared for the same SMTS candidate who got the graph cycle question, suggesting these two problems may travel as a pair.
An occurrence marking problem gave candidates an array of binary strings and asked them to mark positions per index based on certain conditions. Another asked for the minimum sweeps needed to sort a binary array after updates. This pattern shows up in competitive programming more than LeetCode.
One candidate in April 2026 received a minimum-difference problem: given a 1D array, find the pair of elements with the smallest absolute difference. Simple in concept, but hidden test cases included edge conditions around duplicate values and large input sizes. These caught people off guard.
String and Tree Questions Reported Since 2025
String manipulation questions appeared in several recent assessments. A spam classification problem asked whether a given text contains at least two words from a spam-word list, with case-sensitive matching.
Another asked to replace every '?' in a string so that no two adjacent characters are identical. A variation of that same pattern required constructing a string with no k consecutive identical characters given certain constraints.
One tree question stands out from the rest in reported difficulty. Candidates described a problem about collecting opportunity data across nodes in a tree. The constraints made a naive traversal too slow. Every report on this question labeled it as hard, and I did not find a single walkthrough of a full solution.
Partial Descriptions (Pattern Awareness Only)
Two additional problems surfaced with descriptions too vague to reconstruct fully. One involved binary heaps and priority queues, reported by an LMTS candidate in India in September 2025. The other combined dynamic programming with sorting and math, mentioned in the same post.
These serve as directional signals: heaps and DP math hybrids are in Salesforce's question pool even if the exact problem statements remain unclear.
The 75-Minute HackerRank Test Format Salesforce Uses
Time Limits and Question Count by Role
The 75-minute, 2-question format is the most common configuration for LMTS and SMTS roles. Three separate LeetCode Discuss threads from 2025 and 2026 confirmed this. One candidate who landed an MTS offer described the same setup: two problems, 75 minutes, camera and microphone on.
Variations exist. A February 2026 InterviewExperiences.in post described 3 questions in 90 minutes for a general software engineer role. On the shorter end, a Teamblind thread mentioned 45 minutes for some AMTS roles in India. A 120-minute format appeared in one overview article, but I did not find a firsthand candidate report confirming it.
Platform Mechanics to Know Before Starting
The test is self-scheduled, and the timer starts the moment the assessment link is clicked. That means the intro and setup screens count against the clock. I opened the link only after I had water, a quiet room, and my local environment ready.
Salesforce's configuration let me download the project, work locally, and upload before the deadline. Not every employer enables this, and I verified it was active by checking for the download option in the first minute.
Hidden test suites run after submission, not during. The visible test cases in the HackerRank editor are only a subset. A full pass on visible tests does not guarantee a pass on hidden ones, and several candidates reported exactly that failure pattern.
One format variant worth knowing: progressive level unlocking. A Teamblind post described four progressive levels per question, where passing all test cases on level N is required to unlock level N+1. Under this format, getting stuck on an early level locks a candidate out of the remaining levels entirely.
I did not encounter this variant, but the post described a real score outcome -- 950 out of 1000 raw points with 50% test case coverage at level 4.

Four Criteria Decide Your Salesforce HackerRank Score
The Official Scoring Rubric Salesforce Uses
Salesforce publishes their evaluation criteria directly in their Trailhead candidate prep module. That four-tier ranking is more specific than what most companies share publicly.
The ranked criteria are: (1) Functionality -- does the code compile and run correctly; (2) Design and architecture -- is the solution well-structured, using appropriate OOP patterns where relevant; (3) Scalability -- do the chosen data structures handle input at volume; and (4) Code quality and readability -- is the code commented and formatted.
The Trailhead module states the priority order plainly: a working solution in mediocre style beats elegant code that crashes. Correctness comes first, then structure, then scale considerations, then polish.
No competitor article I found before my test mentioned code quality as a scored dimension. Let alone the fourth of four ranked tiers. Salesforce's own Trailhead module on remote programming tests lays out these criteria in detail.
I read this rubric before my test and it changed what I did in the final 12 minutes. Instead of optimizing Q2's BFS approach, I added clear comments to both solutions and verified the formatting was consistent. That time allocation only made sense because I knew readability was scored.

What Raw Scores and Hidden Tests Mean
Salesforce does not publish a public pass or fail threshold. The final decision involves human review of the full session, not just a raw score. One Teamblind post provided rare score transparency: a candidate at progressive level 4 with 50% test case coverage received 950 out of 1000 raw points, adjusted to 560 out of 600.
That same post noted that HackerRank's sample test gave an accurate preview of the real format, so running it beforehand is worth the time.
Hidden test cases carry weight after submission. Candidates who pass all visible tests can still fail the hidden suite. Running tests within the HackerRank editor during the assessment carries no penalty. I ran custom tests aggressively on edge cases before submitting each question.
Proven Exam-Day Strategy for the Salesforce HackerRank Test
The Priority Order That Maximizes Your Score
After reading the scoring rubric and hearing from candidates who passed and failed, I settled on a clear priority stack. First, make the code compile and return correct output on the sample cases. A solution that runs and passes sample tests always beats one that is half-finished.
Second, solve both questions with all visible test cases green. Leaving Q2 blank to polish Q1's design is the wrong trade. Third, add comments, clean up variable names, and check code structure. The readability points are real and cost almost no time with five minutes reserved.
Custom test runs were something I used liberally throughout the session. HackerRank does not penalize test runs, and the Trailhead module explicitly encourages them. Each custom test I wrote caught an edge condition before submission. One caught an off-by-one in my sliding window loop that would have failed a hidden test.
Time Allocation and Decision Points During the Test
Reading both questions before writing a single line of code was my first step. Q1 looked harder at first glance, with its sliding window and exactly-k constraint, so I started there to give it more mental runway. My target was 35 minutes per question with 5 minutes for review.
Q1 took 37 minutes and Q2 took 28, leaving 10 minutes to go back and add complexity comments and edge-case documentation to both.
If I had gotten stuck for more than 15 minutes on Q1, my plan was to switch to Q2 immediately and return. A half-finished Q1 plus a completed Q2 beats two half-finished problems every time. For candidates facing the progressive-level format, the calculus shifts. Unlocking levels takes priority over polishing because unseen levels award zero points.
I checked input constraints on every function before coding. One LeetCode Discuss post flagged large-number overflow as a specific gotcha on Salesforce HackerRank problems. So I used Python's arbitrary-precision integers and avoided any assumptions about input size. If the internet had dropped, the Trailhead module was clear: email the recruiter immediately.
Why Candidates Fail the Salesforce HackerRank OA
Four Ways Candidates Lose Points They Do Not See Coming
The hidden test suite is the most common trap. Code that passes every visible test case can still fail hidden tests that cover edge conditions the sample cases do not exercise. One LMTS candidate who passed all visible tests still described the uncertainty of waiting on hidden results. That ambiguity is the pattern.
Progressive level blocking creates a failure mode specific to that format variant. A candidate who gets stuck on level 2 with time running out receives zero credit for levels 3 and 4, even if they could have solved them.
The format punishes partial progress more harshly than the standard independent-questions setup. The Teamblind post describing this variant showed that even a high raw score at level 4 did not guarantee the outcome.
Code quality penalties are specific to Salesforce's scoring system. I would have lost points if I had submitted uncommented, poorly structured code that passed all tests. No other company OA I had taken at that point scored readability as a named criterion.
I saw multiple candidate write-ups that mentioned passing tests but still getting rejected. They did not understand why the code quality dimension existed.
Large-number overflow is the gotcha that appears consistently across candidate reports. Inputs with values exceeding 32-bit integer range require explicit handling. Python gave me an advantage here with automatic big-integer support. Candidates writing in Java or C++ reported this as a recurring pain point.
AI Tool Detection During the HackerRank OA
HackerRank's ML model flags several categories of AI assistance. It scans for ChatGPT-generated solutions and copy-paste events from external editors or the web. It also flags irregular keystroke patterns that suggest retyping pre-written code.
The plagiarism detection system -- described in HackerRank's own documentation -- combines these signals into a confidence score per session.
Desktop App Mode detects overlay tools running at the OS process level. In official testing, InterviewCoder was flagged above 0.99 confidence. HackerRank's system also identifies tools like Cluely and Ultracode. Gaze detection analyzes webcam stills for repeated patterns of looking away from the screen and returning to type.
The critical detail: flagged sessions are not automatically failed. A human recruiter reviews the evidence, including code replay and flagged moments. What tends to sink flagged candidates is the follow-up interview, where they cannot explain the code they submitted. The detection system raises a flag. The human review and follow-up conversation determine the outcome.
Desktop overlay tools render AI answers on the same screen the proctoring system is recording. HackerRank's Desktop App Mode detects these at the OS process level. Flagged sessions trigger deeper scrutiny from the hiring team, not automatic rejection.
The follow-up interview is where the gap between submitted code and actual ability becomes impossible to hide. A candidate who cannot walk through the reasoning behind their solution draws more attention than the detection flag itself.
Land offer with Safer AI Interview Assistant
Skip the risky invisible apps. Our dual-device mode keeps it simple and undetectable. You crush the interview, we handle the answers.
Get started. It's freeLoved by 100,000+ candidates
A single paste during a HackerRank test -- does it trigger a flag, or just get logged? How HackerRank flags copy-paste events walks through the three triggers that separate a logged event from a reviewer flag.
How to Prepare for the Salesforce HackerRank in 7 Days
Days 1-3: HackerRank Platform Familiarity and Core Patterns
I practiced directly on HackerRank's platform for the first three days. The editor behaves differently from LeetCode's, and input/output handling takes a few sessions to get comfortable with. The sample test HackerRank provides gave me an accurate preview of the real format, confirming what the Teamblind post described.
I focused entirely on arrays, strings, sliding window, and hash table problems. These patterns dominate Salesforce's confirmed question inventory.
System design, behavioral prep, and LeetCode hard problems stayed off my list. Every hour I spent on those topics was an hour not spent on the patterns that actually showed up. I completed three to four medium problems per day, each capped at 35 minutes to match the OA pacing.
Days 4-5: Graph, DP, and Medium-Depth Drill
The second block shifted to graph traversal, dynamic programming on matrices and subarrays, and priority queue problems. The shortest-cycle and connected-components questions from the confirmed inventory told me graph BFS/DFS was not optional. I targeted two to three medium problems per day, again with a 35-minute per-problem cap.
My success check: solve an unfamiliar graph medium end to end with all edge cases in 40 minutes or less. The first two attempts took closer to 50 minutes. By day five I hit the target consistently, and the BFS-from-every-node pattern from this block showed up directly in my real Q2.
Days 6-7: Timed Mock Runs and Code Quality Polish
Day six was a full 75-minute mock OA with two unseen medium problems on HackerRank. Both passed all visible test cases with five minutes to spare. The code was functional, but looking at it through Salesforce's scoring lens, gaps appeared: no comments, inconsistent variable naming, no complexity annotations.
The remaining time went to adding those elements. I realized how fast readability improvements accumulate with a dedicated polish window.
InterviewFox's Prep Agent over WhatsApp became part of my routine during this phase. I sent it the confirmed question patterns from my research, and it returned a personalized drill plan.
The plan targeted the exact sliding-window and graph-cycle patterns I was about to face. It caught a gap in my graph cycle detection approach that I had not tested against a DAG input.
Day seven was light review. I re-read the Trailhead scoring rubric, verified my mock code met all four tiers, and did not touch any new problems. The clarity of walking in with a rested brain and a checklist mattered more than one extra problem session.
Recruiters Call Back 1 to 5 Days After Submitting the OA
The Typical Post-OA Timeline
Across five confirmed candidate reports, the recruiter callback window was consistently 1 to 5 days after OA submission. One LMTS candidate in India got a call the next day. Another SMTS candidate heard back within the same week.
A Medium post from July 2026 described getting the cleared-assessment email "a few days later." The tightest pattern: submit on a weekday, hear back before the weekend.
The full interview loop stretches longer, typically 2 to 6 weeks from OA submission to final decision. One MTS candidate reported their offer process stretching 20 days after the final round. The timeline variance depends on team availability and role urgency more than candidate performance.
What Comes After You Pass
Most candidates hear back within 1 to 5 days with an invitation to the next round. This typically includes DSA and system design interviews. Passing the OA does not lock your target level. One LMTS candidate was hired as SMTS after completing the full loop.
FAQ
How many questions are on the Salesforce HackerRank OA?
Typically 2 coding questions in 75 minutes. Some roles receive 3 questions in 90 minutes. A few MTS candidate reports mention 3 to 4 questions, though the standard is 2.
What programming languages can I use on the Salesforce HackerRank test?
No language restriction. Python, Java, C++, C, JavaScript, and other HackerRank-supported languages are all available. The language selection menu appears before the timer starts.
Does Salesforce see my exact HackerRank score?
Unconfirmed. Salesforce uses their own four-tier scoring rubric: functionality, design, scalability, code quality. They likely review the full session replay rather than a single raw number. The Trailhead module confirms scoring is manual and multi-dimensional, not a single pass-or-fail threshold.
Can I work in my local IDE during the Salesforce HackerRank test?
Yes, if the employer enables the download-and-upload option. Salesforce's configuration let me download the project skeleton and work locally before uploading. Confirm this is available by checking for the download button in the first minute of the test. The timer keeps running regardless.
What happens if my internet disconnects during the OA?
Email your recruiter immediately. Salesforce's Trailhead module includes this instruction explicitly. Do not wait for the connection to return on its own and do not assume the platform will resume from where it stopped.
Is using ChatGPT or Copilot allowed during the Salesforce HackerRank test?
No. HackerRank's AI plagiarism detection flags ChatGPT-generated solutions, copy-paste from external sources, and irregular keystroke patterns. Desktop App Mode detects overlay tools at the process level. Flagged sessions go to a human recruiter for review, not automatic rejection. Follow-up interviews expose candidates who cannot explain their own code.
How long until I hear back after submitting the Salesforce HackerRank?
Most candidates report a recruiter callback within 1 to 5 days. The full interview loop typically runs 2 to 6 weeks from OA submission to final decision. Offer processes occasionally extend beyond 20 days after the last round.
Will HackerRank detect AI tools or external help during my Salesforce assessment?
HackerRank's ML-based plagiarism model scans for AI-generated code patterns, copy-paste events, and irregular keystroke patterns. Desktop App Mode adds OS-level overlay detection and gaze tracking. Flagged sessions go to a human recruiter for review, not automatic rejection. Follow-up interviews consistently expose candidates who cannot explain their own code.
Land offer with Safer AI Interview Assistant
Skip the risky invisible apps. Our dual-device mode keeps it simple and undetectable. You crush the interview, we handle the answers.
Get started. It's freeLoved by 100,000+ candidates