Pergunta de entrevista da empresa Ruangguru.com

Coding Interview: Level 1 1. Given a dictionary input where it has departments as keys and employee ids as values: Print out an array of arrays where: 1. Each department that has the same number of employees are put in the same array 2. The arrays are ordered based on how many employees are in the departments that are in the array. 3. The departments appear in their natural ordering. Sample Input {"general": [2, 3, 4], "infra": [3, 5], "humor": [4, 6]} Sample Output [["infra", "humor"], ["general"]]

Resposta da entrevista

Sigiloso

4 de out. de 2021

For the first one I used Python. Python has this unique feature where the dictionaries are ordered relative to their key. So simple iteration of the keys is all i need for Level 1.