I've seen multiple companies ask candidates to write working code for machine learning end-to-end from scratch. As in, write a stochastic gradient descent logistic regression model with training, inference, etc. without any libraries beyond pandas/numpy If you're lucky they'll provide you the equations or let you google them. So something to memorize including the various numpy/pandas gotchas.
I wish. I saw it asked by otherwise great teams run by very competent people. It's done in place of a leetcode algo question and those are even more divorced from day to day work. System design questions make more sense but I've noticed that you score better on them if you study the area beforehand but convincingly lie that you barely know it (and are just that clever and fast on your feet). Interviews are a shit show in general.
Years back someone asked me an interview question to explain sd and confidence intervals. I just gave the wrong answers and left. Especially in nascent fields such as ML and DS, it’s very important to work with people who actually know what they are doing. Otherwise you will have wasted years of your precious twenties doing absolutely nothing productive.
That response applies to 80% of modern interview questions at tech companies. So if you want a job there you smile, keep quiet and answer the problem. Since the job at large companies usually involves putting up with BS it's probably not a bad filter either for candidates.