Their DE role is titled SDE too, and the interview process is the same as the SDE one. I prepared a dozen or so questions from interview reports, but I didn't prepare this one. I stumbled my way through writing it, and the interviewer gave me a lot of hints. I blame myself for not preparing enough. I just moved on.
The Splitwise question, the one listed for Pinterest. It is exactly the same problem as that listed question.
At first there was no limit on the number of transactions. My solution was to split the balances into a positive group and a negative group and use two pointers.
The follow-up was the minimum number of transactions. The interviewer hinted at using a heap, going from the largest to the smallest, but I ran out of time to write it.
Discussion
Loading comments…