Arrays, Windows & Intervals
These problems come from SoFi's online assessment and phone screens, plus a couple from later coding rounds. The input is often already sorted. When it is, use it. An index or two that only moves forward runs in linear time, and the long hidden cases are there to time out a nested loop.
A couple of the problems are greedy. You sort once and then take the best move at each step. The interviewer will usually ask why that order works, so have a short reason ready instead of saying it felt right.
Watch your sums as well. Values reach 10^9 here, so a running total in a 32-bit int can wrap around without any error. Use a long in Java or C++ from the start. Each problem below is worked through with the pointer or sort that makes it fast, its complexity and the edge cases to test.
SoFiPremium lesson · Coding round
The 5 SoFi problems are below.
- A Premium questionCoding · Easy
- A Premium questionCoding · Medium
- A Premium questionCoding · Easy
+ 2 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the SoFi questions$49 a year · all 100 companies · cancel anytime
From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.
SoFi interview guideKnow what SoFi asks before you walk in.
25 coding · 2 system design · 24 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.