Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 219. Contains Duplicate II
Determine whether the array contains two equal elements whose indices differ by at most k — i.e., detect duplicates within a sliding window of size k+1 (array length up to 1e5, so an O(n) lookup-based approach is expected).
Asked at:
Amazon
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late July, 2025
Meta
Senior
Asked as it appears on LC
Mid March, 2025
Amazon
Mid-level
Early January, 2025
Meta
Staff
Find is there any subrarray of length K contains dupes. Moving window type of question.
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.