<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KVGHS6G" height="0" width="0" style="display:none;visibility:hidden"></iframe>

Patreon计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(1)
OOD(0)
Algorithm(1)
System Design(0)
高频题(0)
Math(0)
全部(1)
OOD(0)
Algorithm(1)
System Design(0)
高频题(0)
Math(0)
1.Determine if an employee is an IC or a manager, and count direct and total reports
1. Determine if an employee is an IC or a manager, and count direct and total reports
Given an organizational chart represented as a dictionary, write a function to determine if an employee is an Individual Contributor (IC) or a Manager, and count their direct and total reports. For example, given the following input: orgChart = { "a": { "a1": { "a11": None, "a12": None, "a16": { "a13": None, "a14": None, } }, "a2": None }, "b": None } The output should indicate that 'a' is a Manager with 2 direct reports and a total of 6 reports, while 'b' is an IC with 0 direct and total reports.