1. SQL\n 围绕post这个功能出了两道题目,都不难但是没有一遍写对,有些小错靠面试官提醒了一下😢\n post那个编辑文字的框框面试官叫它为composer,围绕用户发表状态的行为问了一些问题。. check 1point3acres for more.\n(1)给了一个table composer,3 columns: userid | event | date, event包括enter/post/cancel (enter就是开始在composer里面写内容,cancel就是开始编辑但是没有post而是终止了)。\n what is the post success rate for each day in the last week?. ----\n 我的回答也贴出来了,各位有更好的答案麻烦也贴一下,相互学习\n\n select date, ifnull(num_post1.0/num_enter, 0) as post_ratio\n from\n ((select date, count(user_id) as num_post\n from composer\n where datediff(day, date, current_date) <= 7 and event = 'post'. 1point3acres\n\n group by date) t_post -- count how many posts are there\n join\n (select date, count(user_id) as num_enter\n from composer\n where datediff(day, date, current_date) <= 7 and event = 'enter'\n group by date) t_enter -- count how many times user started entering text\n on t_post.date = t_enter.date) temp\n order by date;\n\n (2) 在第一题的基础上,又给了一个table:user,4 columns: userid | date | country | dau_flag{0, 1}。其中dau_flag表示daily active or not\n what is the average number of post per daily active user by country today?\n\nselect country, ifnull(num_post1.0/num_user, 0) as avg_post_today\nfrom (select country, count(distinct user) as num_user, count(userid) as num_post\n from user join composer on user.userid = composer.userid\n where user.userid in (select userid from user where dau_flag = 1 and date = current_date) -- filter to today's active user and date = current_date\n group by country) temp\n;\n. Χ\n2. Product Sense\n蛮简单的,问的是上面(2)中的metric - average number of post per daily active user 突然从3下降到2.5,有哪些可能的原因,并且解释每个原因。好像还问了个问题,是怎么样确定一个新的change是好是坏之类的,有哪些metric可以帮助measure。