回复: 0
收起左侧

Ramp 2024 Coding Assessment (Industry Coding Framework)

匿名用户-69K64  2024-8-5 20:46:52
本楼:   👍  3
100%
0%
0   👎

2025(4-6月) 码农类General 硕士 实习@ramp - 网上海投 - 在线笔试  | 😐 Neutral 😐 AverageOther | 应届毕业生

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

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

x
Ramp 2024 Coding Assessment (Industry Coding Framework)白嫖OA, OOD,一共四个level,我这个版本不知道地里有没有

The basic level of the in-memory database contains records. Each record can be accessed with a unique identifier key, which is of string type. A record contains several field-value pairs, with field as string type and value as integer type. All operations have a timestamp parameter — a stringified timestamp in milliseconds. It is guaranteed that all timestamps are unique and are in a range from 1 to 109. Operations will be given in order of strictly increasing timestamps. Timestamps will be needed starting from Level 3.

void set(int timestamp, String key, String field, int value) — should insert a field-value pair to the record associated with key. If the field in the record already exists, replace the existing value with the specified value. If the record does not exist, a new one is created.

boolean compareAndSet(int timestamp, String key, String field, int expectedValue, int newValue) — should update the value of field in the record associated with key to newValue if the current value equals expectedValue. If expectedValue does not match the current value, or either key or field does not exist, this operation is ignored. This operation should return true if the field was updated and false otherwise.

boolean compareAndDelete(int timestamp, String key, String field, int expectedValue) — should remove the field field in the record associated with key if the previous value equals expectedValue. If expectedValue does not match the current value, or either key or field does not exist, this operation is ignored. This operation should return true if the field was removed and false otherwise.

Optional<Integer> get(int timestamp, String key, String field) — should return the value contained within field of the record associated with key. If the record or the field does not exist, should return Optional.empty().

List<String> scan(int timestamp, String key) — should return a list of strings representing the fields of the r
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
, but should also update TTL of the newValue. This operation should return true if the field was updated and false otherwise. It is guaranteed that ttl is greater than 0.

Optional<Integer> getWhen(int timestamp, String key, String field, int atTimestamp) — should return the value of field at atTimestamp from the record associated with key. If atTimestamp is 0, perform the get operation described in Level 1. It is guaranteed that atTimestamp will not be greater than timestamp. If the specified field or record did not exist at the given timestamp, return Optional.empty().

评分

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

查看全部评分


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

本版积分规则

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