FastPrepCount Distinct Selections
Problems/Count Distinct Selections

Count Distinct Selections

Intuit logoIntuit● EasyINTERNOA

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report asks for unique selections but omits their representation. Integer IDs, empty behavior, and limits are practice assumptions; about 80% of the reported task is retained.

Each integer in selections identifies one selected item. Return how many different item IDs occur. Repeated selections count once. An empty sequence returns zero.

Function

countSelections(selections: int[]) → int

Examples

Example 1

selections = [4,2,4,7,2]return = 3

The IDs are 2, 4, and 7.

Example 2

selections = []return = 0

No item was selected.

Constraints

  • For this exercise, assume at most 200000 selections and IDs between -10^9 and 10^9.

More Intuit Online Assessment questions

  • Employee Promotion OpportunitiesOA · Seen Oct 2026
  • Next Pascal Row CoefficientOA · Seen Oct 2026
  • Parse Router LogsOA · Seen Oct 2026
  • Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
  • Maximum Square-Free DivisorOA · Seen Oct 2026
  • Two Tribes from Taller-Person CountsOA · Seen Oct 2026
  • Shortest Path from an Encoded GraphOA · Seen Sep 2026
  • Oldest and Youngest EmployeesOA · Seen Sep 2026
  • Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
  • Submask Sum QueriesOA · Seen Sep 2026

Similar questions at other companies

  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Count Valid Square PairsAuxoAI · OA
  • Two SumAmazon · OA · PHONE SCREEN
  • Find Words That Can Be Formed by CharactersTabaPay · OA
  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Word Frequency Counts in Alphabetical OrderAbridge · OAAbridge interview questions
  • Customer Signer ScreeningState Farm · OA
  • Minimum Magic Stones After MergesElevenLabs · OAElevenLabs interview questions
  • K Most Recent Unique Request IDsMicrosoft · OAMicrosoft interview questions
  • Distinct Products After Removing One ElementHSBC · OAHSBC interview questions

Interview reports that mention this question

  • Intuit OA: What It Tests (2026)

Intuit interview experiences

  • Intuit Software Engineering Intern - Full Stack OA Format
All Intuit interview questionsSee Intuit hiring insights
Saved
class Solution {
    public int countSelections(int[] selections) {
        // Write your code here
    }
}
Checking account…