每日一练 您所在的位置:网站首页 BA面试题 每日一练

每日一练

2023-07-11 14:23| 来源: 网络整理| 查看: 265

Sample table: stay

LeetCode Question

Generate Parentheses

Deion:

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

Input: 3

Output: ["(())", “()”, “()”, “()”, “”]

Day

1576

答案揭晓

DS Interview Question & Answer

You are given a data set on cancer detection. You’ve build a classification model and achieved an accuracy of 96%. Why shouldn’t you be happy with your model performance? What can you do about it?

If you have worked on enough data sets, you should deduce that cancer detection results in imbalanced data. In an imbalanced data set, accuracy should not be used as a measure of performance because 96% (as given) might only be predicting majority class correctly, but our class of interest is minority class (4%) which is the people who actually got diagnosed with cancer. Hence, in order to evaluate model performance, we should use Sensitivity (True Positive Rate), Specificity (True Negative Rate), F measure to determine class wise performance of the classifier. If the minority class performance is found to to be poor, we can undertake the following steps:

BA Interview Question & Answer

Write a query in SQL to find out the floor where the minimum no of rooms are available.

Answer:

SELECT blockfloor as "Floor",

count(*) AS "No of available rooms"

FROM room

WHERE unavailable='0'

GROUP BY blockfloor

HAVING count(*) =

(SELECT min(zz) AS highest_total

FROM

( SELECT blockfloor ,

count(*) AS zz

FROM room

WHERE unavailable='0'

GROUP BY blockfloor ) AS t );

https://www.w3resource.com/sql-exercises/hospital-database-exercise/sql-exercise-hospital-database-27.php

LeetCode Question & Answer

Valid Parentheses

Deion:

Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.

The brackets must close in the correct order, “” and “[]{}” are all valid but “(]” and “([)]” are not.

Input: “[]{}”

Output: true

Solution:

模拟题,用栈来做最适合,注意corner case

Code:

Time Complexity: O(n)

Space Complexity: O(n)

前端工程师面试的五大注意事项

Python:释放效率——轻松简化你的日常工作!

Noteable:自动进行数据分析的ChatGPT插件

Microsoft Fabric对Power BI的影响如何?

谷歌、Meta和亚马逊的下一个前沿领域:AI生成广告

点「在看」的人都变好看了哦 返回搜狐,查看更多



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有