回复: 3
跳转到指定楼层
上一主题 下一主题
收起左侧

Ramp OA

 
全局:

2024(1-3月) 码农类General 本科 实习@Ramp - 网上海投 - 在线笔试  | 😐 Neutral 😣 Hard | Other | 其他
Ramp Intern 的 Online Assessment 是一个CodeSignal 的 Industry Coding Framework Assessment.
问题不算太难,但不过花的时间特别多,感觉做不完。
一共4个level,每个都是在前面问题基础上加新问题。
前面一个level不得满分就不能进入下一个,我做到第三个没来的急做完,第四道没看见, 感觉凉凉了
1 - 3 level 题目如下:

Instructions
Your task is to implement a simplified version of a program registering the working hours of contract workers at a facility. All operations that should be supported by this program are described below.
Solving this task consists of several levels. Subsequent levels are opened when the current level is correctly solved. You always have access to the data for the current and all previous levels.
Requirements
Your task is to implement a simplified version of a program registering the working hours of contract workers at a facility. Plan your design according to the level specifications below:
• Level 1: The working hours register program should support adding workers to the system, registering the time when workers enter or leave the office and retrieving information about the time spent in the office.
• Level 2: The working hours register program should support retrieving statistics about the amount of time that workers spent in the office.
• Level 3: The working hours register program should support promoting workers, assigning them new positions and new compensation. The program should also support calculating a worker's salary for a given period.
• Level 4: The working hours register program should support setting time periods to be double-paid.
To move to the next level, you need to pass all the tests at this level.
Note
You will receive a list of queries to the system, and the final output should be an array of strings representing the returned values of all queries. Each query will only call one operation.

Level 1
Introduce operations for adding workers, registering their entering or leaving the office and retrieving information about the amount of time that they have worked.
• ADD_WORKER <workerId> <position> <compensation> — should add the workerId to the system and save additional information about them: their position and compensation. If the workerId already exists, nothin
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
nothing happens and this operation should return an empty string
Examples
The example below shows how these operations should work (the section is scrollable to the right):




the output should be ["true", "registered", "registered", "success", "registered", "invalid_request", "registered", "registered", "35000", "John(0)", "registered", "250", "John(75)", "", "45500", "0"].
Input/Output
• [execution time limit] 4 seconds (py3)
• [memory limit] 1 GB
• [input] array.array.string queriesAn array of queries to the system. It is guaranteed that all the queries parameters are valid: each query calls one of the operations described in the description, all operation parameters are given in the correct format, and all conditions required for each operation are satisfied.Guaranteed constraints:1 ≤ queries.length ≤ 500.
• [output] array.stringAn array of strings representing the returned values of queries.
[Python 3] Syntax Tips
# Prints help message to the console# Returns a stringdefhelloWorld(name):    print("This prints to the console when you Run Tests")    return"Hello, "+ name

一些tips:
- 一开始要想好用什么Data Structure能让后面的题目更好做,以免后来需要refactor。我用的是一个Worker的structure加上dictionary,key是worker id, value 是 worker object
- 有很多时候要从int 换到 str, str 换到 int, 如果你用str type的 integers 做comparison的话得到的答案会是错的
- 复习一下filter 还有 join function 会很有用
- 时间真的很紧,开始之前记得补觉。。。。


新人求米啊!!第一次发帖,万分感谢施舍!!!

本帖子中包含更多资源

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

x

评分

参与人数 8大米 +22 收起 理由
avocadoyogi + 1 很有用的信息!
是啊丢丢 + 1 给你点个赞!
ladyM1896 + 1 给你点个赞!
AndersonNAGT + 1 欢迎分享你知道的情况,会给更多积分奖励!
Raven3199 + 1 很有用的信息!

查看全部评分


上一篇:JPMorgan AI
下一篇:亚麻车一轮挂经
全局:
感谢楼主分享给楼主加米
回复

使用道具 举报

全局:
感谢分享!
回复

使用道具 举报

🔗
晚来卷 2024-5-1 14:44:08 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies

评分

参与人数 1大米 +1 收起 理由
avocadoyogi + 1 很有用的信息!

查看全部评分

回复

使用道具 举报

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

本版积分规则

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