📣 黑五网一特惠|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 3
跳转到指定楼层
上一主题 下一主题
收起左侧

硬币基地OA - cloud file storage system

🔗
匿名用户-KRCUD  2025-7-18 01:18:58 |倒序浏览

2025(4-6月) 码农类General 本科 全职@cloudkitchens - 内推 - 技术电面  | 🙁 Negative 😐 Average | Fail | 在职跳槽

跟地理面经有点不一样的file storage 前两问差不多,创建file,创建user 第三问adjust capacity,减少user的capacity的时候要考虑删除最大size的files。 第四问的是compress和decompress file。
有一点就是level 2里的sorted in lexicographical order of the names 需要格外注意下,用priorityqueue 的时候需要另外处理string。 其余就是,只要实现,不考虑任何性能优化,所以按照最简单最直接的方法写,这样后面比较容易debug
Your task is to implement a simple cloud storage system, All operatlons that should be supported are listed below.
Requirements Your task is to implement a simple cloud storage system that maps objects (files) to their meta information. Specifically, the storage should maintain files and information about them (name, size, etc.). Note that this system should be In-memory: you don't need to work with the real filesystem.
Level 1: The cloud storage system should support adding a new flie and retrieving and deleting files. Level 2: The cloud storage system should support displaying the largest files. Level 3: The cloud storage system should support adding users with limited capacities and merging two users Level 4: The cloud storage system should support backing up restoring a user's files
Level 1 The cloud storage system should support file manipulation. add file(self, name: str, size: int) -> bool -should add a new file name to the storage. size is the amount of memory required in bytes. The current operation fails if a file with the same name already exists. Retums True if the file was added successfully or False otherwise
get_file_size(self,
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
d 's files are deleted. If a file can't be restored because another user added another file with the same name, it ls ignored. Returns the number of the files that are successfully restored or None if user id does not exist.
Note that merge user does not affect user id 1 's backup, and user id 2 is deleted along with its backup Note that the restore_user operation does not affect the user's capacity
总体的问题和这篇帖子差不太多,但是level 2以后的细节不太一样
level2 要求按prefix 和suffix 找到user的files,再按一定顺序排序 level3 要动态改user的capacity,如果新的capacity 不够存的话就要按一些rules 删掉原来的文件 level4 要做compress 和 decompress,大概就是size 减半/double
Some Tips: prefix scan 不需要用到trie, 直接每个name和prefix对比就好 Top N 不需要用到 ordered set/ priority queue,直接sort 然后取前N个就好 你可以点开test case 的file来看你fail的test case的具体内容,这样很方便debug


本帖子中包含更多资源

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

x

评分

参与人数 2大米 +11 收起 理由
匿名用户-HHRYZ + 10 欢迎分享你知道的情况,会给更多大米奖励!
timothly_black + 1 给你点个赞!

查看全部评分


上一篇:云餐厅过经
下一篇:阿伐木挂经
地里匿名用户
推荐
匿名用户-KRCUD  2025-8-11 14:24:52
lordstone 发表于 2025-8-5 19:54
所以你这个到底是coinbase还是cloud kitchen?

COINBASE
回复

使用道具 举报

🔗
lordstone 2025-8-6 10:54:33 | 只看该作者
全局:
所以你这个到底是coinbase还是cloud kitchen?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-RQ9UO  2025-8-23 09:36:00
请问你图片贴的其他几题,有原题吗?
回复

使用道具 举报

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

本版积分规则

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