Data Interview Qs - Fradulent retail accounts

InterviewQs

Fradulent retail accounts

Forward this email to a friend or colleague and challenge them to solve it.

Hi, 

Below is a daily table for an active acount at Shopify (an online ecommerce, retail platform). The table is called store_account and the columns are:

Column Name Data Type Description
store_id integer a unique Shopify store id
date string date
status string Possible values are: [‘open’, 'closed’, ‘fraud’]
revenue double Amount of spend in USD

Here's some additional information about the table:

  • The granularity of the table is store_id and day
  • Assume “closed” and “fraud” are permanent labels
  • Active = daily revenue > 0
  • Accounts get labeled by Shopify as fraudulent and they no longer can sell product
  • Every day of the table has every store_id that has ever used Shopify

Given the above, write code using Python (Pandas library) to show what percent of active stores were fraudulent by day.

Some clarifications:

  • We want one value for each day in the month.
  • A store can be fraudulent and active on same day. E.g. they could generate revenue until 10AM, then be flagged as fradulent from 10AM onward.
(Note: you should be able to write code here given solely the table schema (field names, descriptions above) -- it's fairly common in interviews to be provided the structure of tables and told to write a quick query.)

 

You’ve accumulated 172 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Older messages

Ads in a newsfeed

Friday, August 6, 2021

InterviewQs Ads in a newsfeed Forward this email to a friend or colleague and challenge them to solve it. Hi, Here's a great new question for you to mull over the weekend. Good luck! Suppose you

One edit away

Wednesday, August 4, 2021

InterviewQs One edit away Forward this email to a friend or colleague and challenge them to solve it. Hi, I hope you enjoy today's question. Don't forget to rate it at the bottom, your feedback

Adult animal weights

Monday, August 2, 2021

InterviewQs Adult animal weights Forward this email to a friend or colleague and challenge them to solve it. Hi, I hope you enjoy today's question. Don't forget to rate it at the bottom, your

Price per calorie of McDonald's menu items

Friday, July 30, 2021

InterviewQs Price per calorie of McDonald's menu items Forward this email to a friend or colleague and challenge them to solve it. Hi, I hope you enjoy today's question. Don't forget to

Is drawing a Red independent from an Ace?

Wednesday, July 28, 2021

Statistics, Probability Theory, InterviewQs Is drawing a Red independent from an Ace? Statistics Probability Theory Forward this email to a friend or colleague and challenge them to solve it. Hi, I

You Might Also Like

This Week's Daily Tip Roundup

Sunday, May 19, 2024

Missed some of this week's tips? No problem. We've compiled all of them here in one convenient place for you to enjoy. Happy learning! iPhoneLife Logo View In Browser Your Tip of the Day is

Reading Beyond the Hype: Some Observations About OpenAI and Google’s Announcements

Sunday, May 19, 2024

Google vs. OpenAI is shaping up as one of the biggest rivarly of the generative AI era. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Final Reminder: Apple Issues "Update Now Warning"

Sunday, May 19, 2024

I wanted to send a final reminder — if you haven't already updated your iPhone to iOS 17.5, we strongly recommend you do so today. This is also your last chance to get access to our iOS 17.5 In-

Second Brain/Attention/Find Your Books

Sunday, May 19, 2024

Recomendo - issue #411 ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Kotlin Weekly #407

Sunday, May 19, 2024

ISSUE #407 19th of May 2024 Hello Kotliners! The Google I/O just finished this week with a huge announcement for us, with Google supporting now Kotlin Multiplatform on Android, and the KotlinConf will

Learn How to Use AI to Reach Your Full Potential, newsletterest1!

Sunday, May 19, 2024

3 Ways AI Can Help Your Writing ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌

Software Testing Weekly - Issue 220

Saturday, May 18, 2024

Software Testing Conferences 📚 View on the Web Archives ISSUE 220 May 18th 2024 COMMENT Welcome to the 220th issue! Have you ever been to a testing conference? They're a great way to learn about

📶 Is a Cellular iPad Worth It? — How to Prevent YouTube From Taking Over Your Screensaver

Saturday, May 18, 2024

Also: This Robot Vacuum Can Clean Stairs, and More! How-To Geek Logo May 18, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your inbox by

Weekend Reading — Objection-oriented programming

Saturday, May 18, 2024

This week we find a power-up box, replace GitHub Actions with Maven XMLs, avoid the worst website in the world, revisit RTO policies, “listen” to OpenAI employees, watch our Slack private messages, do

Daily Coding Problem: Problem #1445 [Easy]

Saturday, May 18, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Jane Street. The United States uses the imperial system of weights and measures, which