FastPrepFrequency Equals Card Value
Problems/Frequency Equals Card Value

Frequency Equals Card Value

InMobi logoInMobi● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an InMobi phone screen. The title in the report points to a different deck-grouping problem. But its body and examples all ask whether some card value equals its own frequency. Our version follows the body. It is about 96% the same as the reported question.

You are given an integer array deck, where each integer is the value written on one card.

Return true if there is at least one integer x that appears exactly x times in deck. Otherwise, return false.

Function

hasValueWithMatchingFrequency(deck: int[]) → boolean

Examples

Example 1

deck = [1,1,1,2,2,3]return = true

The value 2 appears exactly 2 times, so the condition is satisfied.

Example 2

deck = [1,1,2,2,2,3,3]return = false

The frequencies of values 1, 2, and 3 are 2, 3, and 2. None equals its card value.

Constraints

  • 2 <= deck.length <= 10^4
  • 1 <= deck[i] <= 4 * 10^4

More InMobi Phone Screen questions

  • House Robber IPHONE SCREEN · Seen Aug 2026
  • Word Break IIPHONE SCREEN · Seen Aug 2026
  • Bus Station Seat AllotmentPHONE SCREEN · Seen Mar 2026
  • Find Missing and Duplicate IntegerPHONE SCREEN · Seen Mar 2026
  • Frog Position After T SecondsPHONE SCREEN · Seen Mar 2026
  • IPOPHONE SCREEN · Seen Mar 2026
  • Evaluate DivisionPHONE SCREEN · Seen Dec 2025
  • Compare Version NumbersPHONE SCREEN · Seen Feb 2022
  • Count Array DerangementsPHONE SCREEN · Seen Feb 2022
  • Maximum Frequency StackPHONE SCREEN · Seen Feb 2022

Similar questions at other companies

  • Find Unique ElementsCisco · PHONE SCREENCisco interview questions
  • Fixed-Range Frequency CountWaymo · PHONE SCREENWaymo interview questions
  • Count Pairs with Absolute Difference KAdobe · PHONE SCREENAdobe interview questions
  • Pair Left and Right Shoes by SizeMotive · PHONE SCREENMotive interview questions
  • Do All Frequencies Exceed a Threshold?Google · PHONE SCREENGoogle interview questions
  • Apply Operations to Make a String EmptyFlexport · PHONE SCREENFlexport interview questions
  • Find Valid SET Card TriplesSnowflake · OA · PHONE SCREENSnowflake interview questions
  • Best Poker Category with a JokerScale AI · PHONE SCREEN · ONSITE INTERVIEWScale AI interview questions
  • Find All Zip Rummy MeldsZip · PHONE SCREEN · ONSITE INTERVIEWZip interview questions
  • Most Common Three-Website SequencesAmazon · PHONE SCREEN
All InMobi interview questionsSee InMobi hiring insights
Saved
class Solution {
    public boolean hasValueWithMatchingFrequency(int[] deck) {
        // Write your code here
    }
}
Checking account…