SIGMOID Hiring | Most Frequent Even Element Problem | On-Campus Online Assessment (2024)

Sigmoid · Question · Posted Jun 2026

Problem Statement Given an integer array nums, return the most frequent even element in the array. If multiple even numbers have the same highest frequency, return the smallest even number among them. If there are no even numbers in the array, return -1. Example 1 Input nums = [0,1,2,2,4,4,1] Output 2 Explanation Frequency of even numbers: 0 → 1 2 → 2 4 → 2 Both 2 and 4 appear twice. Choose the smaller one: 2 Example 2 Input nums ...

The full answer & interview discussion are available to premium members.

Log in Create a free account