Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Find Duplicate Values in Array

Easy
EasyCodingHash TablesArraysSortingAsked 3 times

Problem

Given an integer array nums, return all values that appear more than once. Each duplicate should appear only once in the output, in the order it is first detected as a repeat during a left-to-right scan.

Constraints

  • 1 <= len(nums) <= 10^5
  • -10^9 <= nums[i] <= 10^9
  • Each duplicate value should appear at most once in the result
Practicing as: Mobile Engineer interview at Button

Hi, I'll play your Button interviewer for the Mobile Engineer role. Candidates describe these interviews as mostly positive and moderately difficult, so expect me to be friendly and conversational. Take your time with the question above and answer like we're in the room.

Take this as a live interview session →

You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.

Sign up freeI have an account
def solve(rows):
    counts = {}
    for row in rows:
        ...
    return result
Sign up to unlock solutions
First Orion Mobile Engineer Interview QuestionsZynga Mobile Engineer Interview QuestionsButton Mobile Engineer Interview QuestionsFirst Orion Interview QuestionsTop 50 Sorting Interview Questions
Next questions
OpenTextFind Duplicate Values in ArrayEasyAccentureFind Duplicates in Integer ArrayEasyBae Systems UsaDetect Duplicates in ArrayEasy