FastPrepDo All Frequencies Exceed a Threshold?
Problems/Do All Frequencies Exceed a Threshold?

Do All Frequencies Exceed a Threshold?

Google logoGoogle● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report asks whether every distinct value's frequency is above a given threshold. We made the comparison strict, defined the true or false return, and treat empty input as true. Our version is about 86% the same as the reported question.

Given an integer array nums and a nonnegative integer threshold, return true exactly when every distinct value in nums appears strictly more than threshold times.

An empty array returns true because it contains no value that violates the rule.

Function

allFrequenciesExceed(nums: int[], threshold: int) → boolean

Examples

Example 1

nums = [1,1,2,2]threshold = 1return = true

Both distinct values occur twice, which is strictly greater than 1.

Example 2

nums = [1,1,2]threshold = 1return = false

Value 2 occurs only once, so it does not exceed the threshold.

Example 3

nums = []threshold = 0return = true

No distinct value violates the requirement.

Constraints

  • 0 <= nums.length <= 200000.
  • -10^9 <= nums[i] <= 10^9.
  • 0 <= threshold <= nums.length.

More Google Phone Screen questions

  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Periodic-Color Binary Forest RootsPHONE SCREEN · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

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
  • Frequency Equals Card ValueInMobi · PHONE SCREENInMobi interview questions
  • Pair Left and Right Shoes by SizeMotive · PHONE SCREENMotive 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

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public boolean allFrequenciesExceed(int[] nums, int threshold) {
        // Write your code here.
    }
}
Checking account…