The assessment contained two straightforward coding problems: one about categorizing exam scores and another about scheduling book chapters across multiple evenings. Both focused on basic array processing and careful handling of conditions rather than advanced algorithms.
You are given an integer array results containing the exam scores of N students. Each score represents a percentage. Students are divided into three categories based on their scores:
Failed: Score strictly below 50.
Passed without Honors: Score between 50 and 80, inclusive.
Passed with Honors: Score strictly above 80.
Your task is to count how many students belong to each category. Return an integer array containing exactly three elements in the following order: [failed_count, passed_without_honors_count, passed_with_honors_count]
Example 1 — Mixed Exam Results
Input:
results = [49, 50, 80, 82, 95, 64, 73]
Output:
[1, 4, 2]
Explanation:
Failed: 49 → 1 student
Passed without Honors: 50, 80, 64, 73 → 4 students
Passed with Honors: 82, 95 → 2 students
Input:
results = [49, 50, 80, 82, 95, 64, 73]
Output:
[1, 4, 2]
Explanation:
Failed: 49 → 1 student
Passed without Honors: 50, 80, 64, 73 → 4 students
Passed with Honors: 82, 95 → 2 students
Example 2 — All Students Fail
Input:
results = [12, 35, 48]
Output:
[3, 0, 0]
Explanation:
All three students scored below 50.
Input:
results = [12, 35, 48]
Output:
[3, 0, 0]
Explanation:
All three students scored below 50.
Example 3 — Only Extreme Scores
Input:
results = [15, 97]
Output:
[1, 0, 1]
Explanation:
One student failed and one passed with honors.
No
Input:
results = [15, 97]
Output:
[1, 0, 1]
Explanation:
One student failed and one passed with honors.
No
Unlock Full Details
Create a free account to unlock this interview experience report.