FastPrepPermutations of Unique Characters
Problems/Permutations of Unique Characters

Permutations of Unique Characters

Salesforce logoSalesforce● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Salesforce phone screen. The report gives the whole permutation task but not the output order or the limits. Our version is about 97% the same as the reported question.

Given a non-empty string word whose characters are all distinct, return every permutation of its characters.

Return the permutations in lexicographic order.

Function

generatePermutations(word: String) → String[]

Examples

Example 1

word = "abc"return = ["abc","acb","bac","bca","cab","cba"]

There are 3! = 6 permutations, listed lexicographically.

Example 2

word = "z"return = ["z"]

A one-character word has exactly one permutation.

Constraints

  • 1 <= word.length <= 9
  • word contains distinct lowercase English letters.

More Salesforce Phone Screen questions

  • Detect a Cycle in a Linked ListPHONE SCREEN · Seen Oct 2026
  • Find Rows Common to Two TablesPHONE SCREEN · Seen Oct 2026
  • Merge Two Sorted Linked ListsPHONE SCREEN · Seen Oct 2026
  • Minimum Window of Required WordsPHONE SCREEN · Seen Aug 2026
  • Minimum Window SubstringPHONE SCREEN · Seen Aug 2026
  • Optimal Account BalancingPHONE SCREEN · Seen Jul 2026
  • Longest Increasing SubsequencePHONE SCREEN · Seen Jul 2026
  • Maximal SquarePHONE SCREEN · Seen Jul 2026
  • ATM Queue Exit OrderPHONE SCREEN · Seen May 2026
  • Good Ways to Split an ArrayPHONE SCREEN · Seen May 2026

Similar questions at other companies

  • All Rearrangements of a StringAdobe · PHONE SCREENAdobe interview questions
  • DFS Subsequences of a String (For MLE)CoinDCX · PHONE SCREEN
  • Expression Add OperatorsPinterest · PHONE SCREENPinterest interview questions
  • Phone Keypad Letter CombinationsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Permutations of Character PositionsPeopleStrong · ONSITE INTERVIEWPeopleStrong interview questions
  • Generate Balanced ParenthesesInMobi · OAInMobi interview questions
  • DFS Subsequences of a String (For MLE)Wayfair · OAWayfair interview questions
  • Count Complete Tic-Tac-Toe GamesDecagon · PHONE SCREEN · ONSITE INTERVIEWDecagon interview questions
  • Largest Number Below N from Reusable DigitsByteDance · PHONE SCREENByteDance interview questions
  • Remove Parentheses from a Plus-Minus ExpressionOracle · PHONE SCREENOracle interview questions

Salesforce interview experiences

  • Salesforce Infrastructure SWE OA and Onsite: 1 Experience
  • Salesforce Experienced Backend SWE First Round: 1 Experience
All Salesforce interview questionsSee Salesforce hiring insights
Saved
class Solution {
    public String[] generatePermutations(String word) {
        // Write your code here.
    }
}
Checking account…