Skip to main content

Salesforce Coding Interview Questions

100 Salesforce coding interview problems with full optimal solutions — 30 easy, 50 medium, 20 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Salesforce interviewer values, and a FAQ section.

Showing 15 problems of 100

  • #81hardsometimes asked

    81. Median of Two Sorted Arrays

    Find the median of two sorted arrays in O(log(min(m, n))). Salesforce uses this as a stretch question to gauge advanced binary-search mastery.

  • #82hardrarely asked

    82. Regular Expression Matching

    Implement regular expression matching with '.' and '*'. Salesforce uses this as a 2D-DP stress test — they grade on whether you can handle the star's variable-length match.

  • #84hardrarely asked

    84. Reverse Nodes in k-Group

    Reverse every k consecutive nodes in a linked list, leaving the trailing remainder untouched. Salesforce uses this as a pointer-acrobatics stress test.

  • #87hardsometimes asked

    87. First Missing Positive

    Find the smallest positive integer missing from an unsorted array in O(n) time and O(1) space. Salesforce uses this as an O(1)-space cyclic-sort stress test.

  • #89hardrarely asked

    89. Wildcard Matching

    Implement wildcard pattern matching with '?' and '*'. Salesforce uses this in their permission-set glob matching for object access rules.

  • #90hardrarely asked

    90. Jump Game II

    Find the minimum number of jumps to reach the last index. Salesforce uses this as a greedy stress test — they grade on the BFS-level insight.

  • #91hardrarely asked

    91. N-Queens

    Place n queens on an n x n chessboard so no two attack each other; return all distinct solutions. Salesforce uses this as the canonical hard backtracking problem.

  • #92hardrarely asked

    92. N-Queens II

    Count the number of distinct N-queens placements without returning the actual boards. Salesforce uses this to test whether you can specialize an enumeration algorithm.

  • #94hardrarely asked

    94. Valid Number

    Determine if a string represents a valid number. Salesforce uses this to test edge-case enumeration and finite-state-machine reasoning.

  • #95hardrarely asked

    95. Text Justification

    Format text such that each line has exactly maxWidth characters with full justification. Salesforce uses this as a string-manipulation stress test.

  • #98hardrarely asked

    98. Maximal Rectangle

    Find the largest rectangle of 1s in a binary matrix. Salesforce uses this to test the row-by-row histogram reduction.

  • #100hardrarely asked

    100. Word Ladder

    Find the shortest transformation sequence from beginWord to endWord changing one letter at a time. Salesforce uses this as a BFS-on-implicit-graph stress test.

Related interview-prep guides

Interview Platforms

HireVue Tech Interview Guide: The 2026 Playbook for Async Video Rounds

HireVue is the category-leading async video interview platform. Candidates record answers solo, on the clock, and a combined AI-plus-human review layer scores the recording days later. For 2026 tech jobseekers, the format is different enough from live interviews to need its own playbook. This guide is that playbook.

Interview Platforms

Codility for Tech Interviews in 2026: The Complete Guide for Candidates

Codility is the dominant algorithmic-assessment platform across European tech hiring. Heavy in the UK, Germany, Netherlands, Nordics, and Poland where the company was founded. It scores candidates on both correctness and time complexity, runs 60-to-120-minute timed tests, and ships three products: Tests, CodeCheck, and CodeLive. This guide is what 2026 candidates need to know.

Interview Platforms

Spark Hire Async Video Interview Guide for Tech Jobseekers (2026)

Spark Hire is a mid-market async video interview platform used by 6,000+ employers across tech, healthcare, retail, and education. Candidates record video answers to pre-recorded prompts within configurable time budgets, and hiring teams review the recordings asynchronously. Lighter on AI scoring than HireVue, heavier on human review.

Salesforce Coding Interview Questions — Full Solutions — InterviewChamp.AI