I received an e-mail with a link to a home assignment that I had to complete within a week. It was a home assignment with two coding questions: one basic and one a bit harder. I had 65 minutes for both questions.
You are given an integer array arr of length n, and three integers x, y, and z.
You may select non-overlapping subarrays from arr.
Each chosen subarray must be of length 1, length 2, or length 3.
You can choose at most x subarrays of length 1.
You can choose at most y subarrays of length 2.
You can choose at most z subarrays of length 3.
Your goal is to maximize the total sum of all elements in the selected subarrays.
Return the maximum possible sum you can obtain under these constraints.
Input: arr (list of integers), x, y, z (non-negative integers)
Output: An integer representing the maximum total sum.
The following metrics were computed from 2 interview experiences for the Microsoft Software Engineer role in Israel, Israel.
Microsoft's interview process for their Software Engineer roles in Israel, Israel is extremely selective, failing the vast majority of engineers.
Candidates reported having very good feelings for Microsoft's Software Engineer interview process in Israel, Israel.