All problems

Employees Missing a Manager

easyPythonNull Handling

Kestrel Labs is tidying its org chart ahead of a compliance audit. Every employee record carries a manager field holding the name of the person they report to — except that some rows have nothing in it. A few of those are department heads who genuinely report to nobody; others may simply be gaps that were never filled in. The auditor wants all of them listed either way, so somebody can go and ask.

Records older than a certain date were signed off in an earlier audit and are out of scope. That date moves every time an audit closes, so it comes with the request rather than being written into the checklist.

Worth knowing before you start: an absent value in pandas is not an empty string and not a zero. It is its own kind of thing, with its own rules.

employees_df — one row per employee. manager holds the name of the person they report to, or None where no manager is recorded.

id name department salary hire_date manager
1 Ava Chen Engineering 145000 2021-03-14 None
2 Ben Ortiz Engineering 118000 2022-06-01 Ava Chen
3 Cara Novak Engineering 121000 2023-01-10 Ava Chen
4 Deshawn Lee Sales 95000 2020-09-23 None
5 Elin Kask Sales 88000 2022-11-05 Deshawn Lee
6 Farid Amiri Marketing 76000 2023-04-18 None
7 Grace Kim Data 132000 2021-07-30 None
8 Hugo Silva Data 110000 2023-02-14 Grace Kim
9 Ines Duarte Data 104000 2023-08-01 Grace Kim
10 Jonas Weber Sales 91000 2021-12-19 Deshawn Lee

Input

The DataFrame above is already built for you — the employee rows are not read from input. What does arrive is a single line holding the cutoff date, written the way hire_date is written, as YYYY-MM-DD.

Task: Print a sorted Python list of the names of employees hired on or after that date who have no manager recorded. The cutoff is inclusive: somebody hired exactly on it is in scope. If nothing in scope has a gap, print an empty list.

Example: if two people in scope had an empty manager field, the output would look like ['Ada Bloom', 'Zeno Marsh'].

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…