杭州银行 笔试彻底凉了...

📍 笔试公司:杭州银行

💻 笔试岗位:科技岗

📚 笔试问题:

计算机基础+1道sql题+1道Python题+数据分析题+日常情况了解。

2道手撕都不会...身心俱疲了.........

但还是尽量记录一下给uu们吧。

  1. hdfs edits log和fsimage分别记录什么?
  2. sql exist和in哪个快一些?
  3. Python class中__dict__是什么?

sql,求2024年交易次数至少10次的用户名、交易次数、交易总金额、交易类型,按照交易次数降序排序。

我死也记不清如何获得像id,customer_id,transaction_type的情况如何获得每个customer_id出现次数最多的transaction_type了。现在我要记录下来,都需要用到窗口函数,以下来自大模型。

法一:

WITH TransactionCount AS (
    SELECT
        customer_id,
        transaction_type,
        COUNT(*) AS transaction_count
    FROM
        transaction_table
    GROUP BY
        customer_id,
        transaction_type
),
RankedTransactions AS (
    SELECT
        customer_id,
        transaction_type,
        transaction_count,
        ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY transaction_count DESC) AS rn
    FROM
        TransactionCount
)
SELECT
    customer_id,
    transaction_type,
    transaction_count
FROM
    RankedTransactions
WHERE
    rn = 1;

法二:

SELECT
    customer_id,
    transaction_type,
    transaction_count
FROM (
    SELECT
        customer_id,
        transaction_type,
        COUNT(*) AS transaction_count,
        MAX(COUNT(*)) OVER (PARTITION BY customer_id) AS max_transaction_count
    FROM
        transaction_table
    GROUP BY
        customer_id,
        transaction_type
) AS subquery
WHERE
    transaction_count = max_transaction_count;

算法题:翻转链表,要求用Python实现。要求前一半翻转,然后后一半也翻转。

例如[1,2,3,4,5]翻转为[2,1,5,4,3];[1,2,3,4]翻转为[2,1,4,3]。

#软件开发笔面经#
全部评论
pdd需要内推吗
点赞 回复 分享
发布于 昨天 20:34 上海
佬应该投软件开发的,数据开发岗位很少的
点赞 回复 分享
发布于 昨天 20:36 浙江

相关推荐

不愿透露姓名的神秘牛友
昨天 16:37
已编辑
浙江泰隆商业银行 Java工程师 17.0k*14.0, 总包:25+1 硕士
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务