FastPrepPair Left and Right Shoes by Size
Problems/Pair Left and Right Shoes by Size

Pair Left and Right Shoes by Size

Motive logoMotive● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Motive phone-screen report for a full-time role states the goal of pairing left and right shoes by size. We chose the array limits and the function interface.

Our version is about 96% the same as the reported question.

A shoe rack contains left shoes and right shoes in various integer sizes. Given the sizes of every left shoe and every right shoe, return whether every shoe can be paired with exactly one opposite-side shoe of the same size.

Function

canPairShoes(leftSizes: int[], rightSizes: int[]) → boolean

Examples

Example 1

leftSizes = [7,8,7]rightSizes = [7,7,8]return = true

Every left shoe has one right shoe of the same size.

Example 2

leftSizes = [6,6]rightSizes = [6,7]return = false

One left size-6 shoe and the right size-7 shoe remain unmatched.

Constraints

  • 0 <= leftSizes.length, rightSizes.length <= 100000.
  • 1 <= size <= 1000000000.

More Motive Phone Screen questions

  • Group AnagramsPHONE SCREEN · ONSITE INTERVIEW · Seen Jan 2026
  • Longest Equal-Zero-One SubarrayPHONE SCREEN · ONSITE INTERVIEW · Seen Jan 2026
  • Valid Parenthesis StringPHONE SCREEN · ONSITE INTERVIEW · Seen Jan 2026
  • Search in Rotated Sorted ArrayPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2025
  • Lowest Common Ancestor in a Binary TreePHONE SCREEN · Seen Apr 2025
  • Mark a Queen’s Attack BoardPHONE SCREEN · Seen Feb 2025
  • Count Product-Divisible PairsPHONE SCREEN · Seen Sep 2024
  • Resolve Variable Equations with Dependency ErrorsPHONE SCREEN · Seen Jun 2024
  • Average Values by Binary-Tree LevelPHONE SCREEN · Seen May 2024
  • Chunked Round-Robin Row TraversalPHONE SCREEN · Seen May 2024

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
  • Do All Frequencies Exceed a Threshold?Google · PHONE SCREENGoogle 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
All Motive interview questionsSee Motive hiring insights
Saved
class Solution {
    public boolean canPairShoes(int[] leftSizes, int[] rightSizes) {
        // Return whether all shoes can be paired by size.
    }
}
Checking account…