Electronic Arts Interview Question

Find repeating number in array from 1 to n. O(1) space. Only one element is repeating.

Interview Answers

Anonymous

Dec 4, 2019

Answer: n - (sum(1 to n) - sum(array with repeating number))

2

Anonymous

May 28, 2020

leetcode 287

Anonymous

Dec 15, 2020

It's essential to demonstrate that you can really go deep... there are plenty of followup questions and (sometimes tangential) angles to explore. There's a lot of Software Engineer experts who've worked at Electronic Arts, who provide this sort of practice through mock interviews. There's a whole list of them curated on Prepfully. prepfully.com/practice-interviews