FastPrepFind the Duplicate Values
Problems/Find the Duplicate Values

Find the Duplicate Values

Airbnb logoAirbnb● MediumINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported by a candidate for an Airbnb software engineer role in Berkeley, California, from a referral-based phone screen in October 2016. The post hints that the opening was for interns.

The report gives only the name of the task: picking out the repeated values in a list. Everything else is our own choice. You get an integer array whose values run from 1 to its length, with no value more than twice, and you return the values that show up twice, smallest first. The limits and the examples are ours too.

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

You are given an integer array nums of length n. Every value in nums is between 1 and n, and no value appears more than twice.

Return every value that appears twice in nums, in increasing order. If no value appears twice, return an empty list.

Function

findDuplicates(nums: int[]) → List<Integer>

Examples

Example 1

nums = [5,1,5,2,6,1]return = [1,5]

Here n = 6. The value 5 is at indices 0 and 2, and the value 1 is at indices 1 and 5. The values 2 and 6 appear once, and 3 and 4 do not appear. In increasing order the answer is [1,5].

Example 2

nums = [3,1,2]return = []

Each of 1, 2 and 3 appears exactly once, so no value appears twice and the answer is an empty list.

Example 3

nums = [4,4,3,3]return = [3,4]

Both 4 and 3 appear twice. The pair of 4s comes first in the array, but the answer lists the values in increasing order, so it is [3,4].

Constraints

  • n == nums.length
  • 1 <= n <= 5 * 104
  • 1 <= nums[i] <= n
  • Each value appears in nums at most twice.

More Airbnb Phone Screen questions

  • Read Across Sound TracksPHONE SCREEN · Seen Nov 2026
  • Text JustificationPHONE SCREEN · Seen Nov 2026
  • Decode and Store StringsPHONE SCREEN · Seen Oct 2026
  • Print Sentences as TablePHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Detonate Bombs with Chain ReactionsPHONE SCREEN · Seen Aug 2026
  • Smallest Common RegionPHONE SCREEN · Seen Aug 2026
  • Longest Chain BookingPHONE SCREEN · Seen Aug 2026
  • Nested List Iterator with RemovePHONE SCREEN · Seen Jul 2026
  • Parse Query StringPHONE SCREEN · Seen May 2026
  • Pacific Atlantic Water FlowPHONE SCREEN · Seen May 2023

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
  • Merchant Matching, Parts 1–2: Shared Fields and Weighted ThresholdsStripe · PHONE SCREENStripe interview questions
  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN
  • Insert Delete GetRandom O(1)Charta Health · PHONE SCREENCharta Health interview questions
  • Longest Consecutive SequenceKotak Mahindra Bank · PHONE SCREENKotak Mahindra Bank interview questions
  • Longest Consecutive SequenceJP Morgan Chase · PHONE SCREENJP Morgan Chase interview questions
  • Logger Rate Limiter with Every-Arrival HistoryGoogle · PHONE SCREENGoogle interview questions
  • Propagating Fraud DetectorAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
  • Top K Frequent Elements with a Recency TiebreakSwiggy · PHONE SCREEN

Interview reports that mention this question

  • Airbnb Intern Phone Interviews: 21 Experiences (Part 7 of 7)

Airbnb interview experiences

  • Airbnb SWE OA: Four-Level Banking System: 1 Experience
  • Airbnb Campus and Full-Time SWE OA / Interviews: 9 Experiences
  • Airbnb Intern OA and Phone Screens: 17 Experiences (Part 6 of 7)
  • Airbnb Intern OA and Onsite Rounds: 16 Experiences (Part 5 of 7)
  • Airbnb Intern OA, Diplomacy Game: 19 Experiences (Part 4 of 7)
All Airbnb interview questionsSee Airbnb hiring insights
Saved
class Solution {
    public List<Integer> findDuplicates(int[] nums) {
      // Write your code here.
    }
}
Checking account…