This is a verified interview question from Microsoft. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Maximum Size of a Valid Team - Microsoft (L60 SWE)" covers key patterns like Other.
"You are given n developers with unique skill levels from 1 to n. Each developer i has: - lowerSkill[i]: the maximum number of selected developers having a lower skill level than developer i. - higherSkill[i]: the maximum number of selected developers having a higher skill level than developer i. Your task is to select the largest possible subset of developers such that every selected developer is satisfied. For every selected developer i: - Number of selected developers with lower skill than i ≤ lowerSkill[i] - Number of selected developers with higher skill than i ≤ higherSkill[i] Return the maximum size of a valid team."
Join thousands of developers practicing for Microsoft.