官方微信 手机客户端

澳洲ABC

搜索
查看: 1456|回复: 1

[IT] 分享下Commonwealth Bank招开发人员的第一轮题目

[复制链接]

4

主题

4

帖子

20

积分

新手上路

Rank: 1

积分
20
发表于 2014-8-5 12:13:20 | 显示全部楼层 |阅读模式
邮件里发过来让你做的,主要写解决问题的思路
给应聘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);
}




上一篇:Rebate Reconciliation
下一篇:【求职】Software Testing登陆3个月求职未果,求内部推荐

9

主题

1万

帖子

1万

积分

江湖老手

Rank: 6Rank: 6

积分
11183
发表于 2015-7-17 05:28:12 | 显示全部楼层
楼主留个联系方式~
回复 支持 反对

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系客服 关注微信 下载APP 返回顶部 返回列表