Advice on a coding project

Discuss all those difficult questions here.

Advice on a coding project

Postby BenTheMan » Mon Jul 26, 2010 6:13 pm

So a company with which I've interviewed has sent me a C++ competency test---basically I have to write a program (which is similar to one of the program exercizes in Concepts) which solves a finance problem. (I hesitate to get into any more detail than this, as there is a spooky non-disclosure agreement on the assignment.)

The question is: how fancy should I make the code? There's not a lot of room to do things like inheritance, etc., but I could write the code in such a way where it was apparent that that's what I had in mind. My gut reaction says that this can only help me (i.e., I have a positive expectation), but I'd like a second opinion.
BenTheMan
 
Posts: 38
Joined: Sat May 08, 2010 7:17 pm

Re: Advice on a coding project

Postby BenTheMan » Mon Jul 26, 2010 6:26 pm

Let me add, a bit more specifically:

During the interview, there were a few questions on pure virtual functions, which I didn't get right. Would it be a bad idea or a good idea to use a pure virtual function in the coding project?
BenTheMan
 
Posts: 38
Joined: Sat May 08, 2010 7:17 pm

Re: Advice on a coding project

Postby mj » Mon Jul 26, 2010 11:59 pm

I would say use virtual functions if they are natural for the problem. Personally, I hardly ever use virtual functions that aren't pure virtual in the base class.

eg, if there is somewhere you are tempted to use switch then using pure virtual functions instead will win you points.

(There's a certain book I could recommend at this point!)
mj
Site Admin
 
Posts: 792
Joined: Fri Jul 27, 2007 7:21 am

Re: Advice on a coding project

Postby BenTheMan » Sat Jul 31, 2010 4:28 pm

One more question---

The program is due next Friday, but I'm done with everything. It's fast. It's cute. It's reusable. Should I add more functionality? I'm supposed to price a Call option, but I've added puts as well---I could also do digitals, forwards, etc. I could calculate the greeks pretty easily, too---they asked HOW I woud calculate the delta, so I implemented that (option pricing method + BS result to compare) to show that my answer was right. After doing your coding assignments 1 and 2 in concepts, all the code is pretty much in place for everything else.

I guess I should be more direct: would it be better to do more than expected and turn it in on time or complete the assignment early?

Thanks again Mark.
BenTheMan
 
Posts: 38
Joined: Sat May 08, 2010 7:17 pm

Re: Advice on a coding project

Postby mj » Sat Jul 31, 2010 10:43 pm

My main advice would be to add a test-suite so that everything they asked for is done twice in two different ways, and a program runs through showing that everything agrees.
mj
Site Admin
 
Posts: 792
Joined: Fri Jul 27, 2007 7:21 am

Re: Advice on a coding project

Postby BenTheMan » Sun Aug 01, 2010 9:17 pm

Thank you for the advice Mark. I really appreciate it.
BenTheMan
 
Posts: 38
Joined: Sat May 08, 2010 7:17 pm


Return to Interview questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron