C Board  

Go Back   C Board > Community Boards > General Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 11-14-2008, 05:51 PM   #1
Registered User
 
Join Date: Aug 2005
Posts: 185
Submitting a Code Sample to an Employer

Has anyone done this? I have a wonderfully complex algorithm that I wouldn't mind submitting. It's comprised of 11 source and header file and contains around 700 lines of code, plus a makefile. This is my most sophisticated from scratch algorithm, though it's very far from perfection. It would probably take me another week to polish it up, but I have doubts that even after polishing, that it will reach the state of perfection. Has anyone dealt with the issue of what type of code sample to submit to an employer? I'm trying to get into an interdisciplinary field, that would closely resemble computer science...you might say scientific programmer. While I feel like I'm a good scientific programmer, I'm not sure that I'm a good programmer.
thetinman is offline   Reply With Quote
Old 11-14-2008, 06:35 PM   #2
and the hat of sweating
 
Join Date: Aug 2007
Location: Toronto, ON
Posts: 3,282
I've never had any company ever ask me for any sample code. They usually just ask me questions or give me a simple test to complete.
__________________
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
cpjust is offline   Reply With Quote
Old 11-14-2008, 07:44 PM   #3
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,768
Quote:
Originally Posted by thetinman View Post
Has anyone done this? I have a wonderfully complex algorithm that I wouldn't mind submitting. It's comprised of 11 source and header file and contains around 700 lines of code, plus a makefile. This is my most sophisticated from scratch algorithm, though it's very far from perfection. It would probably take me another week to polish it up, but I have doubts that even after polishing, that it will reach the state of perfection. Has anyone dealt with the issue of what type of code sample to submit to an employer? I'm trying to get into an interdisciplinary field, that would closely resemble computer science...you might say scientific programmer. While I feel like I'm a good scientific programmer, I'm not sure that I'm a good programmer.
First, will the potential employer have time to read and comprehend it? Being impressive is good, but being impressive and terse is better. Another huge consideration is, if you are hired, you may find that this code ends up the property of your employer and you lose control over it. I personally keep my favorite creations to myself.

In fact, I have one of those contracts which basically says "Everything you think, 24 hours a day, is property of The Company." I have to be extremely careful what I reveal or I risk losing my own assets.

Just think it through and be careful.
__________________
"Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot
brewbuck is offline   Reply With Quote
Old 11-15-2008, 12:39 AM   #4
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 11,338
Quote:
Originally Posted by brewbuck
Another huge consideration is, if you are hired, you may find that this code ends up the property of your employer and you lose control over it.
That sounds unlikely if you assert copyright over the code since you wrote it when not under your would-be employer's payroll.
__________________
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is offline   Reply With Quote
Old 11-15-2008, 07:36 AM   #5
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,768
Quote:
Originally Posted by laserlight View Post
That sounds unlikely if you assert copyright over the code since you wrote it when not under your would-be employer's payroll.
Not that unlikely.
__________________
"Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot
brewbuck is offline   Reply With Quote
Old 11-15-2008, 07:46 AM   #6
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 11,338
No, the circumstances are very different. Here you would be asserting copyright even before entering employment, thus the tangible expression of your idea is available for inspection (and for registration, for that matter). Of course, if you copy or rewrite your implementation into company code then the company would own that copy of the code, but that's too bad and is entirely your fault.
__________________
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is offline   Reply With Quote
Old 11-15-2008, 08:27 AM   #7
Registered User
 
Join Date: Aug 2005
Posts: 185
Quote:
Originally Posted by brewbuck View Post
First, will the potential employer have time to read and comprehend it?
If they read it, it is highly unlikely that a talented programmer or scientist would know what was going on -even if the code was beautifully written.
thetinman is offline   Reply With Quote
Old 11-15-2008, 08:35 AM   #8
Registered User
 
Join Date: Aug 2005
Posts: 185
Quote:
Originally Posted by cpjust View Post
I've never had any company ever ask me for any sample code. They usually just ask me questions or give me a simple test to complete.
I've been asked for sample code. One thing though, is that my coding ability goes both beyond what was taught to me in school and beyond anything I've done professionally. I've also been given tests in the past, some of which were not the least bit comprehensive. Sample code might be something that I could volunteer.
thetinman is offline   Reply With Quote
Old 11-15-2008, 09:42 AM   #9
l'Anziano
 
DavidP's Avatar
 
Join Date: Aug 2001
Posts: 2,630
Is this for a job interview?

99% of the time if it is for a job interview than they just want to see how good your code looks, in other words: do you comment your code and indent nicely.
__________________
My Website

"Circular logic is good because it is."
DavidP is offline   Reply With Quote
Old 11-15-2008, 10:07 AM   #10
Super Moderator
 
Bubba's Avatar
 
Join Date: Aug 2001
Posts: 7,814
I think they will probably be looking, if at all, for consistency. Consistency is very important. The length of the code or what it does is not nearly as important as how it looks (consistency falls into this as well) and how easy it would be to maintain. Are you throwing globals around everywhere or is the piece nice and tight and contained? Maintenance costs a lost so if you prove you can write easily maintainable code it will look a lot better than throwing them some super confusing uber algorithm. I'll take a loosely coupled piece any day over something that is so tightly coupled it takes a jackhammer to remove it.

