Hacker News new | ask | show | jobs
by eggie5 1993 days ago
I've gotten the question in ML eng interviews 3 times: implement sparse vector and the respective dot product op. I always go for the handy DOK method.
2 comments

I got the same question in a non-ml interview (although the interviewer works on ml), DOK is the solution I naturally thought of. But that isn’t enough, the interviewer was looking for LIL for less overhead and type uniformity.
how one could prepare for such interviews? i know google is the place to start, but if you could point some source would really appreciate it!
I think you are missing one of the two pieces the question builds on: Linear Algebra (do you know how a dot product is defined?) or Datastructures including their complexity. You would prepare by reading up on whichever of these two you are missing.

If you know how it's supposed to work in theory but struggle to bang it out, you could do eg leetcode.

lol