找回密码
 FreeOZ用户注册
查看: 1982|回复: 3
打印 上一主题 下一主题

[求职信息] 分享下银行招开发人员的第一轮题目

[复制链接]
跳转到指定楼层
1#
发表于 5-8-2014 11:20:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册

x
本帖最后由 wangbo 于 6-8-2014 19:31 编辑

邮件里发过来让你做的,主要写解决问题的思路
给应聘Java developer的人参考

Techinterview questions - “homework”
Thefollowing items should be completed in Java 1.7 without relying on otherframeworks. The code should be production ready. Make reasonable assumptions ifany information is missing.
Ifneeded, make notes explaining the assumptions. Please don’t send binaries.Ideally your code can be compiled with Maven.
1.,
Implementan in-memory cache. What we know about the use case:
- TheTTL of the items is fairly short (~10 seconds)
- Thesystem has plenty of memory
- Thekeys are widely distributed across the keyspace
- Eachitem may or may not be accessed during the TTL
- Eachitem might be accessed multiple times during the TTL
2.,
Createa simple framework where work items can be submitted. Each work item is aninstance of a class and the definition of “parallelism”, which controls howmany threads are created to execute the work item.
Theframework makes sure that the number of threads executing the work item shouldremain the same until the threads finished executing the work item, eg.: if thework item dies, the framework should restart it.
Thereis no need to cater for timeouts.
Sampleinterfaces for the framework:
publicinterface WorkItemExecutor
{
void executeWorkItem(WorkItem w, intparallelism);
}
publicinterface WorkItemCompletionCallback
{
void complete();
}
publicinterface WorkItem
{
void execute(WorkItemCompletionCallbackcallback);
}

评分

参与人数 5威望 +250 收起 理由
cynthiawu + 50 谢谢分享!
语之玫瑰 + 50 谢谢分享!
zzoeyy + 50 谢谢分享!
门外汉1982 + 50 谢谢分享!
愚夫 + 50 赞一个!

查看全部评分

回复

使用道具 举报

2#
发表于 5-8-2014 11:32:24 | 只看该作者

评分

参与人数 1威望 +20 收起 理由
wangbo + 20 谢谢:)

查看全部评分

回复

使用道具 举报

3#
 楼主| 发表于 5-8-2014 11:56:39 | 只看该作者
回复

使用道具 举报

4#
发表于 23-9-2014 00:20:38 | 只看该作者
非常感谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | FreeOZ用户注册

本版积分规则

小黑屋|手机版|Archiver|FreeOZ论坛

GMT+10, 13-9-2025 17:57 , Processed in 0.033198 second(s), 17 queries , Gzip On, Redis On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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