Find Mode of a distribution (Google Interview question) 🧐
🌟 Resources:
👉 Question: https://lnkd.in/g2HF7wT5
Okay! Here's a quick summary of the video:
Problem Introduction (0:10-0:37): The video introduces an SQL challenge: determining the price a small handyman business is willing to pay per employee, based on the mode of their AdWords earnings distribution. Small businesses are defined as having no more than 10 employees.
Data Exploration (0:40-1:11): The video looks at the table involved, noting key fields like business type, number of employees, and AdWords earnings, which will be used to calculate the price per employee.
Defining the Mode (1:48-3:02): The presenter explains that the mode, in this context, refers to the most frequently occurring value in the distribution of earnings per employee.
Initial Assumptions & Logic (3:16-6:00): The video outlines the initial assumptions, including filtering for the handyman business type, cross-checking with the interviewer, and removing rows with missing values. The presenter also touches on quality checks like keywords and aliases.
Building the SQL Query (6:00-10:04): The presenter starts constructing the SQL query using common table expressions (CTEs). The first CTE filters the data and calculates the price per employee. The second CTE identifies the mode by ranking the occurrences of each price per employee.
Alternative Solution using MODE() function (10:47-13:31): The video explores a more efficient solution using the MODE() function in SQL, which simplifies the query and eliminates the need for the second CTE.
Subscribe 🤝 | React 🤓 | Drop 💬 | Re-share ♻️
Поделиться в:
Доступные форматы для скачивания:
Скачать видео mp4
Информация по загрузке:
Скачать аудио mp3
Похожие видео
array(10) {
[0]=>
object(stdClass)#5222 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "9_BJ8s_B1Mg"
["related_video_title"]=>
string(82) "SQL Challenges (MAANG) | Video 3: Hard SQL by @Google - Counting instances in text"
["posted_time"]=>
string(27) "5 месяцев назад"
["channelName"]=>
string(18) "Sundeep Kondaveeti"
}
[1]=>
object(stdClass)#5195 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "8L51FUsjMxA"
["related_video_title"]=>
string(115) "Как устроена База Данных? Кластеры, индексы, схемы, ограничения"
["posted_time"]=>
string(27) "6 месяцев назад"
["channelName"]=>
string(25) "Артём Шумейко"
}
[2]=>
object(stdClass)#5220 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "IpmxBMArfDU"
["related_video_title"]=>
string(90) "🔴Jazz That Feels Like Time Travel – 1940s Calm Vibes | Music for Work & Study"
["posted_time"]=>
string(0) ""
["channelName"]=>
string(21) "The Jazz Time Machine"
}
[3]=>
object(stdClass)#5227 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "DQGleX6Cwaw"
["related_video_title"]=>
string(62) "Максимальное унижение Зеленского"
["posted_time"]=>
string(24) "10 часов назад"
["channelName"]=>
string(27) "Анатолий Шарий"
}
[4]=>
object(stdClass)#5206 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "4Oaveqn2YwY"
["related_video_title"]=>
string(125) "Эти 5 СЕКРЕТНЫХ функций в Excel НИКТО не использует. Вот, что они делают!"
["posted_time"]=>
string(25) "4 недели назад"
["channelName"]=>
string(54) "Эксперт ЭКСЕЛЬ и ГУГЛ-ТАБЛИЦЫ"
}
[5]=>
object(stdClass)#5224 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "645eu7zJuyg"
["related_video_title"]=>
string(94) "System Design | Video 3: How to tackle a System Design problem effectively during an interview"
["posted_time"]=>
string(23) "1 месяц назад"
["channelName"]=>
string(18) "Sundeep Kondaveeti"
}
[6]=>
object(stdClass)#5219 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "jGO6QtWOPJQ"
["related_video_title"]=>
string(174) "КАСЬЯНОВ: "Я видел это своими глазами. Это не публиковалось": что показали Путину, чего он боится"
["posted_time"]=>
string(24) "15 часов назад"
["channelName"]=>
string(24) "И Грянул Грэм"
}
[7]=>
object(stdClass)#5229 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "a3-nkc_VUF0"
["related_video_title"]=>
string(123) "Эти ОШИБКИ совершает КАЖДЫЙ новичок в Excel. Избавься от них НАВСЕГДА!"
["posted_time"]=>
string(25) "2 недели назад"
["channelName"]=>
string(54) "Эксперт ЭКСЕЛЬ и ГУГЛ-ТАБЛИЦЫ"
}
[8]=>
object(stdClass)#5205 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "i-FFVM4cIXQ"
["related_video_title"]=>
string(138) "База по Базам Данных - Storage (Индексы, Paging, LSM, B+-Tree, R-Tree) | Влад Тен Систем Дизайн"
["posted_time"]=>
string(22) "11 дней назад"
["channelName"]=>
string(15) "Влад Тен"
}
[9]=>
object(stdClass)#5223 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "W7KPfg0HSj8"
["related_video_title"]=>
string(161) "Top 50 SHAZAM⛄Лучшая Музыка 2025⛄Зарубежные песни Хиты⛄Популярные Песни Слушать Бесплатно #46"
["posted_time"]=>
string(23) "1 месяц назад"
["channelName"]=>
string(9) "Open Deep"
}
}