📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
楼主: danielcwj1987
跳转到指定楼层
上一主题 下一主题
收起左侧

[题目讨论] 请教一道亚麻最近高频的OOD linux find题目

 
🔗
easonlyx 2019-6-21 12:49:00 | 只看该作者
全局:
magicsets 发表于 2019-3-10 07:03
最近有点时间我来稍微写一下这个问题..

Linux的find命令其实还是相当复杂的一个命令,参数种类很多,官 ...

这么难我怕是要挂了。。一个SDE1的ood就出这么难。。
回复

使用道具 举报

全局:
magicsets 发表于 2019-3-10 07:03
最近有点时间我来稍微写一下这个问题..

Linux的find命令其实还是相当复杂的一个命令,参数种类很多,官 ...

这啥意思,为啥ood题要写这么长的代码……不是画diagraml图嘛?
回复

使用道具 举报

全局:
用reflection注册filter嘛
回复

使用道具 举报

🔗
zqyzdsjdy 2020-1-20 13:46:05 | 只看该作者
全局:
我觉得不用想的太复杂,有点像 588的变种,搜索就dfs/bfs就行
回复

使用道具 举报

全局:
liweiheng 发表于 2019/09/07 22:29:28
这啥意思,为啥ood题要写这么长的代码……不是画diagraml图嘛?
我也以为画画图就行了
回复

使用道具 举报

🔗
doncic 2020-5-21 07:39:54 | 只看该作者
全局:
分享一下 leetcode discuss 的内容
一个 amazon 的 SDE 说自己expect 的答案
"
1. Obviously coming straight to the right design (encapsulating the Filtering logic into its own interface etc...), with an explanation on why this approach is good. I'm obviously open to alternate approaches as long as they are as flexible and elegant.
2. Implement boolean logic: AND/OR/NOT, here I want to see if the candidate understands object composition
3. Support for symlinks. Rather than seeing the implementation (which I don't really care about) I want to understand the tradeoffs of adding yet another parameter to the find method VS other options (eg. Constructor). Keep adding params to a method is usually bad.
4. How to handle the case where the result is really big (millions of files), and you may not be able to put all of them into a List."

个人理解:
1. 创建一个Filter 的base class,  创造子类来表示不同的filter 条件( size, type)
2. 用Decorator Pattern 实现Predicate (逻辑 与或非), 高票答案里面有
3. 剩下的没有什么思路...

评分

参与人数 1大米 +1 收起 理由
836195369 + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
zzheng11 2020-5-31 22:49:16 | 只看该作者
全局:
感谢楼主分享 请问你用了哪些desgin pattern?
回复

使用道具 举报

🔗
mchzh 2020-6-3 11:21:17 | 只看该作者
全局:
doncic 发表于 2020-5-21 07:39
分享一下 leetcode discuss 的内容
一个 amazon 的 SDE 说自己expect 的答案
"

Decorator Pattern 实现Predicate在哪里呢?多谢
回复

使用道具 举报

🔗
doncic 2020-6-3 20:54:07 | 只看该作者
全局:
mchzh 发表于 2020-6-3 11:21
Decorator Pattern 实现Predicate在哪里呢?多谢

就是第一页第一个答案....
回复

使用道具 举报

🔗
mchzh 2020-6-4 00:21:14 | 只看该作者
全局:
doncic 发表于 2020-6-3 20:54
就是第一页第一个答案....

多谢多谢
回复

使用道具 举报

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

本版积分规则

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