Question bank › Hashing
Dsa Hashing Warm-up

Frequent Items

Write a program that reads a list of integers and determines the most frequently occurring number. If there is a tie, print the smallest number among the most frequent ones. Your input will consist of a single line of space-separated integers. The output should be the most frequent number. Example: Input: 1 2 3 2 1 1 4 Output: 1

Key concepts

hashingfrequencyarrays

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.