当前位置:网站首页>Score interview (1)----related to business
Score interview (1)----related to business
2022-08-05 10:17:00 【go and be safe~】
In the interview process of data analysis, the question of user retention rate is often asked. This section will focus on explaining this problem. First, we must understand the definition of retention and know how to calculate retention.Let's start with a small case from the Internet.
Given the user_behavior table, ask to query the user retention rate for the next day, 7th and 30th.
First of all, what is the definition of retention?
It is now set that the first login time of a new user is the 0th day, the new user is defined as the user who logs in for the first time, and the code name of the login behavior is 1.
Next day retention rate: Among the new users on day 0, the number of users who still logged in on the first day after the new day / the total number of new users on day 0;
7-day retention rate: Day 0 new users, the number of users who are still logged in on the 7th day after the new day/ Day 0Add the total number of users;
30-day retention rate: In the new users on the 0th day, the number of users who are still logged in on the 30th day after the new day/Day 0>The total number of new users;
Note: Retention is generally a discrete concept and does not require users to log in every day for N days
- Select daily new users
- Lists the date each new user logged in for the first time and the dates they have logged in after that date
- Calculate the difference between the listed login dates. If there is a difference of 1 day, it means that the new user is still available for the next day. If there is a difference of 7 days, it means that the new user is still available for seven days, and so on
- Count the number of retained new users every day and calculate the retention rate
`user_behavior`
边栏推荐
- What is the function of the regular expression replaceFirst() method?
- 19. Server-side session technology Session
- 第五章:activiti流程分流判断,判断走不同的任务节点
- 【 temperature warning program DE development 】 event driven model instance
- 百年北欧奢华家电品牌ASKO智能三温区酒柜臻献七夕,共品珍馐爱意
- LeetCode 216. Combined Sum III (2022.08.04)
- Imitation SBUS fixed with serial data conversion
- 第五章:多线程通信—wait和notify
- STM32+ULN2003驱动28BYJ4步进电机(根据圈数正转、反转)
- Is digital transformation a business buy-in?
猜你喜欢
随机推荐
仿SBUS与串口数据固定转换
E-sports, convenience, efficiency, security, key words for OriginOS functions
Oracle 19.3 restart 环境
自定义过滤器和拦截器实现ThreadLocal线程封闭
静态链接和动态链接
Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
MySQL之数据视图
2022 Huashu Cup Mathematical Modeling Question A Optimization Design Ideas for Ring Oscillators Code Sharing
mysql索引
机器学习-基础知识 - Precision, Recall, Sensitivity, Specificity, Accuracy, FNR, FPR, TPR, TNR, F1 Score, Bal
2022杭电多校 第6场 1008.Shinobu Loves Segment Tree 规律题
【MindSpore易点通机器人-01】你也许见过很多知识问答机器人,但这个有点不一样
Egg framework usage (2)
Pycharm 常用外部工具
leetcode: 529. Minesweeper Game
QSS 选择器
LeetCode 216. Combined Sum III (2022.08.04)
Four years of weight loss record
The century-old Nordic luxury home appliance brand ASKO smart wine cabinet in the three-temperature area presents the Chinese Valentine’s Day, and tastes the love of the delicacy
js hijacks the array push method








