FastPrepMinimum Anagram Period
Problems/Minimum Anagram Period

Minimum Anagram Period

Wells Fargo logoWells Fargo● MediumNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives the full task, the function, the constraints, and a worked example. Our version is about 99% the same as the reported question.

You are given a lowercase string inputStr.

Choose a positive block length p that divides inputStr.length. Split the string into consecutive blocks of length p. The length is valid when every block is an anagram of every other block.

Return the minimum valid block length.

Function

getAnagramPeriod(inputStr: String) → int

Examples

Example 1

inputStr = "ababbaab"return = 2

Split the string into ab, ab, ba, and ab. All four blocks are anagrams, and no block length smaller than 2 works.

Example 2

inputStr = "abcabc"return = 3

The two blocks abc and abc match. Lengths 1 and 2 do not produce blocks with equal character counts.

Example 3

inputStr = "aaaa"return = 1

Every one-character block is the string a.

Constraints

  • 1 <= inputStr.length <= 10^5.
  • inputStr contains only lowercase English letters.

More Wells Fargo Online Assessment questions

  • Server Upgrade PlanningOA · Seen Nov 2026
  • Student and Course EnrollmentOA · Seen Nov 2026
  • Bond Interest Summary Above 3%OA · Seen Oct 2026
  • Count Phrases Formed by Anagram ReplacementOA · Seen Oct 2026
  • Event Statistics AggregatorOA · Seen Sep 2026
  • Ordered Deployment Configuration ValidatorOA · Seen Sep 2026
  • Longest Subsequence That Is a SubstringOA · Seen Jul 2026
  • Overloaded Game Account InventoriesOA · Seen Jul 2026
  • Count Server ReplacementsOA · PHONE SCREEN · Seen Feb 2026
  • Minimum Remaining LengthOA · PHONE SCREEN · Seen Feb 2026

Similar questions at other companies

  • Minimum Anagram PeriodVisa · OAVisa interview questions
  • Maximum Equal Parts for PrefixesAmazon · OA
  • Reorderable Task Scheduler With CooldownWaymo · PHONE SCREENWaymo interview questions
  • Reconstruct Digits from Jumbled English WordsMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Text Embedding and Vector SearchNike, Inc. · PHONE SCREEN · ONSITE INTERVIEWNike, Inc. interview questions
  • Per-Segment SpeedingOnePay · PHONE SCREENOnePay interview questions
  • Fraction to Recurring DecimalGoldman Sachs · ONSITE INTERVIEWGoldman Sachs interview questions
  • Find Accounts with Negative Converted BalancesStripe · PHONE SCREENStripe interview questions
  • N-gram Language Model with Add-Alpha SmoothingGoogle · ONSITE INTERVIEWGoogle interview questions
  • Rank Bipedal Dinosaurs by SpeedMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions

Interview reports that mention this question

  • Wells Fargo OA: What It Tests (2026)

Wells Fargo interview experiences

  • Wells Fargo SWE Intern OA and Interview Questions: 18 Experiences
All Wells Fargo interview questionsSee Wells Fargo hiring insights
Saved
class Solution {
    public int getAnagramPeriod(String inputStr) {
      // write your code here
    }
}
Checking account…