Question bank › Sliding Window
Dsa Sliding Window Medium

Number of Anagrams

Given a string s and a string p, return the number of start indices of p's anagrams in s. Example: Input: s = 'cbaebabacd', p = 'abc' Output: 2 (Found anagrams of 'abc' at indices 0 and 6.)

Key concepts

sliding_windowstringpermutation

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.