The online assessment had 4 questions that needed to be solved in 70 minutes.
Q1) To return the index of the element that broke the alternating parity pattern of odd and even numbers.
Q2) An array of "A" and "P" resources, with all "A"s initially at the front and all "P"s at the back. Each cycle, you either convert "P"s to one "A" based on a conversionRate, or change the last "A" to a "P". The process continues until neither of these operations is possible. Your goal is to determine the total number of cycles before the process halts.
Q3) Managing an array representing memory, where 0 signifies free units and 1 signifies occupied. You need to process two types of queries: alloc x and erase ID. An alloc x query finds the leftmost contiguous block of x free units, starting at an index divisible by 8, marks them as occupied with a new ID, and returns that ID (or -1 if no such block exists). An erase ID query frees all memory units associated with the given ID and returns the length of the freed block (or -1 if the ID isn't found or already freed). The alloc operation assigns a unique, incrementing ID for each successful allocation.
4) A mountaineer is studying a mountain range represented by an array of peak heights. Due to optical illusion, they can only compare peaks that are at least a certain viewingGap number of positions apart. The task is to find the minimum possible absolute height difference between any two peaks that meet this viewingGap criteria. In essence, you need to find the smallest value of ∣heights[a]−heights[b]∣ where ∣a−b∣≥viewingGap. The output should be this minimum height difference.