The coding round was the GPU credit problem, and it was actually pretty simple — the whole thing was only about 30-40 lines of code.
- add_credit
- subtract
- get_balance
Three functions. I used two heaps to maintain the credit entities and the subtraction events. The first two functions were just simple heappush calls. get_balance was a little more complex — mainly because subtract needs to prioritize using up the credits that expire earlier. There wasn't really any memoization involved either; I just recalculated get_balance from scratch every time, since the interviewer explicitly said not to worry about performance. They gave 4 test cases directly, and after I passed all of them we talked a bit about optimization ideas. This round — code plus debug plus fix — took just over 30 minutes total, which makes it one of the easier ones in the coding question pool.
For the Design round, when I saw the extra prep material the recruiter sent me two days before the interview, something already felt off — it said something about not ignoring the frontend part — but I still prepared it as a backend design. Then right at the start I got blindsided: it turned out to be a fullstack design, and the interviewer had specifically spent many years doing frontend work. I was stunned, but since the timeline was pretty tight and I didn't want to reschedule, I just gritted my teeth and went for it.
The doc was two or three pages, including the requirements and a simple demo — a screenshot plus a GIF, and I had to stare at that GIF several times before I actually understood it.
I'd glanced at the problem a little beforehand, but I never really focused on it — the frontend part was basically me just winging it, and I had no idea where the focus should even be. It wasn't until after the interview that I remembered that when I talked to HR earlier, I'd picked "Fullstack" as a strength — but honestly I haven't done much frontend work in recent years, and what I have done was simple implementation. I'd never actually studied fullstack design for real.
This one's probably 99% a fail. All I can do now is hope HR takes pity and gives me an extra design round.
Discussion
Loading comments…