查看原文
其他

每日一练 | Data Scientist & Business Analyst & Leetcode 面试题 324

2018-03-30 数据应用学院 大数据应用

自2017年6月15日起,数据应用学院与你一起温习数据科学(DS)和商业分析(BA)领域常见的面试问题。从2017年10月4号起,每天再为大家分享一道Leetcode算法题。


希望积极寻求相关领域工作的你每天关注我们的问题并且与我们一起思考,我们将会在第二天给出答案。


Day 224


DS Interview Questions

You are working on a time series data set. You manager has asked you to build a high accuracy model. You start with the decision tree algorithm, since you know it works fairly well on all kinds of data. Later, you tried a time series regression model and got higher accuracy than decision tree model. Can this happen? Why?


BA Interview Questions

Why do you think LTV and ‘cost per install’ (CPI) are important in the mobile gaming industry?


LeetCode Questions

    • Description:

      • Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.

    • Input: [1,3,5,6], 5

    • Output: 2

    • Assumptions:

      • assume no duplicates in the array.


欲知答案如何?请见下期分解!



Day 223 答案揭晓


DS Interview Questions

What’s the difference between a generative and discriminative model?

A generative model will learn categories of data while a discriminative model will simply learn the distinction between different categories of data. Discriminative models will generally outperform generative models on classification tasks.

Reference:

https://stackoverflow.com/questions/879432/what-is-the-difference-between-a-generative-and-discriminative-algorithm


BA Interview Questions

What is the meaning of ‘lifetime value’ (LTV)? What LTV can tell you?

Answer:

Lifetime value is the revenue that a customer will generated for your mobile game during their lifetime, but we cannot sure how long his/her lifetime in this game will be, so we make it as a predicted periodic value.


LTV could be a sign of your business health’s success, a measure of customer’s loyalty and it could also be used for forecasting growth; Moreover, it could determine our marketing budget, it tells you how much you can pay to acquire a customer.


LeetCode Questions

  • Description:

    • Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.

    • Your algorithm’s runtime complexity must be in the order of O(log n).

  • Input: [5, 7, 7, 8, 8, 10] and target value 8

  • Output: [3, 4]

  • Assumptions:

    • If the target is not found in the array, return [-1, -1]

  • Solution:

    • 使用两次二分分别找target第一次出现的索引和最后一次出现的索引。

    • 使用两次二分是由于worst case 整个数组都是target, 两次二分能保证O(lg n)的复杂度。

  • Code:

  • Time Complexity: O(lg n)

  • Space Complexity: O(1)




点击“阅读原文”查看数据应用学院核心课程

↓↓↓ 

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存