FastPrepDFS Subsequences of a String (For MLE)
Problems/DFS Subsequences of a String (For MLE)

DFS Subsequences of a String (For MLE)

CoinDCX logoCoinDCX● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a CoinDCX phone screen. The report names a well-known task. We chose the function signature, a fixed order for the output, and the limits. Our version is about 98% the same as the reported question.

A DFS problem involving subsequences of a string. Given an input String, return a list containing every possible substring, with the requirement that they are sorted alphabetically. For example, given the input "abc", return ["a", "b", "c", "ab", "bc", "ac", "abc"].

Function

generateAllSubsequences(s: String) → List<String>

Examples

Example 1

s = "abc"return = ["a", "ab", "abc", "ac", "b", "bc", "c"]

The function should return all possible subsequences of the input string "abc" sorted alphabetically, which are: ["a", "ab", "abc", "ac", "b", "bc", "c"].

Constraints

  • 🥝🥝

Source note: Author-written prompt excerpt retained for source fidelity.

More CoinDCX Phone Screen questions

  • Count Valleys in a Wiggle PatternPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Expression Add OperatorsPinterest · PHONE SCREENPinterest interview questions
  • Permutations of Unique CharactersSalesforce · PHONE SCREENSalesforce interview questions
  • All Rearrangements of a StringAdobe · PHONE SCREENAdobe interview questions
  • DFS Subsequences of a String (For MLE)Wayfair · OAWayfair interview questions
  • Phone Keypad Letter CombinationsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Permutations of Character PositionsPeopleStrong · ONSITE INTERVIEWPeopleStrong interview questions
  • Generate Balanced ParenthesesInMobi · OAInMobi interview questions
  • Enumerate Weekly Work SchedulesAgoda · PHONE SCREENAgoda interview questions
  • Valid PalindromeThe Walt Disney Company · OA · PHONE SCREENThe Walt Disney Company interview questions
  • Generate Wildcard Binary StringsBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
See CoinDCX hiring insights
Saved
class Solution {
    public List<String> generateAllSubsequences(String s) {
      // write your code here
    }

}
Checking account…