← Questions

Most frequent substring under length and distinct-letter limits

0
MicrosoftCodingLast asked Sep 2026

A coding interview question asked in Microsoft's HackerRank assessment, last asked Sep 2026. It tests strings, sliding window and hashing.

Given a lowercase string s, a substring is eligible when it has at most max_letters distinct letters and its length is between min_size and max_size, inclusive. Return how many times the most frequent eligible substring occurs in s, or 0…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

strings · sliding window · hashing

Your code and the AI tutor open when you unlock this question.