Skip to main content

Analytics Reducer

Challenge on lesson: Checkpoint: Functional & Collectors

Build Solution analytics over record Event(String user, String type, int ms): - static Map<String, Long> eventsByType(List<Event> events) — counts per type (Long values). - static Map<String, Integer> msByUser(List<Event> events) — total ms per user (merge duplicates with sum). - static Map<Boolean, List<String>> slowVsFast(List<Event> events, int threshold) — partition event *types* by whether their average ms exceeds the threshold (true bucket = slower). Types in each bucket sorted alphabetically.

Difficulty: intermediate

Back to lesson: Checkpoint: Functional & Collectors