FastPrepDistinct Letter Arrangements
Problems/Distinct Letter Arrangements

Distinct Letter Arrangements

DocuSign logoDocuSign● MediumINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A report from August 2018 listed one question: a permutation task on a string, where repeated letters lead to duplicate results. It does not say whether this came in the take-home or in the phone interview that followed.

The report does not say what to return. Here you list every different arrangement of the letters once, in alphabetical order, so repeated letters do not create duplicates. Strings have 1 to 6 lowercase letters. We wrote the examples.

Our version is about 70% the same as the reported question.

A permutation of a string uses all of its letters in some order. When a letter repeats, different orders can spell the same word. For example, swapping the two ps in "apple" gives "apple" again.

Given a string s, return every different word you can spell with all of its letters. List each word once, with no duplicates, in alphabetical order.

Function

distinctPermutations(s: String) → String[]

Examples

Example 1

s = "bob"return = ["bbo","bob","obb"]

The letters are b, b, o. Swapping the two bs gives the same word, so there are only 3 different arrangements: "bbo", "bob" and "obb".

Example 2

s = "noon"return = ["nnoo","nono","noon","onno","onon","oonn"]

Two ns and two os can be arranged in 6 different ways. In alphabetical order they are nnoo, nono, noon, onno, onon, oonn.

Example 3

s = "cat"return = ["act","atc","cat","cta","tac","tca"]

All letters differ, so every one of the 3 * 2 * 1 = 6 orders is a different word.

Constraints

  • 1 <= s.length <= 6
  • s contains only lowercase English letters.

More DocuSign Phone Screen questions

  • Symmetric Binary TreePHONE SCREEN · Seen Oct 2026
  • Union Area of Two RectanglesPHONE SCREEN · Seen Oct 2026
  • Execute Cursor-Based Text Editor OperationsPHONE SCREEN · Seen Sep 2026
  • Minimize Array Sum After K Halving OperationsPHONE SCREEN · Seen Sep 2026
  • Fizz and Buzz Words From 1 to nPHONE SCREEN · Seen Sep 2026
  • Two Positions That Add Up to a TargetPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Rain Kept Between WallsPHONE SCREEN · Seen Mar 2026
  • Exact Palindrome CheckPHONE SCREEN · ONSITE INTERVIEW · Seen Apr 2022
  • Reverse the Characters of a TextPHONE SCREEN · ONSITE INTERVIEW · Seen Apr 2022
  • Rebuild a Trip From Flight TicketsPHONE SCREEN · Seen Apr 2019

Similar questions at other companies

  • Phone-Number Letter CombinationsHeadway · PHONE SCREENHeadway interview questions
  • Letter Combinations of a Phone NumberLinkedIn · PHONE SCREENLinkedIn interview questions
  • String Permutations in Custom Character OrderWex · OA · PHONE SCREEN
  • Numeric Poker OperationsRippling · PHONE SCREENRippling interview questions
  • Unique String PermutationsAmazon · PHONE SCREEN
  • Restore Addresses with K SegmentsByteDance · PHONE SCREENByteDance interview questions
  • Permutations of Unique CharactersSalesforce · PHONE SCREENSalesforce interview questions
  • Count Prefix Paths in a Character GraphGoogle · PHONE SCREENGoogle interview questions
  • Sorted Subsets of a StringMicrosoft · PHONE SCREENMicrosoft interview questions
  • Maximum Unique Substring SplitThe Walt Disney Company · PHONE SCREENThe Walt Disney Company interview questions

Interview reports that mention this question

  • DocuSign SWE Intern Interviews: 27 Experiences (Part 2 of 2)

DocuSign interview experiences

  • DocuSign SWE Intern OA Questions: 53 Experiences (Part 1 of 2)
All DocuSign interview questionsSee DocuSign hiring insights
Saved
class Solution {
    public String[] distinctPermutations(String s) {
        // Write your code here.
    }
}
Checking account…