专栏名称: 大数据应用
数据应用学院被评为2016北美Top Data Camp, 是最专业一站式数据科学咨询服务机构,你的数据科学求职咨询专家!
目录
相关文章推荐
数据派THU  ·  最新RAG综述:15种经典RAG框架综述(上) ·  4 天前  
数据派THU  ·  基于Huffman树的层次化Softmax: ... ·  3 天前  
DataEye短剧观察  ·  DataEye短剧热力榜:榜首增量断崖领先, ... ·  3 天前  
DataEye短剧观察  ·  DataEye短剧热力榜:榜首增量断崖领先, ... ·  3 天前  
数据派THU  ·  LeCun团队新作:在世界模型中导航 ·  6 天前  
数据派THU  ·  准确、快速地从头预测RNA ... ·  1 周前  
51好读  ›  专栏  ›  大数据应用

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

大数据应用  · 公众号  · 大数据  · 2017-10-13 09:44

正文

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

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

Day 112

DS Interview Questions

How can you check if a data set or time series is Random?

BA Interview Questions

R Programming: explain the usage of which() function in R language and name an example of that function

Leetcode Questions

Remove Duplicates from Sorted List

Description:

Given a sorted linked list, delete all duplicates such that each element appear only once

Input: 1 → 1 → 2

Output: 1 → 2

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

Day 111 答案揭晓

DS Interview Questions

Can the lambda forms in Python contain statements?

No, as their syntax is restrcited to single expressions and they are used for creating function objects which are returned at runtime.

This list of questions for Python interview questions and answers is not an exhaustive one and will continue to be a work in progress. Let us know in comments below if we missed out on any important question that needs to be up here.

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

Sample Output:

Answers:

dataframe %>% count(Loan_Status, Gender) %>% filter(Gender != '' & Loan_Status == 'N') %>% ungroup %>% group_by(Loan_Status) %>% mutate(pct = round(n/sum(n),2))

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.

Solution:考的就是最基本的数组in-place去除元素, 关键在于注释了remove the duplicate的那个if判断

Code:  

时间复杂度:O(n)

空间复杂度:O(1)



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