John Venn (Analyst Program :)
Updated
Problem statement
Write a program that accepts two sets of alpha-numeric characters and performs an efficient matching between them. Finally, display the results.
The intent of this challenge is to play with set theory. Avoid using pre-built framework functions that perform this work in a single line of code. Instead, illustrate how you would efficiently operate with two sets of data when trying to match values between them.
There are many ways to approach this algorithm so be creative.
Input:
Two lines of input, each with a space-delimited series of values that represent the two sets.
Output:
The set of values that exist in both input sets sorted alpha-numerically.
If no common values exist, output NULL.
꒰ chizzy_elect ꒱ؘ SHINE!࿐ ࿔*:・゚
Function
matchSets(set1: String[], set2: String[]) → StringExamples
Example 1
set1 = ["1", "2", "3", "A", "B", "C"]set2 = ["X", "11", "G", "M", "2", "9", "3", "C", "N", "R"]return = "2 3 C"An educated guess -
The values 2, 3, and C are present in both sets. After sorting them alpha-numerically, the output is 2 3 C.
Constraints
🍉🍉
More BlackRock interview questions
- Find Minimum TimeOA · Seen Nov 2026
- Count LevelsOA · Seen Sep 2026
- Valid ParenthesesOA · Seen Sep 2026
- Lowest Common Ancestor in a Parent TreeOA · Seen Sep 2026
- Road Trip (Analyst Program :POA · Seen Aug 2026
- Set IntersectionOA · Seen Aug 2026
- Process SchedulingPHONE SCREEN · Seen Mar 2026
- Corporate LadderOA · Seen Jul 2024
- Happy NumberOA · Seen Jul 2024
Similar questions at other companies
- Build the Task HierarchyPendo · OA
- Macaron Order with Set DiscountsShopify · OAShopify interview questions
- Count User Mentions in Chat MessagesRamp · OARamp interview questions
- Blood Type Inheritance: Possible Parent GenotypesAbridge · OAAbridge interview questions
- Count Repeated Request IDs (Data Science OA)McKinsey & Company · OAMcKinsey & Company interview questions
- Minimum Magic Stones After MergesElevenLabs · OAElevenLabs interview questions
- Flat JSON Value DifferencesChubb · OAChubb interview questions
- Items SortAkuna Capital · OAAkuna Capital interview questions
- Count Cross-Array Target-Sum PairsVisa · OAVisa interview questions
- Get Search ResultsJP Morgan Chase · OAJP Morgan Chase interview questions