From shasha@access2.cims.nyu.edu  Wed Jul 13 19:14:00 2011
Received: from mx2.cims.nyu.edu (mx2.cims.nyu.edu [128.122.49.96])
	by mail.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p6DNDuVa029635
	for <shasha@mail.cims.nyu.edu>; Wed, 13 Jul 2011 19:13:57 -0400 (EDT)
Received: from access2.cims.nyu.edu (access2.cims.nyu.edu [128.122.49.16])
	by mx2.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p6DNDjg0003593
	for <shasha@cs.nyu.edu>; Wed, 13 Jul 2011 19:13:45 -0400 (EDT)
Received: from access2.cims.nyu.edu (localhost [127.0.0.1])
	by access2.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p6DNDjcN014700;
	Wed, 13 Jul 2011 19:13:45 -0400 (EDT)
Received: (from shasha@localhost)
	by access2.cims.nyu.edu (8.14.4+Sun/8.14.4/Submit) id p6DNDjtN014699;
	Wed, 13 Jul 2011 19:13:45 -0400 (EDT)
Date: Wed, 13 Jul 2011 19:13:45 -0400 (EDT)
From: Dennis Shasha <shasha@courant.nyu.edu>
Message-Id: <201107132313.p6DNDjtN014699@access2.cims.nyu.edu>
To: dbindelglass@suntradingllc.com, shasha@cs.nyu.edu
Subject: questions to ask
X-Scanned-By: MIMEDefang 2.71 on 128.122.49.96
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (mx2.cims.nyu.edu [128.122.49.96]); Wed, 13 Jul 2011 19:13:56 -0400 (EDT)
Status: R


Dear Denise,

Please send this to the prospective students:

========

Q for smarties is designed to be very hands-on.
It will alternate between discussions of language and algorithmic
features and then challenge exercises that you will program.
There is often an easier and a harder variant of each challenge.
Solutions are included in the zip files I will send you, so you
can always follow along.

The purpose of this questionnaire is to help me figure out how
to tailor my course to the different backgrounds of the students.
If you have little or no background in Q, please just answer "just getting
started". The course is already designed for you.

1. What is the longest program you have written that is 
in q or kdb?

2. If it's not very confidential, could you include some challenging
part of it?

3. For kdb, have you written:
* by clauses 
* "each" for array-valued fields
* foreign key joins 
* lj joins
* aj, wj joins etc.
* a user-defined function  
* splayed tables
* partitioned tables
* grouped tables

4. For q proper, have you written
* string-manipulation functions
* numerical functions
* dynamic programming algorithms
* clustering
* machines learning algorithms

5. Consider the following exercise.
You want to calculate intraday NAVs (net asset values) for a portfolio
on a historical basis.
You have tick data and want to recompute the NAV with each
update of any constituent in the basket historically to simulate
a trading strategy.

For example, given a portfolio having two securities a and b

mytbl: ([]time:09:30:00.0 + til 10;sym:`a`a`a`b`b`a`a`b`a`b;price:1 2 3 100 101 2 3 99 2 100)


myqty:([sym:`a`b]weight:10 20) 

where weight is the number of shares help by the portfolio.
So portfolio holds 10 shares and b holds 20.
Compute the tick by tick NAV of the portfolio.

How would you go about solving this?

Thanks very much,
Dennis Shasha

===========

Best,
Dennis

