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

发布于 2021-09-07 10:02 ,所属分类:2021面试经验技巧分享

点击上方蓝字 会变美




Sep.

6

Data Application Lab 自2017年6月15日起,每天和你分享讨论一道数据科学(DS)和商业分析(BA)领域常见的面试问题。

自2017年10月4日起,每天再为大家分享一道Leetcode 算法题。


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



Day

1105

DS Interview Question

Explain bagging.

BA Interview Question

Write a query in SQL to count number of unique patients who got an appointment for examination room C

LeetCode Question

Pascal’s Triangle II


Description:

Given an index k, return the kth row of the Pascal’s triangle.

Input: 3

Output: [1,3,3,1]

Day

1104

答案揭晓

DSInterview Question & Answer

How can you choose a classifier based on training set size?

If training set is small, high bias / low variance models (e.g. Naive Bayes) tend to perform better because they are less likely to be overfit.

If training set is large, low bias / high variance models (e.g. Logistic Regression) tend to perform better because they can reflect more complex relationships.

BA Interview Question & Answer

Write a query in SQL to find the name of the patients and the number of physicians they have taken appointment.

Answer:

SELECT p.name "Patient",
count(a.patient) "Appointment for No. of Physicians"
FROM appointment a

JOIN patient p ON a.patient=p.ssn
GROUP BY p.name
HAVING count(a.patient)>=1;

LeetCode Question & Answer

Pascal’s Triangle

Description:

Given numRows, generate the first numRows of Pascal’s triangle.

Input: 5

Output:

[

[1],

[1,1],

[1,2,1],

[1,3,3,1],

[1,4,6,4,1]

]

Solution:

模拟题,根据图上的规律来进行循环

注意防止数组越界

Code:

Time Complexity: O(n^2)

Space Complexity: O(1)

往期精彩回顾


新兴数据岗位:Analytics Engineer分析工程师是什么?

教你如何用神经网络和机器学习进行动态定价

不了解数据建模方法?看这篇就对了

数据科学家,知道这些统计知识就对了

想转行数据科学吗?这里有三种场景和方法





点「在看」的人都变好看了哦

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

相关资源