1. Search Element in a Rotated Sorted Array Given a sorted array that has been rotated, the task is to find the index of a specific element. The array is initially sorted in ascending order and then rotated clockwise by an unknown amount. For example, a sorted array [1, 2, 3, 4, 5] rotated by 2 positions becomes [4, 5, 1, 2, 3]. You are required to answer multiple queries where for each query, you will search a particular element and return its index if found; otherwise, return -1. Your goal is to achieve this in O(logN) time complexity for each query. Input: NA1 A2 A3 ... ANQQ1Q2...QQ Output: An integer representing the index of the searched element for each query, or -1 if the element is not found. Example: Input: N = 5A = 4 5 1 2 3Q = 2key = 1key = 6 Output: 2-1 Constraints: 1 <= N <= 106 -109 <= A[i] <= 109 1 <= Q <= 500 -109 <= Q[i] <= 109 Time Limit: 1 sec Note: You only need to return the result, as printing is handled elsewhere.
2. Design MakeMyTrip. How does MakeMyTrip block a seat for 15 minutes even if the payment does not go through?
3. Design Twitter timeline