Round 1
Questions:
-
Given two arrays
arr1
andarr2
, you can swap 2 elements of the array any number of times. Find the max possible sum of i*(arr2[i]-arr1[i]) for 1 <= i <= n. -
You are given a supercomputer with multiple processors arranged sequentially in a row from 1 to n. For the ith processor, the efficiency of the ith processor is
no_adjacent[i]
,one_adjacent[i]
, orboth_adjacent[i]
when neither, one, or both adjacent processors is deployed before processor i. The 1st and nth processors can only have one adjacent. Find the max possible sum of efficiencies amongst all possible orders of deployment. -
CountGoodSubsequences. Conditions for good:
- All elements in the sequence are unique.
- If the minimum in the sequence is
a
and the maximum isb
, then all numbers in the range [a, b] should be present in the sequence.
Candidate's Approach
The candidate reported feeling hopeless after the test, managing to pass only 1 test case in one question and 2 test cases in another. Specific approaches to the questions were not detailed.
Interviewer's Feedback
No feedback provided.