Vietnam Quantitative Finance Society

User Name
Password
Reply
02-27-2008, 01:20 AM   #1
Tan Huynh

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 10
Thanks: 7
Thanked 2 Times in 2 Posts




Default Programming interview questions

Dear all,

Here's a list of programming questions that I received from a quantitative prop trading company in London. Have fun .
  1. Write a function to print the first N Fibonacci numbers
  2. You have an ordered, doubly-linked list. Write a function to insert a new, arbitrary element into the list, maintaining the order of the list. Assume the comparison operators “<” and “>” correctly compare elements of the list.
  3. How can you prevent deadlocks in a multi-threaded application?
  4. Describe the similarities and differences between blocking and asynchronous I/O.
  5. Given an array of 1002 numbers in the range of 1-1000 with two numbers duplicated, write pseudo-code with the following characteristic to determine the duplicate numbers (for clarity, there are two different numbers that appear twice in the array). It is fine to alter the array.
    • Optimized for speed
    • Optimized for memory
    • What is the efficiency of each of your two algorithms (Big-O notation)?
  6. On an analog clock, how many degrees are between the big hand and the little hand when the time is 5:15? At what point (to the nearest fraction of a minute) will the hands next meet?
  7. Write a function to print out the data in a binary tree, level by level, starting at the top.
  8. Write a function to determine if there is a cycle anywhere in a linked list.
  9. Describe the similarities and differences between TCP and UDP.
  10. There is a series of numbers in ascending order. All these numbers have the same number of binary 1s in them. Write a function f(m, n) that returns the nth number in the ascending series of numbers with m 1-bits set. For example, f(1, 2) is 2.
  11. Describe the similarities and differences between a “thread” and a “process”.
  12. Java: How are “synchronized”, “wait”, and “notify” used?
  13. Write a function to convert a string into a signed integer (not using library functions).
  14. Write a function to convert a signed integer into a string (not using library functions).
  15. Write pseudo-code to sort a file containing up to 10 million records where each record is a unique 7-digit integer.
  16. In general, how would you describe your own code?
Tan Huynh is offline Reply With Quote
The Following User Says Thank You to Tan Huynh For This Useful Post:
shinichi9htv (02-27-2008)
03-03-2008, 07:14 PM   #2
trung55

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 35
Thanks: 16
Thanked 24 Times in 11 Posts




Default

Thanks alot for sharing.
Is that a programming job? I'm surprised to see so many programming questions. How much time were you given to solve them?
trung55 is offline Reply With Quote
03-03-2008, 07:20 PM   #3
sonny phung

Member
No Avatar
 
Join Date: Feb 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts




Default

Quote:
Originally Posted by Tan Huynh View Post
Dear all,

Here's a list of programming questions that I received from a quantitative prop trading company in London. Have fun .
  1. Write a function to print the first N Fibonacci numbers
  2. You have an ordered, doubly-linked list. Write a function to insert a new, arbitrary element into the list, maintaining the order of the list. Assume the comparison operators “<” and “>” correctly compare elements of the list.
  3. How can you prevent deadlocks in a multi-threaded application?
  4. Describe the similarities and differences between blocking and asynchronous I/O.
  5. Given an array of 1002 numbers in the range of 1-1000 with two numbers duplicated, write pseudo-code with the following characteristic to determine the duplicate numbers (for clarity, there are two different numbers that appear twice in the array). It is fine to alter the array.
    • Optimized for speed
    • Optimized for memory
    • What is the efficiency of each of your two algorithms (Big-O notation)?
  6. On an analog clock, how many degrees are between the big hand and the little hand when the time is 5:15? At what point (to the nearest fraction of a minute) will the hands next meet?
  7. Write a function to print out the data in a binary tree, level by level, starting at the top.
  8. Write a function to determine if there is a cycle anywhere in a linked list.
  9. Describe the similarities and differences between TCP and UDP.
  10. There is a series of numbers in ascending order. All these numbers have the same number of binary 1s in them. Write a function f(m, n) that returns the nth number in the ascending series of numbers with m 1-bits set. For example, f(1, 2) is 2.
  11. Describe the similarities and differences between a “thread” and a “process”.
  12. Java: How are “synchronized”, “wait”, and “notify” used?
  13. Write a function to convert a string into a signed integer (not using library functions).
  14. Write a function to convert a signed integer into a string (not using library functions).
  15. Write pseudo-code to sort a file containing up to 10 million records where each record is a unique 7-digit integer.
  16. In general, how would you describe your own code?
Em biết vài câu, để em thử tý vậy
1. This one might be for stretching purpose only

3. Using ordered lock

4. Do not remember much, blocking means the receiver has to wait until there is a message arrive, during that time the it blocks the IO (like single thread)

5.1. Store in an array, O(n)
5.2. Selection, O(n2), right?

6. Do a lot of calculation and not sure about the result

7. Using queue

8. Similar to one of anh Hung NQ's question

9. Both are protocol in network layer. TCP synchronous (send and wait), UDP asynchronous (send and send)

10.

11. Both are used for simulation of simultaneous-function processor. 1 processor carries on many processes, 1 process consists of many threads. To use many processes we need to change the registers (using stack), which is not required by threads.

12. Every part inside synchronized{} cannot be executed concurrently by many threads. It's like there are many people but they have only one phone line. Therefore, only one person can use the phone at a time. 'wait' means that if a thread are inside synchronized{} too long, it should give up the 'flag' to other thread to access the resource. If person A use the phone too long, it should give person B the right to use the phone. In return, when B finishes using the phone she 'notify' A to use the phone

13. 14. 15. Not sure about the real code

16. Not sure about the question
sonny phung is offline Reply With Quote
03-04-2008, 03:19 AM   #4
Tan Huynh

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 10
Thanks: 7
Thanked 2 Times in 2 Posts




Default

Quote:
Originally Posted by trung55 View Post
Thanks alot for sharing.
Is that a programming job? I'm surprised to see so many programming questions. How much time were you given to solve them?
I don't know about the job details but it is for a trader position. The time slot for the programming part is 1 hour and 30 minutes.
Tan Huynh is offline Reply With Quote
03-12-2008, 12:15 PM   #5
sonny phung

Member
No Avatar
 
Join Date: Feb 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts




Default

Quote:
Originally Posted by Tan Huynh View Post
I don't know about the job details but it is for a trader position. The time slot for the programming part is 1 hour and 30 minutes.
with all of the programming questions in only 1h30, I think it is quite tough for ones with little programming experience
I guess all traders are programmers
sonny phung is offline Reply With Quote
03-12-2008, 07:30 PM   #6
trung55

Member
Private
No Avatar
 
Join Date: Jul 2007
Posts: 35
Thanks: 16
Thanked 24 Times in 11 Posts




Default

Yah look like traders have got to be programmers to be able to answer those questions.
So I guess it's a systematic high frequency trading hedge fund. Interesting.
What a pity we do not have many quant hedge fund around in Asia? I think most are in either London or New York, pls correct me if I'm wrong.
trung55 is offline Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Save or bookmark this site with: Del.icio.usStumble It!AddThis.com
All times are GMT +7. The time now is 07:28 AM.
Powered by vBulletin Version 3.7.2