专栏名称: 大数据应用
数据应用学院被评为2016北美Top Data Camp, 是最专业一站式数据科学咨询服务机构,你的数据科学求职咨询专家!
目录
相关文章推荐
软件定义世界(SDX)  ·  【PPT】厦大团队:大模型概念、技术与应用实践 ·  2 天前  
人工智能与大数据技术  ·  倍儿地道的山寨DeepSeek:「深度求索儿」 ·  昨天  
大数据与机器学习文摘  ·  DeepSeek ... ·  5 天前  
软件定义世界(SDX)  ·  清华大学:普通人如何抓住DeepSeek红利 ·  4 天前  
51好读  ›  专栏  ›  大数据应用

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

大数据应用  · 公众号  · 大数据  · 2018-02-13 10:00

正文

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

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

Day 194

DS Interview Questions

How can you copy objects in Python?

BA Interview Questions

R language:

Write a while loop starting with x = 0.

The loop prints all numbers up to 35 but it skips number 7.

LeetCode Questions

Description:

  • Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

Input: “A man, a plan, a canal: Panama”

Output: true

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

Day 192 答案揭晓

DS Interview Questions

What is the difference between tuples and lists in Python?


Tuples can be used as keys for dictionaries i.e. they can be hashed. Lists are mutable whereas tuples are immutable - they cannot be changed. Tuples should be used when the order of elements in a sequence matters. For example, set of actions that need to be executed in sequence, geographic locations or list of points on a specific route.

BA Interview Questions

R language:

You have the data.frame ‘mydf’ with four columns like below.

a = c(3,7,NA, 9)

b = c(2,NA,9,3)

f = c(5,2,5,6)

d = c(NA,3,4,NA)


mydf = data.frame(a=a,b=b,f=f,d=d)

mydf

## You want to add another column ‘5’:

## the 5th column contains the value of col b if col a is NA;

## the 5th column contains the value of col d if col b is NA;

## the 5th column contains the value of col f in all other cases.


for(j in c(1,2,4,3)){

for(i in 1:4){

if(is.na(mydf[i,j])>0){mydf$e

else if (is.na(mydf[i,j])>0){mydf$e

else if(is.na(mydf[i,j])==0) {mydf$e

}

}


mydf


for(j in c(1)){

for(i in 1:4){

if(is.na(mydf[i,j])>0){print(is.na(mydf[i,j])>0)}

}

}


for (i in c("a","b","d","f")){

if(colSums(is.na(mydf[i]))==0){

mydf$e

}

}

Leetcode Questions

Description:

  • Say you have an array for which the ith element is the price of a given stock on day i.

  • Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times). However, you may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again).

Input: [1,2,3,1,6]

Output: 7







请到「今天看啥」查看全文