Ethos Life OA Question

Result
Ongoing
Posted
2 Mar 2025
344 reads

Summary

I encountered a challenging server load balancing problem during my online assessment for Ethos Life. The problem required careful consideration of manual offloading and an automated management tool to minimize operations.

How it went

During my online assessment with Ethos Life, I was presented with a complex algorithmic problem related to server load balancing. The task was to minimize the number of times a specific management tool was used, given that I could also manually offload tasks from a limited number of servers. This problem required a strategic approach to combine both methods efficiently.

Questions asked (1)

  1. 01

    Minimize Server Tool Operations for Load Balancing

    Data Structures & Algorithms

    Problem Statement

    You are given a set of servers, each with a different workload represented as an integer in an array serverLoad. The goal is to balance the server workloads by offloading tasks.

    You can offload tasks in two ways:

    1. Manually Offloading – You can manually offload tasks from at most k servers.
    2. Using the Management Tool – This tool:
      • Identifies the server with the highest workload, denoted as L.
      • Offloads tasks from all servers with a workload strictly greater than L/2 in a single operation.
      • Each time you use the tool, it incurs a resource cost.

    Your task is to minimize the number of times the tool is used while ensuring the workloads are balanced. Return the minimum number of times the tool must be operated.

    Example

    Input:

    serverLoad = [16, 12, 18, 10, 12]
    k = 2
    

    Output:

    1
    

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Ethos Life recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!