Actual Questions from iOS Interviews

Photo by ThisisEngineering RAEng on Unsplash

Find the median value

For this question I was asked to find the median value given two integer arrays. The solution I came up with involved first combining the two arrays, sorting them, and then checking if the length of the combined arrays is an even number.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store