Live data from Hacker News

Data science interview questions with answers

github.com

21–30 of 75 posts

Re: Data science interview questions with answers

#21

Earlier quoted context omitted.

I think it's a bit far fetched to assume that recruiters tailor interview questions based on these Github repo's. For me as a junior data scientist it really useful to test my own knowledge and highlight areas which I need to study more.

Lots of tech and finance companies (particularly those with standardized interview processes) will blacklist questions if they're found online. Those companies will constantly check GitHub, GeeksForGeeks and Leetcode to see if their questions are listed there with solutions. This probably won't be the case for a question as basic as, "what is regression?" But for any intermediate to advanced interview question involv…

A couple recommendations piggybacking off of yours:

A First Course in Probability has a lot of problems (with solutions) and worked examples, but it’s light on intuition and pedagogy. It’s not an easy book to learn from, on its own. I highly recommend listening to Joe Blitzstein’s STAT 110 lectures and reviewing the wealth of problems/notes. The greater mastery of probability theory that you have, the easier studying ML and stats is. https://projects.iq.harvard.edu/stat110/home

Elements of Statistical Learning is a true textbook—a comprehensive bible that could occupy you for many thousands of hours. ISLR is the better book for a crash course: http://faculty.marshall.usc.edu/gareth-james/ISL/

There are also lectures and slides from the authors: https://www.dataschool.io/15-hours-of-expert-machine-learnin...

Re: Data science interview questions with answers

#22

Do people realize that, these interview question collection do not help? I think there is 2 things to address here: - Interviewers will know "what is known" by every candidate (with the help of these pages) and harder questions will be asked - If these questions are asked at >junior levels, then RUN! the work will not satisfy you. The interview should be fun, and show the creativity of the candidate. These ones could…

Having somewhat standard "objective" questions helps even with senior candidates. You'd be surprised how many senior's would struggle with the basics, or who aren't as senior as their resume would lead you to believe.

Re: Data science interview questions with answers

#23

The quality and depth of answers here is pretty inconsistent. But this in particular is a pet peeve of mine: > Plot a histogram out of the sampled data. If you can fit the bell-shaped "normal" curve to the histogram, then the hypothesis that the underlying random variable follows the normal distribution can not be rejected. This is commonly taught in undergrad stats, but you shouldn't do this. I'm of the opinion that…

The visual test is the best. By far the biggest problem among data scientists is being too theoretical and relying too much on statistical tests and metrics instead of common sense and visualizations. I've worked with many quantitative researchers in the finance industry and those that are successful are always the least theoretical, do not rely on tests, and everything is visualized heavily and conclusions inferred from that. Gut feeling, intuition and visuals are the best protection against over-fitting, p-hacking and self-deception.

Re: Data science interview questions with answers

#24
I have to agree that these interview questions function more as a cheatsheet review than actually anything practical that would be seen in an interview. Data science interviews don't function as a biology test where you're just rattling off memorizations to how neural networks or linear models work.

Ultimately these types of questions like "What is feature selection" are more likely to be encapsulated into case studies where the answer to the question itself will be, using feature selection.

For example: "Let's say you have thousands of categorical features for an anonymized dataset involving human traits, how would you figure out which predictors are the most important?"

Source: https://www.interviewquery.com/

Re: Data science interview questions with answers

#25
The weirdest thing about data science interviews (when I was actively interviewing) is SQL gotcha questions. Especially with window functions. Here's a long HN thread a few months ago about an annoying situation with an interviewer asserting uncommon syntax is common: https://news.ycombinator.com/item?id=23053981

Another related SQL gotcha I saw multiple times is finding the top n records of each group in a table. Which is a know-it-or-you-don't implementation, and the interviewer can still be a jerk if they want by slamming the interviewee if they include ties, or not (RANK vs. ROW_NUMBER).

It's telling that there aren't any SQL window function examples in this repo.

Another fun aspect of SQL interviews is dialect-specific questions, particularly with how date/times are handled. Years ago, a company famous/infamous for primarily using mySQL explicitly noted in a take-home assignment problem definition that the database was PostgreSQL, which allowed them to ask the aforementioned window question problem, the AT TIME ZONE syntax for filter, and allow a specific definition for "beginning of week" which required me to download the database and test it manually.

Re: Data science interview questions with answers

#26

