回复: 3
收起左侧

Datadog Technical Phone Screen

匿名用户-FHOCZ  2025-6-18 10:49:56 来自APP
本楼:   👍  0
0%
0%
0   👎

2025(4-6月) MachineLearningEng 博士 全职@datadog - 网上海投 - 技术电面  | 😐 Neutral 😣 Hard | Pass | 在职跳槽

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
做滑动窗口的题目,两个part

You are given an input list of datapoints representing a time series for a certain metric. Each datapoint is a dictionary with the following keys:

{
  "tags": List[str],       # A list of tags for the datapoint, e.g., ["env:dev"]
  "timestamp": int,        # A UNIX-style integer timestamp
  "value": int or float    # A numeric value
}

The goal is to apply a smoothing function to the data, producing a list of smoothed values based on either:

Part 1: Fixed Number of Points (k)

In this part, you will implement a moving sum based on a fixed number of points.

Requirements:
        •        Given:
        •        A list of datapoints,
        •        A tag (e.g., "env:dev"),
        •        An integer
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
": 5},
  {"tags": ["env:dev"], "timestamp": 10, "value": -4},
  {"tags": ["env:dev"], "timestamp": 11, "value": 6},
  {"tags": ["env:dev"], "timestamp": 14, "value": -1}
]

Example Output for k = 5 seconds (Part 2):
[3, 2, -4, 2, 1, 2, 5]

第一部分经典滑动窗口题,第二部分有点坑,尤其是处理out of max time部分搞了蛮久

评分

参与人数 1大米 +10 收起 理由
清道神君 + 10 欢迎分享你知道的情况,会给更多大米奖励!

查看全部评分


上一篇:Amazon Onsite NG
下一篇:HashiCorp DE 挂经 求米
wshstc0 2025-6-20 01:37:29 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   185
99%
1%
2
thanks!!!!zszszszs
回复

使用道具 举报

万事如意君 2025-6-20 05:29:21 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   1001
98%
2%
19
你好,你这个例子不太对吧,time 1 3和6不都应该算进去吗?第二个不因该是-1吗
回复

使用道具 举报

地里匿名用户
匿名用户-Y1KJI  4 天前
本楼:   👍  0
0%
0%
0   👎
万事如意君 发表于 2025-6-19 14:29
你好,你这个例子不太对吧,time 1 3和6不都应该算进去吗?第二个不因该是-1吗

他是k=3 打错了吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表