专栏名称: 大数据应用
数据应用学院被评为2016北美Top Data Camp, 是最专业一站式数据科学咨询服务机构,你的数据科学求职咨询专家!
目录
相关文章推荐
数据派THU  ·  报名 | ... ·  4 天前  
软件定义世界(SDX)  ·  DCMM、DAMA、DGI数据治理模型比较分 ... ·  4 天前  
天池大数据科研平台  ·  一文揭秘|预训练一个72b模型需要多久? ·  4 天前  
大数据分析和人工智能  ·  这届年轻人,逛商场只去B1B2 ·  1 周前  
51好读  ›  专栏  ›  大数据应用

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

大数据应用  · 公众号  · 大数据  · 2018-02-20 10:30

正文

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

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

Day 197 

DS Interview Questions

What is the function of activation function in ANN?

BA Interview Questions

R language:

Get 1000 simulations of a paired dice game.

A game immediately stops if you have an initial total (2 dice) of 5,6,7,8,9.

If the first cast does not meet those 5 totals you would continue until you get either 11 or 12.

What is the average number of dice casts per game?



LeetCode Questions

Description:

  • Follow up for “Find Minimum in Rotated Sorted Array”:

  • What if duplicates are allowed?

  • Would this affect the run-time complexity? How and why?

  • Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).

  • Find the minimum element.

Input: [4 5 6 7 0 0 1 2]

Output: 4

Assumptions:

  • The array may contain duplicates.


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

Day 196 答案揭晓

DS Interview Questions

What is sampling? How many sampling methods?


Sampling is that part of statistical practice concerned with the selection of an unbiased or random subset of individual observations within a population of individuals intended to yield some knowledge about the population of concern.

There are four sampling methods: Simple Random (purely random), Systematic( every kth member of population), cluster (population divided into groups or clusters)

and stratified (divided by exclusive groups or strata, sample from each group) samplings.


BA Interview Questions

R language:

You have an urn with balls from 1 to 100. 

You want to find out how often you need to draw a ball to get number 55. 

This is an experiment with replacement – you put the ball back each time you draw. 

Simulate 1000 runs of the experiment to get an accurate estimation of the required draws.

Use seed 23 to make the experiment reproducible. Use loops (for, while) for the solution.


set.seed(23)

x

times = 0

sum = 0


for (i in 1:1000){

 while(sample(x, replace = TRUE) != 55){

   times = times+1

 }

}


avg = round(times/1000);avg



Leetcode Questions

Description:

  • Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).

  • Find the minimum element.

Input: [4 5 6 7 0 1 2]

Output: 4

Assumptions:

       You may assume no duplicate exists in the array.


rotated排序数组, 无重复, 满足使用二分法的条件。 取中点的值, 如果小于最后一个值, 说明从中点到最后一个值为递增,中间不会有最小值, 反之则在。

注意点:

Corner case: 数组是一个未翻转的排序数组。



Time Complexity: O(lg n)

Space Complexity: O(1)





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