Analytics Reducer
Challenge on lesson: Checkpoint: Functional & Collectors
CHALLENGE
Difficulty: intermediate+25 XP
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.
Press Submit to check your solution.
Back to lesson: Checkpoint: Functional & Collectors