Skip to content
Interview Questions

Data Analyst Interview Questions & Answers: Set 7, Hospital & Healthcare

100 interview questions with model answers for freshers, set in Hospital & Healthcare: SQL, Excel, statistics, Python, Power BI, business cases, AI and behavioral.

  • Data Analyst
  • Hospital & Healthcare
  • Set 7 of 20
  • Data
  • SQL
  • Excel
  • Python
  • Power BI
  • AI

Free with login: questions 1 and 2 are open to everyone, all 100 after you log in.

Part of Bundle 4 · People, Public Sector & Final Mock

What's inside

  • 100 questions, each with a model answer
  • SQL · Excel · Statistics · Python · Power BI · Business Case · AI · Behavioral
  • SQL and Python answers include working code
  • Set 7 of 20 · read free on DS360 with login

Questions and answers

2 of 100 questions shown · Set 7 of 20 · Hospital & Healthcare

SQL

  1. 1.Find the average length of stay per department for patients admitted this year.

    Answer: Length of stay (LOS) is discharge date minus admission date, averaged per department. I assume admissions(admission_id, patient_id, department_id, admit_date, discharge_date) and departments(department_id, department_name). I filter to admissions this year and only count discharged patients, because current inpatients have no discharge date yet and would distort the average. Subtracting two DATE values in PostgreSQL gives whole days; with timestamps you would use EXTRACT(EPOCH ...) / 86400.

    SQL
    SELECT d.department_name,
           COUNT(*) AS admissions,
           ROUND(AVG(a.discharge_date - a.admit_date), 1) AS avg_los_days
    FROM admissions a
    JOIN departments d ON d.department_id = a.department_id
    WHERE a.admit_date >= DATE_TRUNC('year', CURRENT_DATE)
      AND a.discharge_date IS NOT NULL
    GROUP BY d.department_name
    ORDER BY avg_los_days DESC;
  2. 2.Find patients readmitted within 30 days of discharge.

    Answer: A readmission is a new admission for the same patient within 30 days after a previous discharge. The cleanest way is LEAD() to get each patient's next admission date, then compare it with the current discharge date. Table: admissions(admission_id, patient_id, admit_date, discharge_date). In real reporting you would usually exclude planned readmissions (e.g. scheduled chemotherapy) and transfers, so agree the definition with clinicians first.

    SQL
    WITH ordered AS (
      SELECT patient_id, admission_id, admit_date, discharge_date,
             LEAD(admit_date) OVER (PARTITION BY patient_id
                                    ORDER BY admit_date) AS next_admit
      FROM admissions
    )
    SELECT patient_id, admission_id, discharge_date, next_admit,
           next_admit - discharge_date AS days_to_readmit
    FROM ordered
    WHERE next_admit IS NOT NULL
      AND next_admit - discharge_date BETWEEN 0 AND 30;

Loading all 100 questions…

Related resources

See all resources →