Meta, Amazon, and Google all ask this. It's the classic "modified binary search" problem. The skill tested: can you adapt binary search when the array isn't perfectly sorted? This thinking applies to many problems: search in bitonic array, peak element, first bad version. Interviewers may ask: "What if there are duplicates?" That's a harder variant (Search in Rotated Sorted Array II) where the worst case becomes .
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/binary-search/search-in-rotated-sorted-array-why-this-problem
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████████████████████████████████████████████████████████████████████████████████████████████████████████████