1. Homework. String replacement for a matching pattern.
2. Follow up of homework. Such as how to improve efficiency.
3. White board coding. Interviewer used some database tables from their daily work. Let me tell another story. Company ABC has several offices and HQ is in NYC. In Covid-19, IT department needs a few employee to work in HQ office a few days every week and the rest work from home. We have following table:
HQOfficeAttendance( employee_id, work_date);
TotalAttendance( employee_id, work_date);
Department( employee_id, depart_id);
Q1: how many attendance for IT department in HQ office for every month in the past year?
Q2: how many attendance EXCEPT IT department in HQ office for every month in the past year? Note: one IT employee could work at both office and home, but not in same day. ( I make a mistake in the left join )
Q3: follow up. How to design an API to query it?