Insights
SQL interview Questions For Aspiring Data Scientist — The Histogram​
2 min read
By Julien Kervizic

The histogram question is a general warm up question for aspiring data scientist a bit akin to fizz buzz for Software engineering.

It is a step that needs to be repeated countless time in the life of a data-scientist to get a sense of a distribution of different variables and which is not very difficult technically.

Any seasoned data-scientist should be able to do these step out of top of their mind and aspiring data-scientist should be able to prove they have the technical knowledge to do these.

Questions

Given an order item table containing the following fields:

1) Provide an histogram of item price

2) Provide an histogram of orders by order price

Answer 1)

This is traditionally a warm up question to just check if the candidate has some bases on SQL and can actually use a group by clause.

Answer 2)

The purpose of this question is to check that the candidate can grasp the concept of grain of data and the concept of a sub query.

Followup Questions

Additional questions can be asked that deal with traditional histogram setup, such as:

  • how to do it with bucketization, to get more insights on how they would approach the problem, maybe through the use of case statements, ceiling functions …
  • doing a frequency histogram based on time between each order and its preceding order to see if one masters either self joins or window functions

Privacy Policy
Sitemap
Cookie Preferences
© 2024 WiseAnalytics