Back to problems

Implement a Balanced Session Manager

Object-Oriented Programming · Palantir · Medium

Problem Statement Design a SessionManager class that distributes incoming sessions across a collection of servers while maintaining a near‑perfect balance. Balance Constraint You are given a set of servers (e.g., s1, s2, s3). After every assignment, the difference in session count between the most loaded and least loaded server must never exceed 1. For 24 total sessions the counts would be [8, 8, 8]; for 23 sessions, [8, 8, 7]. Duplicate Session ID Rule session_id values may…

Loading the rest of the question…