New
Dark mode is now available across the site
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Microsoft
Coding Question
AI Insights
Quick Summary
Find the first occurrence index of a target value in a sorted array.
If the target is absent, return the index of the largest element less than or equal to the target.
Requires modified binary search boundaries to handle duplicates and floor-value fallback.
What This Tests
Binary search boundary manipulation
Handling duplicate elements correctly
Edge case management for out-of-range targets
Post-loop pointer state interpretation
Common Patterns
Binary Search
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected