一亩三分地论坛

 找回密码
 获取更多干货,去instant注册!

一亩三分地官方iOS手机应用下载
查看: 5030|回复: 13
收起左侧

Quantlab 试题

[复制链接] |试试Instant~ |关注本帖
henear 发表于 2016-1-5 04:39:23 | 显示全部楼层 |阅读模式

2016(7-9月) 分析|数据科学类 本科 实习@QuantLab - 校园招聘会 - 在线笔试 |Failfresh grad应届毕业生

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看,没有帐号?获取更多干货,去instant注册!

x

This problem will require you to write an application that will take in
an input file 'input.csv' and write out a new file calculated from the inputs.

Technology Choice (In order of preference)
#1 - An object oriented language. from: 1point3acres.com/bbs
#2 - A functional language

We are looking for an object oriented or functional solution.  A procedural scripting
solution isn't acceptable.

_______________________________________________________________________________

Input:.鏈枃鍘熷垱鑷1point3acres璁哄潧
The input file represents a very simplified stream of trades on an exchange.  
Each row represents a trade.  If you don't know what that means don't worry.  
The data can be thought of as a time series of values in columns:

<TimeStamp>,<Symbol>,<Quantity>,<Price>

Although the provided input file is small, the solution should be able to handle
a source dataset well beyond the amount memory and hard disk space on your machine.
Thus any solution that reads the entire file contents into memory at once is unacceptable.
. from: 1point3acres.com/bbs
Definitions
- TimeStamp is value indicating the microseconds since midnight.
- Symbol is the 3 character unique identifier for a financial .1point3acres缃
  instrument (Stock, future etc.)
- Quantity is the amount traded
- Price is the price of the trade for that financial instrument.

Safe Assumptions:
- TimeStamp is always for the same day and won't roll over midnight.
- TimeStamp is increasing or same as previous tick (time gap will never be < 0).
- Price - our currency is an integer based currency.  No decimal points.
- Price - Price is always > 0.

Example: here is a row for a trade of 10 shares of aaa stock at a price of 12 . Waral 鍗氬鏈夋洿澶氭枃绔,
1234567890,aaa,10,12

鏉ユ簮涓浜.涓夊垎鍦拌鍧. Problem:
Find the following on a per symbol basis:
- Maximum time gap
  (time gap = Amount of time that passes between consecutive trades of a symbol)
  if only 1 trade is in the file then the gap is 0.
- Total Volume traded (Sum of the quantity for all trades in a symbol).
- Max Trade Price.
- Weighted Average Price.  Average price per unit traded not per trade.
  Result should be truncated to whole numbers.
. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴
  Example: the following trades
        20 shares of aaa @ 18
        5 shares of aaa @ 7
        Weighted Average Price = ((20 * 18) + (5 * 7)) / (20 + 5) = 15. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
. 1point3acres.com/bbs
Output:
Your solution should produce a file called 'output.csv'.
file should be a comma separate file with this format:
<symbol>,<MaxTimeGap>,<Volume>,<WeightedAveragePrice>,<MaxPrice>. visit 1point3acres.com for more.

The output should be sorted by symbol ascending ('aaa' should be first).

Sample Input:
52924702314,aaa,13,1136.鐣欏璁哄潧-涓浜-涓夊垎鍦
52924702549,aac,20,477. 鍥磋鎴戜滑@1point 3 acres
52925641407,aab,31,907
52927350412,aab,29,724
52927783980,aac,21,638.鏈枃鍘熷垱鑷1point3acres璁哄潧
52930489178,aaa,18,1222
52931654404,aaa,9,1077
52933453444,aab,9,756
. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
Sample Output:
aaa,5786864,40,1161,1222
aab,6103032,69,810,907
aac,3081431,41,559,638

Send your source code and output.csv back for evaluation when complete.
Include the amount of time you spent working on the solution and
simple instructions for building and/or running your solution.


. from: 1point3acres.com/bbs
-google 1point3acres
补充内容 (2016-1-5 04:40):
input.csv 是个20000多行的csv文件,格式与sample input一样

评分

1

查看全部评分

yajiren1 发表于 2016-1-12 11:07:33 | 显示全部楼层
关注一亩三分地公众号:
Warald_一亩三分地
楼主可以私我一下csv file吗? 虽然没申quantlab. 但想练习练习
回复 支持 反对

使用道具 举报

 楼主| henear 发表于 2016-1-12 11:46:25 | 显示全部楼层
关注一亩三分地微博:
Warald
yajiren1 发表于 2016-1-12 11:07
楼主可以私我一下csv file吗? 虽然没申quantlab. 但想练习练习

不是我不想发,是附件过大了==
要不留个邮箱?
回复 支持 反对

使用道具 举报

xiaozhuxiaozhu 发表于 2016-1-12 12:14:10 | 显示全部楼层
你怎么申请的呢???
回复 支持 反对

使用道具 举报

 楼主| henear 发表于 2016-1-12 12:19:32 | 显示全部楼层
xiaozhuxiaozhu 发表于 2016-1-12 12:14
你怎么申请的呢???

去年9月招聘会投的简历,10月底发email告诉我可以申了,11月发的题,12月初把我拒了==

评分

1

查看全部评分

回复 支持 反对

使用道具 举报

xiaozhuxiaozhu 发表于 2016-1-12 12:26:15 | 显示全部楼层
henear 发表于 2016-1-12 12:19
去年9月招聘会投的简历,10月底发email告诉我可以申了,11月发的题,12月初把我拒了==

一般cs master都可以申请么?
回复 支持 反对

使用道具 举报

 楼主| henear 发表于 2016-1-12 12:30:52 | 显示全部楼层
xiaozhuxiaozhu 发表于 2016-1-12 12:26
一般cs master都可以申请么?

我是本科生==申的貌似是technical intern。
还有个专门给master的intern貌似是做research的。鉴于还没读master就没关心。
回复 支持 反对

使用道具 举报

xiaozhuxiaozhu 发表于 2016-1-12 12:36:54 | 显示全部楼层
henear 发表于 2016-1-12 12:30
我是本科生==申的貌似是technical intern。
还有个专门给master的intern貌似是做research的。鉴于还没读 ...

lz能不能给个hr的联系方式么。
回复 支持 反对

使用道具 举报

 楼主| henear 发表于 2016-1-12 12:41:17 | 显示全部楼层
xiaozhuxiaozhu 发表于 2016-1-12 12:36
-google 1point3acreslz能不能给个hr的联系方式么。

我查了一下他所有邮件都通过jobvite发的==
回复 支持 反对

使用道具 举报

yajiren1 发表于 2016-1-13 04:20:55 | 显示全部楼层
henear 发表于 2016-1-12 11:46
不是我不想发,是附件过大了==
要不留个邮箱?

iverson926@hotmail.com

谢谢楼主
回复 支持 反对

使用道具 举报

 楼主| henear 发表于 2016-1-13 06:47:10 | 显示全部楼层
. from: 1point3acres.com/bbs
发过去了
回复 支持 反对

使用道具 举报

yajiren1 发表于 2016-1-13 10:39:02 | 显示全部楼层
.1point3acres缃
收到啦 谢谢。。
回复 支持 反对

使用道具 举报

dummy88 发表于 2016-1-17 16:22:28 | 显示全部楼层
想看、谢谢谢谢
回复 支持 反对

使用道具 举报

 楼主| henear 发表于 2016-1-18 13:58:12 | 显示全部楼层
dummy88 发表于 2016-1-17 16:22-google 1point3acres
想看、谢谢谢谢

那你也留个邮箱吧
回复 支持 反对

使用道具 举报

本版积分规则

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明 ( 沪ICP备11015994号 )

custom counter

GMT+8, 2017-4-30 14:17

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

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