FastPrepArray Containment with Multiplicities
Problems/Array Containment with Multiplicities

Array Containment with Multiplicities

Expedia logoExpedia● EasyNEW GRADPHONE SCREEN

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Multiplicity and empty-input rules are practice assumptions. The array-containment task matches the source at about 90%.

Return whether available contains every occurrence requested by required. Each available position may be used at most once.

Order does not matter, but multiplicity does. An empty required array is always contained, including in an empty available array.

Function

containsAll(required: int[], available: int[]) → boolean

Examples

Example 1

required = [2,2]available = [1,2,2,3]return = true

The two requested copies of 2 use two different available positions.

Example 2

required = [2,2]available = [1,2,3]return = false

Only one copy of 2 is available, so the second request cannot be matched.

Constraints

  • 0 <= required.length, available.length <= 10000.
  • -1000000000 <= required[i], available[i] <= 1000000000.

More Expedia Phone Screen questions

  • Find the Shortest Round TripPHONE SCREEN · Seen Jul 2026
  • Two SumPHONE SCREEN · ONSITE INTERVIEW · Seen Feb 2024
  • Merge Two Sorted Linked ListsPHONE SCREEN · ONSITE INTERVIEW · Seen May 2023
  • Assign CookiesPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2022
  • Kth Smallest Value in a BSTPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2022
  • Reverse a Singly Linked ListPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2022
  • Climbing StairsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2021
  • First Substring OccurrencePHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2021
  • Merge Sorted Arrays in PlacePHONE SCREEN · ONSITE INTERVIEW · Seen May 2019
  • Subtract the Next Smaller ValuePHONE SCREEN · Seen Oct 2018

Similar questions at other companies

  • Majority ElementByteDance · PHONE SCREENByteDance interview questions
  • Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
  • Recommend Films from Viewers Who Watched Everything You DidBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Find Unique ElementsCisco · PHONE SCREENCisco interview questions
  • Shared Courses for Every Pair of StudentsCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Two SumAmazon · OA · PHONE SCREEN
  • Employee Count Median, Mean and ModeClay · PHONE SCREEN
  • Two SumBNSF Railway · PHONE SCREENBNSF Railway interview questions
  • Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
  • Cross-Day User Trust ScoresAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions

Interview reports that mention this question

  • Expedia New Grad SDE Oldest Loops: 4 Experiences (Part 3 of 3)

Expedia interview experiences

  • Expedia Intern Final Round in 2021: 28 Experiences (Part 4 of 6)
  • Expedia Intern Finals Before 2020: 14 Experiences (Part 6 of 6)
  • Expedia Intern Final Round in 2020: 24 Experiences (Part 5 of 6)
  • Expedia Intern Final Round in 2022: 15 Experiences (Part 3 of 6)
  • Expedia Intern Final Round in 2023: 17 Experiences (Part 2 of 6)
All Expedia interview questionsSee Expedia hiring insights
Saved
class Solution {
    public boolean containsAll(int[] required, int[] available) {
        // Write your code here.
    }

}
Checking account…