К содержанию
Вся база

Product Analyst/DS

6 вопросов · 34 мин · лайв-кодинг · сложность средняя

00:0034:01

Запись — после входа.

О чём разговор

High-frequency customer share by month, top customers with ties, restaurant sales trend

Этапы

  1. 1Лайв-кодинг

Все вопросы

  1. 01:34

    What percent of customers in each month are high frequency customers, meaning more than 30 deliveries per calendar month?

    Код
  2. 10:28

    But we want the percent of all customers each month that are high frequency customers.

    Код
  3. 14:14

    Excluding high frequency customers, which customers had the highest number of deliveries each month, and if more than one customer ties, show all of them?

    Код
  4. 21:43

    Can you use the order value table, which brings in the order total, together with the delivery orders table?

    Код
  5. 22:25

    Can you show how much sales for restaurant ID 8 change versus the previous month in 2021?

    Код
  6. 32:59

    So we can ignore January, since it has no previous month, right?

    Код

Ключевые моменты

  1. 01:34

    First task: share of high-frequency customers by month

  2. 10:28

    Clarification: percent of all customers in the month

  3. 14:14

    Second task: top customers, with ties

  4. 22:25

    Third task: monthly sales change for restaurant ID 8

  5. 27:36

    Time nearly up, interviewer stays for five more minutes

Отрывок из разговора

10:08
Interviewer

just fii we are looking for percentage okay percent of our customers So what you have so far is the number of customers that have high frequency customers, right?

10:27
Candidate

Yeah.

10:28
Interviewer

But we want the percent of all customers each month that are high frequency customers.

10:33
Candidate

Okay. We want the percent. Okay. All right.

Что вынести

A live-coding SQL round for a Senior Data Scientist, first round, 34 minutes. No queries were run; the candidate wrote the solutions aloud in an online editor. The three linked tasks covered the share of high-frequency customers per month (more than 30 deliveries), the top customers per month with ties included, and the month-over-month change in one restaurant's sales in 2021 using a window function. The interviewer clarified the percentage denominator in the first task, and the candidate finished all three with some guidance before the call ended on time; a recruiter will follow up.

Разбор собран по записи разговора.

Расшифровка

00:00
Interviewer

So if that makes sense to you, we can get started. What do you think?

00:02
Candidate

Yeah, I'm ready. Let's start.

00:06
Interviewer

Okay, awesome. Do you have access to the hacker rank link in your invite?

00:13
Candidate

Let me check. Yeah, I do have an access.

00:18
Interviewer

Okay, so you've got to log in there.

00:30
Candidate

Okay, I'm writing access. Set to email. Okay, I feel like I'm joined.

00:51
Interviewer

Okay, do you see like a data schema and a question below it?

00:57
Candidate

below it yeah I see uh delivery orders yeah yeah perfect so for this exercise like for all the

01:06
Interviewer

questions for that matter we are not going to run any of it we are just going to work through it and you're going to write it as though we are going to run it um whether you want to talk through while working to describe what you're doing or you want to first get it done and just explain what you've done totally up to you I don't care either way but essentially that's the idea so you can read get started and then let me know if you have any questions I can help them all right I have a table

01:34
Candidate

delivery orders there are like few columns delivery ID ID of delivery order place time timestamp time order was placed delivery rating so it's in pressure delivery rating scale from zero to five Dasher ID okay integer ID of Dasher delivery restaurant ID customer ID okay so question one a high frequency customer is defined it is defined as a customer that orders greater than 30 deliveries per calendar months okay so what is the percent of customers was ordered in a given month I considered high frequency okay group by months assume there are no customer IDs with zero orders in a given month in the table okay okay you hear me yeah okay all right so I can so you I can explain you my plan and I can run the query, right?

02:50
Interviewer

Yeah, yeah. You can even walk through the query first and explain what you've done. Like, that's fine too. I'm gonna read and look at what you're doing anyway. So if you wanna just get started, that's fine too.

02:59
Candidate

All right, so, I mean, should I explain you also like, I think it would be, it would make sense to explain.

03:05
Interviewer

Whatever you prefer, so yeah.

03:08
Candidate

Yeah, so the plan will be, let's extract, Months. Then probably, let me think. So then I will group by months and customer ID. I also need to count deliveries per customer per month count deliveries uh else oh we also need to uh obviously filter because we have this uh than 30 deliveries per calendar months greater okay so it's gonna be filter more than 30 deliveries and and and and I would group group by months and I need to group by months and I think by count customers Okay, that's, this is how I see it for now.

04:51
Candidate

I mean, I might change it a little bit when I will write the code, but that's basically how I will implement it.

Дальше — после входа. Это бесплатно и займёт минуту.

Войти и читать

Похожие собеседования