{"id":26428685,"url":"https://github.com/tknishh/case-study-ueats-ghub-sql","last_synced_at":"2025-08-23T20:06:17.214Z","repository":{"id":192755763,"uuid":"687344540","full_name":"tknishh/case-study-UEats-Ghub-SQL","owner":"tknishh","description":"Analyzing the Impact of Business Hour Mismatch on Order Volume in the Food Delivery Industry: A Case Study of UEats and Ghub","archived":false,"fork":false,"pushed_at":"2023-09-08T21:16:00.000Z","size":966,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T04:42:33.583Z","etag":null,"topics":["assignment","bigquery","case-study-analysis","loop","product-analyst","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tknishh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-05T07:03:17.000Z","updated_at":"2025-01-09T03:46:56.000Z","dependencies_parsed_at":"2025-03-18T04:40:57.358Z","dependency_job_id":"12ad49c5-c2b6-4508-b6ca-d4aaceac37fa","html_url":"https://github.com/tknishh/case-study-UEats-Ghub-SQL","commit_stats":null,"previous_names":["tknishh/case-study-ueats-ghub-sql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tknishh/case-study-UEats-Ghub-SQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknishh%2Fcase-study-UEats-Ghub-SQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknishh%2Fcase-study-UEats-Ghub-SQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknishh%2Fcase-study-UEats-Ghub-SQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknishh%2Fcase-study-UEats-Ghub-SQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tknishh","download_url":"https://codeload.github.com/tknishh/case-study-UEats-Ghub-SQL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknishh%2Fcase-study-UEats-Ghub-SQL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271767966,"owners_count":24817589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assignment","bigquery","case-study-analysis","loop","product-analyst","sql"],"created_at":"2025-03-18T04:40:50.654Z","updated_at":"2025-08-23T20:06:17.179Z","avatar_url":"https://github.com/tknishh.png","language":null,"readme":"# Analyzing the Impact of Business Hour Mismatch on Order Volume in the Food Delivery Industry: A Case Study of UEats and Ghub\n\n**Prompt**\n\n- It is important for a store to have consistent business hours across all food delivery platforms to avoid operational inconsistencies.\n- If a store's business hours on one platform do not match the hours listed on another platform, it can create potential problems.\n- Ensuring that a store's business hours are the same across all food delivery platforms is a key operational metric.\n\n**Example** of business hours in Doordash\n\n![Doordash](https://github.com/tknishh/case-study-UEats-Ghub-SQL/blob/master/images/doordash.png)\n\n**Goal** \n\nThe goal of this interview is to come up with a query to understand differences in the business hours for a store across all platforms. You will compute a metric called business hour mismatch between a store on Grubhub and a store on UberEats\n\nFor this problem statement, we will only focus on Grubhub and UberEats.\n\n1. Write a SQL query/set of queries that \n    1. Computes Business Hours Mismatch between a restaurant on two platforms. For the sake of simplicity, we will assume UberEats as the **ground truth.** We will then try to find the issues in Grubhub store hours. \n        1. Identify if Grubhub Hours are within the range of UberEats hours (column:is_out_of_range: “In Range”, “Out of Range with 5 mins difference”, “Out of Range”) \n\n1) **Computing Business Hour Mismatch** \n\n**Data**\n\nNote all the data is sample data available in BigQuery. (To view the data, open your personal BigQuery console and run these queries).\n\n| UberEats | SELECT * FROM arboreal-vision-339901.take_home_v2.virtual_kitchen_ubereats_hours LIMIT 1000; |\n| --- | --- |\n| Grubhub | SELECT * FROM arboreal-vision-339901.take_home_v2.virtual_kitchen_grubhub_hours LIMIT 1000; |\n\nNote: The (b_name,vb_name) tuple can be used as a key to identify the same store and join across the two tables.\n\nInput \n\n**Uber Eats Business Hours** \n\nTake the first key value pair in the menu dictionary and the first section and assume that as the store business hours. \n\nNote: daysBitArray starts with Monday and indicates the days of the week for this time window is applicable. The might be more than element in the regularHours array. \n\n![UberEats](https://github.com/tknishh/case-study-UEats-Ghub-SQL/blob/master/images/ueats_mapping.png)\n\n**Grubhub Business Hours** \n\nGrubhub\n\n| Virtual Restaurant ID (slug)  | JSON response (response) | Link to Block |\n| --- | --- | --- |\n| johnspizz_sicilianpi_gh | SELECT response FROM arboreal-vision-339901.take_home_v2.virtual_kitchen_grubhub_hours LIMIT 1000; |  |\n|  |  |  |\n\n![GrubHub](https://github.com/tknishh/case-study-UEats-Ghub-SQL/blob/master/images/ghub_schema.png)\n\n**Output** \n\n| Grubhub slug | Virtual Restuarant Business Hours | Uber Eats slug | Uber Eats Business Hours | is_out_range (expected output) |\n| --- | --- | --- | --- | --- |\n|  |  |  |  | In Range |\n|  |  |  |  | Out of Range  |\n|  |  |  |  | Out of Range with 5 mins difference between GH and UE |\n\n**Submission instructions**\n\n1. Send us a SQL or sets of SQL that ouputs data in this format. \n\n## Tips\n\n1. Please use your personal BigQuery, it is free. ( https://cloud.google.com/bigquery/public-data/  ⇒ click on Go to analytics hub , \nhttps://cloud.google.com/blog/products/data-analytics/query-without-a-credit-card-introducing-bigquery-sandbox , https://towardsdatascience.com/bigquery-without-a-credit-card-discover-learn-and-share-199e08d4a064 ) \n    \n    ![BigQuery](https://github.com/tknishh/case-study-UEats-Ghub-SQL/blob/master/images/bigquery.png)\n    \n2. You can view the data once you open BigQuery and run from this table. \n3. Please use json parsing and do not use regex. \n4. There is a way to write the SQL without brute forcing all day combinations etc, we would strongly prefer that. \n    1. Some starting point that might help https://stackoverflow.com/questions/34890339/how-to-extract-all-the-keys-in-a-json-object-with-bigquery \n5. Slug is a unique idenfitier for a store\n6. If there are multiple entries for a store, use the one with the latest timestamp.  \n7. You can use unnest to flatten business hours array in JSON\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftknishh%2Fcase-study-ueats-ghub-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftknishh%2Fcase-study-ueats-ghub-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftknishh%2Fcase-study-ueats-ghub-sql/lists"}