Linear regression does not require errors to be iid, normal, and homoscedastic for it to "work". One of the ways to separate candidates is to push on what (and how) assumptions can be weakened, what the consequences are for estimation and inference, and what sort of corrections can be incorporated for maintaining consistency, improving efficiency, correcting biases, etc. An entry level candidate may not have (nor nee…

Interesting and perhaps shows the cultural differences between ML and stats people. I took a machine learning course in my bachelor's and two more ML courses in my master's (CS). These weren't some "deep learning lite", mess-around-in-Keras courses, because DL wasn't even big back then. We covered lots of stuff, Bayesian linear regression, Gaussian processes, Gibbs sampling, Metropolis-Hastings, hierarchical Dirichlet processes, SVMs, multi-class SVM, PCA, kernel PCA, perceptrons, CMAC neural nets, Hebbian learning, AdaBoost, Fisher vectors, EM algorithms for various distributions, fuzzy logic, optimization methods like conjugate gradients etc etc.

But not once were the "Gauss-Markov conditions" mentioned. Frequentist theory was only marginally addressed. I taught myself some of that stuff from the Internet, such as hypothesis testing theory, p-values, t statistic, ANOVA, etc.

Also, I'd say I'm good with data structures and algorithms, complexity theory, graph theory etc.

I thought these skills would be a good fit for data science jobs, but I guess it's really such a wide umbrella term, that probably you're more looking for people trained in the frequentist, statistical side of it. What application field are you in, if it's no secret?

Re: Data science interview questions with answers

#27
I’ve worked in the field for 7 years now so not that long but long enough to build some heuristics. The best data scientists are just people who try to understand the ins and outs of business processes and look at problems with healthy suspicion and curiosity. The ability to explain the nuances of manifolds in SVMs is not something that comes into it outside these contrived interviews. I prefer to ask candidates how they would approach solving a problem I’m facing at that moment rather than these cookie cutter tests which are easy to game and tell me nothing

Re: Data science interview questions with answers

#28

The quality and depth of answers here is pretty inconsistent. But this in particular is a pet peeve of mine: > Plot a histogram out of the sampled data. If you can fit the bell-shaped "normal" curve to the histogram, then the hypothesis that the underlying random variable follows the normal distribution can not be rejected. This is commonly taught in undergrad stats, but you shouldn't do this. I'm of the opinion that…

> You should strive to obtain a deep understanding of your data and its distribution, and you should be deeply skeptical if the sample you happen to have looks normal. Although normality testing is useless in many situations, the parent comment somewhat overstates the degree of caution required. In many contexts the exact distribution doesn't matter; sort-of-normal is good enough. For example, the t-test is used ubiq…

> The t-test is extremely robust to departures from normality given equal sample sizes

That's over selling it. Its very sensitive to fat tails and skew. That's the reason robust testing and estimation is a thing. Wilcox's research would be a good near contemporary place to start [0][1].

[0] Wilcox, Robustness of Standard Tests https://onlinelibrary.wiley.com/doi/abs/10.1002/978111844511... (paywalled)

    Abstract: Conventional hypothesis‐testing methods such as
    student's t, the ANOVA F test, and methods based on the
    ordinary least squares regression estimator, are not
    robust to violations of assumptions. In fact, there are
    general conditions under which these methods can provide
    poor control over the probability of a type I error and
    inaccurate confidence intervals, no matter how large the
    sample sizes might be. Relatively poor power is yet another 
    concern.
[1] Fundamentals of Modern Statistical Methods: Substantially Improving Power and Accuracy https://books.google.co.in/books?id=uUNGzhdxk0kC

   Conventional statistical methods have a very serious
   flaw. They routinely miss differences among groups or
   associations among variables that are detected by more
   modern techniques - even under very small departures from
   normality. Hundreds of journal articles have described
   the reasons standard techniques can be unsatisfactory,
   but simple, intuitive explanations are generally
   unavailable. Improved methods have been derived, but they
   are far from obvious or intuitive based on the training
   most researchers receive. Situations arise where even
   highly nonsignificant results become significant when
   analyzed with more modern methods. Without assuming any
   prior training in statistics, Part I of this book
   describes basic statistical principles from a point of
   view that makes their shortcomings intuitive and easy to
   understand.

Re: Data science interview questions with answers

#29
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.

Re: Data science interview questions with answers

#30

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.

The followup question would then be "do you currently write end-to-end ML code in raw Python in production?"

The answer will most likely be no.

Post reply on HN