The Number of Employees Who Met the Target problem gives you an array of hours worked by employees and a target value. Count how many employees worked at least the target number of hours. This is the simplest possible array filtering problem.
TCS and Amazon ask this easy problem as a quick coding screening to verify that candidates can write a basic array traversal with a conditional count. The array interview pattern is demonstrated at its most fundamental.
Linear scan with counter. Traverse the array. For each value ≥ target, increment a counter. Return the counter. Can also be written as sum(1 for h in hours if h >= target).
Hours: [0, 1, 2, 3, 4, 5], target=3. Values ≥ 3: 3, 4, 5. Count = 3.
Hours: [5, 1, 4, 2, 2], target=6. No value ≥ 6. Count = 0.
> target instead of >= target (must include target itself).Easy array counting problems test implementation speed and precision. The >= vs > distinction in threshold conditions is a common interview trap. Always re-read the problem statement to verify whether the threshold is inclusive or exclusive. Practice translating word problems ("at least," "more than," "no more than") to their corresponding comparison operators (>=, >, <=) quickly and accurately.