Nutanix OA | MTS II - Python Automation Testing
Summary
I recently completed the Online Assessment (OA) for the MTS II - Python Automation Testing role at Nutanix. The assessment featured a dynamic programming problem that required optimal task scheduling on two types of servers to minimize cost.
Full Experience
I participated in the Online Assessment for the MTS II - Python Automation Testing position at Nutanix. The OA was conducted on the Hackerrank platform. I was presented with a problem that involved Data Engineers needing to schedule long-running tasks on remote servers in a cost-effective manner. The challenge was to utilize both a paid server, which had variable costs and processing times for each task, and a free server, which processed tasks in a fixed time unit but only when the paid server was occupied. My goal was to determine the minimum total cost to complete all tasks by scheduling them optimally. The problem statement was quite detailed, providing an example and specific constraints to guide the solution.
Interview Questions (1)
Problem Statement:
Data Engineers in Leetcode need to schedule long-running tasks on remote servers cost-effectively.
They have access to two servers:
- A paid server that requires
cost[i]units to process taski - A free server that processes any task in exactly 1 time unit, but can only be used when the paid server is occupied
Each task i requires time 'i' units to complete on the paid server.
Determine the minimum total cost to complete all tasks by scheduling them optimally.
Example:
Suppose n = 4, cost = [1, 1, 3, 4] and time = [3, 1, 2, 3]
- The first task must be scheduled on the paid server for a cost of 1 and it takes 3 units of time to complete. In the meantime, the other three tasks are executed on the free server for no cost as the free server takes only 1 unit to complete any task. Return the total cost.
Function Description:
int cost[n]: the costs of scheduling the tasks on a remote serverint time[n]: the times taken to run the tasks on a remote server
Return:
int: the minimum cost to complete all the tasks
Constraints:
1 ≤ n ≤ 10^31 ≤ cost[i] ≤ 10^61 ≤ time[i] ≤ 10^3