由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - SQL, investment firm recruiter发过来的面试题 (转载)
相关主题
C#, investment firm recruiter发过来的面试题 (转载)请教一道面试题啊!关于SQL的!
一道面试题 (非IB)SQL find distinct values in large table (转载)
请教一道面试题(概率统计)error of executing SQL query of string concatenation
chimbo面经里一道编程面试题[合集] 有没有free的quadratic optimization package?
How prove this ?simulation problem
问一个老题Can we calculate log likelihood ratio using SAS??? (转载)
好久没看到这么decent的opening 了。optimization中如何限制weight的绝对值?
问个问题:一堆(1M)二维座标系的点,每个点有weight,怎么做c (转载)[合集] 问一个简单 math question
相关话题的讨论汇总
话题: null话题: varchar话题: load话题: positions话题: entries
进入Quant版参与讨论
1 (共1页)
p****1
发帖数: 275
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: peace1 (peace1), 信区: JobHunting
标 题: SQL, recruiter发过来的面试题
发信站: BBS 未名空间站 (Thu Sep 8 22:14:20 2016, 美东)
有兴趣做不? 我琢磨着, 出题的人是在寻找最优解 :)
We work with large datasets, and are always performance conscious since
extended processing times will impact our time to market. Keep this in mind
as you answer the following questions:
There is a table defined as:
CREATE TABLE [Positions](
[load_id] [int] NOT NULL,
[acct_cd] [varchar](20) NOT NULL,
[acct_num] [varchar](255) NULL,
[sec_id] [varchar](50) NOT NULL,
[long_sht_cd] [varchar](3) NOT NULL,
[sedol] [varchar](15) NULL,
[isin] [varchar](15) NULL,
[cusip] [varchar](9) NULL,
[sec_type] [varchar](8) NULL,
[sec_name] [varchar](100) NULL,
[currency_cd] [varchar](3) NULL,
[total_holding] [decimal](18, 4) NULL,
[mkt_price] [float] NULL,
[datetime_stamp] [datetime] NULL,
CONSTRAINT [pk_Positions] PRIMARY KEY CLUSTERED (
[load_id] ASC,
[acct_cd] ASC,
[sec_id] ASC,
[long_sht_cd] ASC )
)
This table holds account positions data that are appended to multiple times
a day
There are currently some 24 million rows in the table. Every time we append
additional positions we add approximately 32,000 entries to this table, and
all 32,000 entries will have the same load_id. The load_id is incremented by
one each time we load a batch of 32,000 entries (i.e. the first 32K entries
have load_id=1, the next 32K has load_id=2, etc...). The datetime_stamp
field shows the time at which the entries were loaded and is the same for
all 32K entries in a single load.
How would you efficiently retrieve the first set of positions for the
current day given the above table definition?
Example:
Today, positions were loaded into this table at 8am, 10am and 3pm. At 5pm
today we want to know what positions were loaded at 8am since that is the
first load that occurred today. Note that for any given day, there can be
different number of loads and the times that the loads occur will vary.
1 (共1页)
进入Quant版参与讨论
相关主题
[合集] 问一个简单 math questionHow prove this ?
问一个优化问题 (转载)问一个老题
一个概率题好久没看到这么decent的opening 了。
出个题问个问题:一堆(1M)二维座标系的点,每个点有weight,怎么做c (转载)
C#, investment firm recruiter发过来的面试题 (转载)请教一道面试题啊!关于SQL的!
一道面试题 (非IB)SQL find distinct values in large table (转载)
请教一道面试题(概率统计)error of executing SQL query of string concatenation
chimbo面经里一道编程面试题[合集] 有没有free的quadratic optimization package?
相关话题的讨论汇总
话题: null话题: varchar话题: load话题: positions话题: entries