FastPrepCheck String Permutation
Problems/Check String Permutation

Check String Permutation

Vanguard logoVanguard● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report includes a positive example that does not fit. Our version checks the whole string and matches the described counting approach. The character limits and what counts as valid input are our assumptions. Our version is about 85% the same as the reported question.

Given strings s and t, return true if rearranging all characters of s can produce exactly t. Otherwise return false.

Every occurrence matters. Comparisons are case-sensitive, and spaces and punctuation count as ordinary characters. Two empty strings are permutations of each other.

Validation follow-up

The callable task receives non-null strings. Discuss how a service should check input when it arrives:

  • Reject null or unsupported input.
  • Treat an empty string differently from a missing value.
  • Test validation code that can be reused.

Explain how you would organize validators in production code.

Function

arePermutations(s: String, t: String) → boolean

Examples

Example 1

s = "abbbb"t = "bbbba"return = true

Both strings contain one a and four b characters.

Example 2

s = "abbbc"t = "aaabc"return = false

The multiplicities of a and b differ.

Example 3

s = ""t = ""return = true

Both strings have zero occurrences of every character.

Constraints

  • 0 <= s.length, t.length <= 10^5.
  • Every character is printable ASCII with a code from 32 through 126.
  • Both inputs are non-null.

More Vanguard interview questions

  • Two SumOA · Seen Sep 2026
  • Valid ParenthesesOA · Seen Sep 2026
  • Are They PangramsOA · Seen Nov 2025
  • Missing WordsOA · Seen Nov 2025
  • Spam DetectionOA · Seen Nov 2025
  • Binge WatchingOA · Seen Jan 2023
  • Minimum Moves Around a Circular ArrayOA · Seen Aug 2022
  • Maximum Occurring CharacterOA · Seen Mar 2022
  • Picking TicketsOA · Seen Mar 2022
  • Tool List: Two Smallest ValuesOA · Seen Nov 2021

Similar questions at other companies

  • Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
  • First Letter to Appear TwiceCisco · PHONE SCREENCisco interview questions
  • Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Portfolio Valuation, Part 1Stripe · PHONE SCREENStripe interview questions
  • Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
  • Summarize Server Healthcheck LogsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Known Words Matching Phone DigitsLinkedIn · PHONE SCREENLinkedIn interview questions
  • First Non-Repeated CharacterDell Technologies · PHONE SCREENDell Technologies interview questions
  • Convert an Entry List to a MapEPAM · PHONE SCREENEPAM interview questions
  • First Non-Repeating CharacterGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions

Interview reports that mention this question

  • Vanguard Software Older Rounds: 13 Experiences (Part 2 of 3)

Vanguard interview experiences

  • Vanguard Tech and Risk Older OAs: 12 Experiences (Part 3 of 3)
  • Vanguard Tech Intern Interviews: 37 Experiences (Part 1 of 3)
All Vanguard interview questionsSee Vanguard hiring insights
Saved
class Solution {
    public boolean arePermutations(String s, String t) {
        // Write your code here.
    }
}
Checking account…