avatarJulien Kervizic

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2023

Abstract

she wanted to express how inadequate she thought <i>I</i> was? Hmmm (tapping chin, and looking at the ceiling).</p><p id="8ea3">I swept out of her office without a goodbye, which she deserved. I passed a tall, thin young black woman cheerfully conversing with the bank teller. “Go on in,” said the bank teller, gesturing towards the sorry Karen with the stank attitude.</p><p id="e955">The tall young black woman happily bounded over to Karen’s lair. I wanted to say to her, “Be careful, there’s a hungry Karen over there,” but I didn’t and I went on my way.</p><p id="8d12">After meeting up with my friend in the warm enough New England afternoon, rubbing our hands over the flame heaters outside the cafe, I decided to stop by the independent computer repair shop. The bell clanged against the door, alerting my presence, and the man I recognized from before Christmas when I had brought my computer stood at his station.</p><p id="1395">But why, in good God’s name, did it smell like poop in that place? It hadn’t ever smelt like that before. I looked around. Was there a bathroom somewhere? I peered around. No. Just a smaller office and a supply closet. I mean, I was wearing a mask, so the smell must have been BAD. Had a disgruntled customer recently come in and taken a revenge dump on the carpet and marched out? I wanted to make some odor-related remark, but I didn’t really know what to say. In fact, I pictured someone else coming in behind me, thinking, “Did this lady blow up the indie computer repair store?”</p><p id="2696">I was wrongly implicated in this way in graduate school. I went into a single stall bathroom and the toilet bowl was flooded with diarrhea leftovers. Sorry, I don’t know how else to say it. I couldn’t stomach using the sight, so I turned heel and edged my way past the person waiting to come in. The door closed behind her, and one second later, it opened and she ran out with a disgusted look on her face. I wanted to rush up to her and say, “It wasn’t me, I swear!” “Tell her it wa

Options

sn’t you!” My friends urged me, but I felt too foolish.</p><p id="0a64">I‘m sure the computer guy knew the source of the stench, or at least, knew it wasn’t me, so I pleasantly explained my computer problem to Chris or Bob or Dan or somesuch. My stomach begged me to get out of there as fast as possible. ChrisBobDan was one of those guys whose statements continually failed to indicate the end of a conversation, like, “Ok……. so I’ll order the part and email you……” He didn’t look up and kept typing away. “So, we’re done?” I breathed anxiously. “Yeahhhh….” he drawled in an insecure, noncommittal tone, still jabbing at the keyboard. I dashed out of there into the fresh afternoon air.</p><p id="bea3">Thanks for reading,</p><p id="d01a">~MJ</p><div id="a264" class="link-block"> <a href="https://readmedium.com/karen-i-prefer-boa-constrictor-1eee10b46222"> <div> <div> <h2>Karen? I Prefer Boa Constrictor</h2> <div><h3>This insidious kind of Karen kills you with fake niceness.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*6N8Y_d01iS-4s4NJb3F-Xg.jpeg)"></div> </div> </div> </a> </div><div id="9698" class="link-block"> <a href="https://mjadia.medium.com/i-cheered-when-they-came-for-amy-coopers-dog-38ee2da484"> <div> <div> <h2>I Cheered When They Came for Amy Cooper’s Dog</h2> <div><h3>She deserved it. But maybe call-ins are better than canceling and call-outs</h3></div> <div><p>mjadia.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*ECc8nVelcIbK72LNtf_OeQ.jpeg)"></div> </div> </div> </a> </div></article></body>

SQL interview Questions For Aspiring Data Scientist — The Histogram

Histograms

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:

order_item:
	order_date DATE,
	order_id INT,
        user_id INT,
	order_item_id INT,
	catalog_item_id INT,
	item_quantity INT,
	item_price INT

1) Provide an histogram of item price 2) Provide an histogram of orders by order price

Answer 1)

SELECT
    item_price,
    COUNT(1) as frequency
FROM order_item
GROUP BY 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)

SELECT
    order_price, 
    COUNT(1) as orders
FROM (
    SELECT
        order_id,
        SUM(item_price) as order_price
    FROM order_item
    GROUP BY 1
) as orders
GROUP BY 1

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

Read more from me:

Data Science
Sql
Analytics
Data Engineering
Data Analysis
Recommended from ReadMedium