FastPrepMultiset Intersection of Three Lists
Problems/Multiset Intersection of Three Lists

Multiset Intersection of Three Lists

ZipRecruiter logoZipRecruiter● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad phone-screen report describes the intersection of three lists and a follow-up where duplicates are limited by occurrences. The report does not keep the output order, limits, or a function signature, so our version returns the multiset in ascending order and supplies those details.

You are given three integer arrays, first, second, and third.

Return their multiset intersection in ascending order. Each value must appear exactly the minimum of its frequencies across the three arrays. Every input occurrence may be used at most once.

Function

multisetIntersection(first: int[], second: int[], third: int[]) → int[]

Examples

Example 1

first = [2,2,3,4,5]second = [2,2,2,3]third = [1,2,2,3,3]return = [2,2,3]

Value 2 occurs at least twice in every array, while value 3 occurs at least once.

Example 2

first = [1,1,2]second = [1,2,2]third = [1,1,1,2]return = [1,2]

The minimum frequency of each of 1 and 2 is one.

Constraints

  • 0 <= first.length,second.length,third.length <= 100000
  • -1000000000 <= value <= 1000000000

More ZipRecruiter Phone Screen questions

  • Neighboring Record IDsPHONE SCREEN · Seen May 2026
  • Restaurant Vote LeadersPHONE SCREEN · ONSITE INTERVIEW · Seen Feb 2026
  • Most Frequent Word across Grouped ArraysPHONE SCREEN · Seen Sep 2024
  • Starting Value with the Longest Collatz ChainPHONE SCREEN · Seen Apr 2022
  • Classify an Alien Dictionary OrderingPHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2022
  • Find the Smallest Magic IndexPHONE SCREEN · Seen Dec 2021
  • Website Pair with the Most Common VisitorsPHONE SCREEN · Seen Nov 2021
  • Center-Outward Number SpiralPHONE SCREEN · Seen Jun 2021
  • Missing Ranges within Inclusive BoundsPHONE SCREEN · Seen Feb 2021
  • Fibonacci Number with Constant Extra SpacePHONE SCREEN · Seen Mar 2017

Similar questions at other companies

  • Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • Filter, Sort, and Deduplicate Scheduled TasksRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN
  • Longest Consecutive SequenceJP Morgan Chase · PHONE SCREENJP Morgan Chase interview questions
  • Top K Frequent Elements with a Recency TiebreakSwiggy · PHONE SCREEN
  • Pins Violation Log QueriesPinterest · PHONE SCREENPinterest interview questions
  • Group AnagramsWorkday · PHONE SCREEN
  • Build a Task and Subtask HierarchyStripe · PHONE SCREENStripe interview questions
  • Find All Points Within a RadiusGoogle · PHONE SCREENGoogle interview questions
  • Resource Reconciler: Plan and Apply CreatesPerplexity AI · PHONE SCREENPerplexity AI interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public int[] multisetIntersection(int[] first, int[] second, int[] third) {
        // Write your code here.
    }

}
Checking account…