Learning Technology Interview Questions

8,876 learning technology interview questions shared by candidates

A set S of n integers originally contains all of the numbers from 1 to n (and no other numbers). Due to corruption, exactly one of the numbers in the set S is duplicated onto another number in the set. The corrupted set has the integers 1 to n, with one number repeated and one missing number. Neither the original nor the corrupted sets are guaranteed to be in order. The original array is not given to us. Write a function which takes an integer array of arbitrary length at runtime (the corrupted set) as input, and returns the duplicated number and the missing number as an array.
avatar

Deep Learning Engineer

Interviewed at Forterra

4.1
Nov 5, 2024

A set S of n integers originally contains all of the numbers from 1 to n (and no other numbers). Due to corruption, exactly one of the numbers in the set S is duplicated onto another number in the set. The corrupted set has the integers 1 to n, with one number repeated and one missing number. Neither the original nor the corrupted sets are guaranteed to be in order. The original array is not given to us. Write a function which takes an integer array of arbitrary length at runtime (the corrupted set) as input, and returns the duplicated number and the missing number as an array.

Viewing 7361 - 7370 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 8,876 interview questions and reports from Learning technology interviews. Prepare for your interview. Get hired. Love your job.