专栏名称: 大数据应用
数据应用学院被评为2016北美Top Data Camp, 是最专业一站式数据科学咨询服务机构,你的数据科学求职咨询专家!
目录
相关文章推荐
艺恩数据  ·  2024年8月美妆行业市场观察 ·  6 天前  
数据派THU  ·  KDD 2024 | ... ·  1 周前  
数据派THU  ·  独家 | ... ·  1 周前  
软件定义世界(SDX)  ·  华为轮值董事长徐直军在华为2024全联接大会 ... ·  1 周前  
51好读  ›  专栏  ›  大数据应用

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

大数据应用  · 公众号  · 大数据  · 2017-10-12 08:58

正文

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

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

Day 111

DS Interview Questions

Can the lambda forms in Python contain statements?

BA Interview Questions

R Programing: imagine you have two columns in a dataframe, ‘Gender’ and ‘Loan_Status’, both are categorical variables. ‘Gender’ has ‘Male’,’Female’ and NA values, ‘Loan_Status’ with ‘Yes’ and ‘No’. Now, how do you use ‘dplyr’ package to calculate the percentage for male and female when Loan Status equals to ‘No’, remember to ignore NA values

Leetcode Questions

Description:

Given an array and a value, remove all instances of that value in place and return the new length.

Do not allocate extra space for another array, you must do this in place with constant memory.

The order of elements can be changed. It doesn’t matter what you leave beyond the new length.


Input: [3,2,2,3]

Output: 2

Assumptions:  

Do not allocate extra space for another array, you must do this in place with constant memory.

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

Day 110 答案揭晓

DS Interview Questions

What’s the loss function log-loss?

Log Loss is an evaluation metric used in (multinomial) logistic regression and extensions of it such as neural networks, defined as the negative log-likelihood of the true labels given a probabilistic classifier’s predictions.

BA Interview Questions

R Programming: How to check the frequency distribution of a categorical variable?

Imagine we have a table names gender:

Gender = factor(c(‘M’,’F’,’M’,’F’,’F’,’F’)

table(Gender)

How do you calculate the % of values for each categorical group by sorting the output in a dataframe and applying the column percent ?


Answer:

t= data.frame(table(Gender))

t$percent = round(t$Freq/sum(t$Freq)*100,2)


Sample output:

Leetcode Questions

Description:

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length

Do not allocate extra space for another array, you must do this in place with constant memory.


Input: [1,1,2]

Output: 2

Assumptions:  

Do not allocate extra space for another array, you must do this in place with constant memory.

Solution:这是一道非常基础的去重题目,需要细心设定两个指针并考虑好边界条件。

Code:  

时间复杂度:O(n)

空间复杂度:O(1)



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