Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Find Anagrams Window

Python data engineering interview problem. Difficulty: intermediate. Pattern: Sliding Window. About 14 minutes. Part of the Pro drill bank.

Same behavior as find_anagrams: start indices of anagram windows. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

Implement find_anagrams_window(s: str, p: str) -> list with the same behavior as find_anagrams.

Requirements

  • Return ascending indices.

Constraints

  • Identical semantics to problem 31.

Examples

Input: find_anagrams_window('cbaebabacd', 'abc') Output: [0, 6] Same hits as find_anagrams.

Topics: lakebench, python, anagram, window.

More Python interview questions · All interview problems · Learn data engineering

intermediate

Find Anagrams Window

Interview-style drill: Same behavior as find_anagrams: start indices of anagram windows.

Implement `find_anagrams_window(s: str, p: str) -> list` with the same behavior as `find_anagrams`. Example: `"cbaebabacd", "abc"` → `[0, 6]`. Keep the harness.