I doubt they will have much time to really look at it but they may code review it and send you suggestions to see how you handle constructive criticism. Some want to defend their code at the first sign of criticism which is not a good trait and a huge red flag for me. You can learn a lot from most code reviews. Some of the suggestions you will agree with and some you won't but either way you should have good solid reasons for agreeing or disagreeing. Sometimes its not a matter of agreeing as much as this is how our company does A or B and we want our devs to follow suit.

It's always good to have another pair of eyeballs looking at your code b/c in the end we all make mistakes. In the end if the suggestions improve the quality and maintenance factor of the code or if it's a matter of following the way it's been done thus far then you would want to heed the suggestions rather than insist on your own way. All of us put our absolute best efforts forward but none of us write perfect code and code reviews are not there to put you down. They are used to help you as well as to be the first line of defense for possible bugs or later maintenance nightmares.

Most of your knowledge will be tested in the interviews. I doubt seriously that any place would choose to hire/not hire simply based on what you submit unless it is so ugly that no one can understand it...which I doubt it is.
__________________
If you aim at everything you will hit something but you won't know what it is.

Last edited by Bubba; 11-15-2008 at 10:15 AM.
Bubba is offline   Reply With Quote
Old 11-15-2008, 12:49 PM   #11
Registered User
 
Join Date: Aug 2005
Posts: 185
Quote:
Originally Posted by DavidP View Post
Is this for a job interview?

99% of the time if it is for a job interview than they just want to see how good your code looks, in other words: do you comment your code and indent nicely.
More or less for a job interview. I'm trying to get into a field that involves programming. I put some comments in my code (enough so that I can understand it a year later), and everything is indented. I'd just like to have something nice on hand in case a potential employer asks for a sample. Also, because I have little formal training in computer science, and my job requires very little programming, I'd like to be able to voluntarily send some nice looking code to a potential employer. Since I already have a full time job, it would preferably not be some big algorithm that takes weeks to writes.
thetinman is offline   Reply With Quote
Old 11-15-2008, 02:08 PM   #12
and the hat of sweating
 
Join Date: Aug 2007
Location: Toronto, ON
Posts: 3,282
Quote:
Originally Posted by brewbuck View Post
Just write "Copyright <your name>, <some year> All Rights Reserved." at the top of all your source files.

If some court chooses to act illegally, then I would find THEM in contempt of court and ignore any ruling that they spewed out.
__________________
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
cpjust is offline   Reply With Quote
Old 11-17-2008, 07:33 AM   #13
chococoder
 
Join Date: Nov 2004
Posts: 443
just writing a copyright notice is useless.
If you signed (implicitly or explicitly) a contract releasing ownership to the company that's that, the copyright is now owned by that company.
And if you don't agree to such a clause, most likely you won't be hired anyway.

Of course any company requiring candidates to send in samples of their work isn't likely to get the coders they think or want to get.
A lot of the code they will get sent will be pilfered from the internet or books, a lot of the rest created on purpose with express intent to be as nice looking as possible (maybe even created by others for pay rather than by the actual candidate), and thus won't reflect the abilities of the candidates except their ability to plagiarise and defraud others.

Code written on-site with the hiring company by the candidate during the interview process is a better gauge, but given the stress the candidate is under while writing it it's unlikely to be a representative sample of what he is capable of producing under normal conditions.
Most hiring crews don't take that fact into account however.
jwenting is offline   Reply With Quote
Old 11-17-2008, 09:20 AM   #14
and the hat of sweating
 
Join Date: Aug 2007
Location: Toronto, ON
Posts: 3,282
Quote:
Originally Posted by jwenting View Post
just writing a copyright notice is useless.
If you signed (implicitly or explicitly) a contract releasing ownership to the company that's that, the copyright is now owned by that company.
And if you don't agree to such a clause, most likely you won't be hired anyway.
But that's only for code you write while working at that company, not stuff you wrote in the past (well unless the contract is seriously messed up, in which case I'd tell the company where they can stick their contract).
__________________
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
cpjust is offline   Reply With Quote
Old 11-17-2008, 09:41 AM   #15
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Quote:
Originally Posted by cpjust View Post
But that's only for code you write while working at that company, not stuff you wrote in the past (well unless the contract is seriously messed up, in which case I'd tell the company where they can stick their contract).
And I doubt that unless you are specifically paid for such "previous work" and it's code that you have actually written as personal development, it would actually hold up in court. Certainly, a new employer would not have the rights to code you wrote for a previous employer - it wouldn't be yours to give away (or sell) anyways. And if they are hiring you to get access to code you wrote before they hired you, then they should really pay you specifically for that.

Obviously, this doesn't mean that the company can't put in the small print for the solution that the code you send will henceforth belong to them, just like many photo competitions allow the competition company to use your photos "in any way it likes, whether you win or not" - a good way to build up a large library of stock photos on any or all subjects...

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get sample shell code to work... jcafaro10 C Programming 4 04-05-2009 09:55 PM
Pre-Interviewer asking sample code jayee_spicyguy C Programming 3 02-09-2009 11:21 AM
True ASM vs. Fake ASM ???? DavidP A Brief History of Cprogramming.com 7 04-02-2003 04:28 AM
stricmp() where can I view the sample code? Unregistered C Programming 5 06-28-2002 08:40 AM
Interface Question smog890 C Programming 11 06-03-2002 05:06 PM


All times are GMT -6. The time now is 09:27 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22