Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 34. Find First and Last Position of Element in Sorted Array
Given a sorted (non-decreasing) array, return the starting and ending indices of a target value (or [-1, -1] if it’s not present). The challenge is to do this in O(log n) time by locating the leftmost and rightmost occurrences (e.g., with binary-search boundary searches).
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late September, 2025
Meta
Mid-level
Early September, 2025
Meta
Senior
Early September, 2025
Meta
Senior
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.