RENAULT NISSAN TECH Hiring | Online Assessment Question | Off-Campus (2023)
Question · Posted Jun 2026
Q1: Most Frequent Number Following Key In an Array Problem Statement Given an integer array nums and an integer key, every occurrence of key (except the last element) has a follower—the element immediately after it. Return the number that appears most frequently immediately after key. Example Input nums = [1,100,200,1,100] key = 1 Output 100 Explanation Followers of 1 are: 100 100 The most frequent follower is 100. Constraints 2 <= nums.length <= 1000 1 <= key <= 1000
The full answer & interview discussion are available to premium members.
Log in Create a free account