Slashdot Mirror


Where Should I Get My Job Interview Code Samples?

crlove asks: "I'm preparing for an upcoming job interview and my interviewer will want to see some code samples. Unfortunately, all of the coding I've done work-wise since college is not only proprietary, but often classified. To be honest, with long days at work and a busy life outside of it, I haven't had much time to code on my own. So, what should I show my interviewer? Should I start working up some code samples? If so, what would be considered sufficiently complex to take to an interview?"

249 comments

  1. Easy solution by Anonymous Coward · · Score: 5, Funny

    If you dont have time, pay someone on rentacoder.com to write something for you.

    1. Re:Easy solution by jo42 · · Score: 1

      Why should he do that? All the source code he needs is over at http://sourceforge.net/

  2. A total waste of time by toddbu · · Score: 4, Insightful

    Anytime somebody tries to show me a code sample, the first thing I ask them is where they downloaded it from. Seriously, any employer that asks for a code sample has no clue what they're doing. They should put you at a whiteboard with a pen and have you write something on the fly.

    --
    If you don't want crime to pay, let the government run it.
    1. Re:A total waste of time by earnest+murderer · · Score: 4, Funny

      I agree.

      But since they asked, you might as well think big.

      --
      Platform advocacy is like choosing a favorite severely developmentally disabled child.
    2. Re:A total waste of time by AstrumPreliator · · Score: 0

      That's a horrible idea. What the hell are they supposed to write? "Write down a linked list object, you have 30 seconds on the clock!" Seriously, the only thing you could write down on a white board are simplistic data structures and algorithms which proves that you took a DSA class at one point; big whoop. It's not like they can ask you to write a kernel or they won't hire you. Perhaps they could ask you to correct some code with mistakes? But even then it just shows they have a rudimentary knowledge of the programming languages syntax.

      As to the original post, tell them the truth. You don't do a ton of coding on your free times as you have little of it and all the other code you've written isn't yours to give out. If they don't understand this then I don't think you want to work for them anyway.

    3. Re:A total waste of time by lewp · · Score: 1

      If you run into a hiring manager like this, chances are it's a job you want. The managers and/or leads who take the time to make sure their programmers can code by sitting down and watching them do it are the ones who hire talented folks you'll be happy to work with. During the interview process you'll find out just how much you can expect out of your coworkers by looking at how much the hiring team expects out of you.

      (Of course, this isn't always the case -- a few rubes always slip by -- but it's true more often than not.)

      --
      Game... blouses.
    4. Re:A total waste of time by eln · · Score: 3, Informative

      I prefer to write a snippet of code on the board myself and ask the interviewee to interpret it. It can be difficult for people to come up with something on the fly during the pressure of an interview, but they should be able to follow the logic of a program written for them if they know the language (at least somewhat) and if they know anything about computational logic. I basically ask them to walk through the logic of whatever routine I put up on the board, and then ask them something specific about it (what will it print at the end, what is the value of variable x after execution, etc.).

    5. Re:A total waste of time by suv4x4 · · Score: 2, Insightful

      Seriously, any employer that asks for a code sample has no clue what they're doing. They should put you at a whiteboard with a pen and have you write something on the fly.

      You know, after so much typing, I don't know how to write :(

    6. Re:A total waste of time by MrAnnoyanceToYou · · Score: 1

      I've actually had tests in the last year and a half where there was a, "Code THIS in C++ / C# / Java / Whatever," or, "Write out how an insert on a B-Tree works." No biggie to me. Unfortunately, since I've been kinda learning four or five programming languages at once for the last year and a half, syntax is a real pain. In retrospect, I am not sure if any of the companies involved were companies I would like to work for.

      Regardless, I enjoyed the tests because they were interesting and helped me learn a thing or two, I guess. After I didn't know all the answers, I went off and looked them up.

    7. Re:A total waste of time by PinkPanther · · Score: 3, Interesting
      One of the better interviews I've had was for a Unix coding job. They sat me at an X terminal logged into a "guest" account and told me to write a simple directory listing program and that they'd be back in two hours.

      That was it. No other direction, no manuals. Ah, yes, there was "man"...but the $MANPATH was bare-bones and the guest account had extremely limited access to anything besides /usr/* and /home/guest. On top of that, the only editor that worked was "ed" (vi couldn't handle the term I was running in) and "cc test.c" threw a whack of errors [though I could fix it by tweaking $INCLUDE]

      After 5 minutes of mucking around, I left the interview room to track down my interviewer to ask for some tweaked permissions. That was win #1; apparently only 20% of interviewees came foreward before trying some type of coding, and even then most didn't know what exactly to ask for in terms of help.

      Once I was able to "man opendir", they left me alone for another 45 minutes then cut me off because they'd seen enough (watching the files from another account).

      Now, mind you, this was for a junior position so they weren't looking for much in the way of overall code structure, etc. They were more after whether the interviewer knew what Unix was about and if they would take the initiative to overcome some obstacles.

      --
      It's a simple matter of complex programming.
    8. Re:A total waste of time by ceoyoyo · · Score: 1

      A former PhD supervisor of mine liked to tell a story about a professor he knew who asked someone (him?) to go up to the board and write out a a radix 2 FFT function.

    9. Re:A total waste of time by zullnero · · Score: 5, Insightful

      You know what works even better than a "lets stare at the poor guy as he tries to scribble some code clear enough for us to understand, then begin to nitpick like a bunch of chest thumping, thirtysomething, 'I'm an experienced coder and should be the manager'" orgy? Checking references. It doesn't take that long to do. If you can't get anyone, you contact the guy and ask them for someone else, and make sure it's either a college professor or the actual manager/supervisor. Doing that, in conjunction with sending the guy a short project and having him do it over the weekend, is as good as anything else.

      Seriously, how much of your project will this potential employee be doing on the whiteboard? NO one codes that way. Once in awhile, you stand in front of someone else and scribble out a flowchart or a diagram to clarify something. That's it. Just because the guy forgot a semicolon somewhere on a whiteboard scrawl doesn't mean he'll take 5 times longer to get something done working within an IDE that has built in context checking, has a help system loaded with code samples, and an internet connection that allows him to go out and find snippets made free to everyone when he's stuck on something.

      In fact, I'd greatly prefer employing someone that resourceful over someone who will sit there and bang their head over some problem for days or weeks. If you have someone who can find code, understand it well enough to incorporate it, and is detail oriented enough to refactor it clean, that's worth a heck of a lot more than some altruistic chump who thinks it's better to rewrite the wheel for everything. Resourceful people get the work done on time.

      There are occasionally situations where a coder has to solve a problem that hasn't been solved before, or where there isn't a solution readily available. However, those situations are really, in this day and age, few and far between...and if a coder can understand and incorporate a snippet of code into a project and make it work, he probably understands enough to write code on his own.

    10. Re:A total waste of time by zullnero · · Score: 1

      Yeah, I shouldn't be replying to my own post, but to further elaborate on the value of checking references... Do it. If a guy was able to hack it at a job for at least several months, and was let go for lack of work (as opposed to being officially fired for whatever reason), or if a professor states that he was able to get the coursework done, then chances are, he probably knows how to code. Yes, employers aren't allowed to tear apart their old employees, and the length of time spent at various companies really isn't a clear indicator any longer (I take quite a few short term contracts). But employers will tend to give a good recommendation for those who were able enough to get the job done, and if a guy worked for a company for, say, 11 months, chances are he was able to get his work done to some degree (a manager will fire or demote a guy in 3 or 4 at the longest, if they can't get ANYTHING done). Too many interviewers don't place enough value on references and recommendations. While a lot of coders still have their friends pretend to be ex-coworkers as an attempt to fudge good references, you have to check up on the references themselves. Usually it just takes a quick web search, a call made to the front desk of a company, or something of that nature. If you're serious about finding the best talent, you have to do these things.

    11. Re:A total waste of time by Anonymous Coward · · Score: 1, Insightful

      "They should put you at a whiteboard with a pen and have you write something on the fly."

      To prove your memorization skills? That is why we have reference books, so we don't have to waste our time memorizing hundreds of interfaces and templates.

    12. Re:A total waste of time by symbolic · · Score: 1

      Anytime somebody tries to show me a code sample, the first thing I ask them is where they downloaded it from.

      I can show you samples, and I can point you to exactly where I got them- hint: they aren't downloaded. While I'm sure there are those who would try to cheat their way through this, don't be so quick to judge- it's as bad as the fallacious thinking behind the four-year-degree syndrome. For those wondering where to get the samples...CODE THEM. Write a small app.

    13. Re:A total waste of time by Osty · · Score: 2, Interesting

      I prefer to write a snippet of code on the board myself and ask the interviewee to interpret it. It can be difficult for people to come up with something on the fly during the pressure of an interview, but they should be able to follow the logic of a program written for them if they know the language (at least somewhat) and if they know anything about computational logic. I basically ask them to walk through the logic of whatever routine I put up on the board, and then ask them something specific about it (what will it print at the end, what is the value of variable x after execution, etc.).

      That's a useful exercise for ~15 minutes, but what are you doing for the other 45 minutes of the interview?

      I tend to break a 60 minute interview down into 10-15 minutes talking about the candidates previous experiences based on his resume, asking him questions about projects he's listed and such, why he designed the solution the way he did, his role in designing and implementing a solution, etc. The next 15-20 minutes are spent on a simpler item like you mentioned, though I'll usually do a "trivial" programming task (something like reversing words in a string -- relatively simple, no "a ha!" solution requirement, and lets me see how they think about memory management and algorithm complexity). I'll use the remainder of the time on a larger question that focuses more on design. Something like designing the behavior of a Minesweeper game when you click on a cell that's not adjacent to any mine (good exercise in recursion, data structure management, and edge case detection). If there's any time left after that I'll field any questions the candidate may have about the position, the team, or the company.

      Of course no two interviews are the same. Some people may end up spending a full 45 minutes trying to figure out how to reverse the words in a string. Others might blow through the design and code for minesweeper in 15 minutes. You at least have to tailor the interview questions to the level of the job (if a candidate for a senior developer position gets stuck on reverse words, it's game over), and to some extent the candidate himself (I give candidates the option to answer in whatever language they feel most comfortable in; to date I've mostly received C/C++/Java/C# answers, but I've had a few Javascript answers. I'm still waiting for a TSQL answer ... :).

      In case it's not obvious, what interviewing I've done has been for development positions. Interviewing for QA, project management, or people management would be substantially different. Then again, I wouldn't be a part of any of those interviews since I'm a developer.

    14. Re:A total waste of time by BadAnalogyGuy · · Score: 1

      $string = "this is a sentence.";
      print join ' ', reverse split /[ \.]/, $string;
      print '.';
      12 seconds!
    15. Re:A total waste of time by Osty · · Score: 3, Insightful

      Unfortunately, since I've been kinda learning four or five programming languages at once for the last year and a half, syntax is a real pain. In retrospect, I am not sure if any of the companies involved were companies I would like to work for.

      Any good interviewer will be looking more for your ability to understand (ask for clarification if you need it -- oftentimes an interviewer will intentionally make a question vague or leave out an important piece of information to see how you handle adversity) and solve the problem (preferably in an optimal way, but a working solution is better than nothing) rather than your ability to remember semicolons and public/private/protected. As long as your syntax is relatively close, it doesn't matter (a good IDE will fix it all for you anyway). Bonus points for catching edge cases and actually testing your solution on your own (a good interviewer will walk you through that, but if you can beat him to the punch on finding problems in your code then you'll have taken away any negatives you may have had for having bugs in the first place).

      If the company is hiring for a full-time position (as opposed to a contractor), they should be much more interested in your ability to learn and problem solve than your ability to remember your semicolons. Syntax and language-specific constructs can be solved with IDEs and documentation (to a certain extent, of course). Problem solving is much harder to learn than programming languages.

    16. Re:A total waste of time by gweihir · · Score: 1

      They should put you at a whiteboard with a pen and have you write something on the fly.

      Exactly! That way they can also observe your problem-solving process and your ability to communicate about your work. A code sample is mostly worthless. Even if you did write it yourself, it is impossible to tell a) how long it took b) what was wrong with the first revision c) who gave you input d) did you actually implement the right functionality for the problem, ...

      So I agree, an employer that asks for a code sample is clueless...

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    17. Re:A total waste of time by eln · · Score: 1

      Ah, but you're interviewing with a guy who has a pathological hatred of Perl (believe me, this is incredibly common among developers, and even sysadmins).

      Game over, man, game over!

    18. Re:A total waste of time by BadAnalogyGuy · · Score: 4, Funny

      If loving Perl be wrong, I don't wanna be right.

    19. Re:A total waste of time by Osty · · Score: 1

      $string = "this is a sentence.";
      print join ' ', reverse split /[ \.]/, $string;
      print '.';

      Okay, now do it without using a built-in split, join, or reverse function. Oh, yeah, and make sure the result ends up in the same initial string variable (or string buffer object, if you're working in a language with immutable strings) without using any extra storage space beyond a single character.

      It's not as easy as just splitting, reversing the resulting array, and joining it back together. This is a test to see how you handle string and array manipulation, not whether or not you happen to know the language or standard library. My base assumption is that you can do most "simple" interview questions in three lines of code or less if I allowed you to use built-in structures or methods. :)

    20. Re:A total waste of time by jrockway · · Score: 1

      > /[ \.]/

      No need to quote . inside character classes. Use [.] or \., but not both.

      --
      My other car is first.
    21. Re:A total waste of time by jrockway · · Score: 2, Insightful

      > This is a test to see how you handle string and array manipulation, not whether or not you happen to know the language or standard library.

      Maybe you're not aware of this, but many languages don't have strings, arrays, or even variables that refer to "memory locations". (Lisp, haskell, etc.)

      Anyway, I doubt any place is hiring you to write stdlib for them; they're hiring you to write applications. There's nothing wrong with knowing how to reverse a string with the good-old while *q-- = *p++ trick, but your daily work is going to be 99% interacting with the libraries that other people have built. Therefore, I suggest that you as a question that's actually relevant, instead of "I'm sooo cool because I remembered an example on the board from a CS class". You're hiring programmers to solve problems, not copy their CS textbooks.

      --
      My other car is first.
    22. Re:A total waste of time by jrockway · · Score: 0, Troll

      > working within an IDE that has built in context checking, has a help system loaded with code samples, and an internet connection that allows him to go out and find snippets made free to everyone when he's stuck on something.

      There's a recipe for excellent code. Let the IDE write most of it, and fill in the gaps with stuff cut-n-pasted from the Internet. BRILLANT!

      Call me in a few years when you need a highly-paid consultant to fix everything.

      --
      My other car is first.
    23. Re:A total waste of time by Ihlosi · · Score: 1
      There's nothing wrong with knowing how to reverse a string with the good-old while *q-- = *p++ trick,

      The OP was referring to reversing the _words_ in a string, not the _characters_ in a string. Quite a different beast.

    24. Re:A total waste of time by 91degrees · · Score: 1

      I did an interview once where I was asked to write some bit operation code (reverse bit order of a 32 bit vlaue).

      It's surprising that some people claim to be C programmers but can't do that.

    25. Re:A total waste of time by Ihlosi · · Score: 1
      It's surprising that some people claim to be C programmers but can't do that.

      Aww. Don't force the poor C programmers to do bit-twiddling that should be done in assembly for any kind of efficiency.

    26. Re:A total waste of time by BadAnalogyGuy · · Score: 1

      I was handling line continuation characters.

    27. Re:A total waste of time by toddbu · · Score: 1

      References and recommendations are as big a waste of time as looking over a piece of code that you get from an interviewee. Even if I know that the reference works for the company that they say they do, how do I know that they have any clue that they know what they're talking about? As far as I'm concerned, there's no difference between someone who has great references and someone with a high GPA from a notable university. Just because you were able to make somebody else happy with your performance doesn't mean that you'll be able to do the work that I have for you to do. The only way for me to make that determination is to test you in some way.

      --
      If you don't want crime to pay, let the government run it.
    28. Re:A total waste of time by Osty · · Score: 3, Insightful

      Therefore, I suggest that you as a question that's actually relevant, instead of "I'm sooo cool because I remembered an example on the board from a CS class". You're hiring programmers to solve problems, not copy their CS textbooks.

      If your daily job could be boiled down to 15-30 minute bite-size chunks of code that can stand all on their own, I'd happily ask you an interview question around that. Chances are that's not going to be the case. Therefore the point of the question is not so much, "Can you remember your basic CS 101 class?" and more, "I need to keep you up at the white board, thinking through a problem, asking questions, and generally getting a feeling of how you think and work." A "simple" question is best for that because you can fully solve and analyze the problem in 15-30 minutes. If you just bust out a solution based on rote memorization, you're going to be thrown for a loop when I ask you to do it in a different way, or to analyze why your solution does what you think it does, or what performance characteristics you'd expect to see from your solution, etc.

      Don't get hung up on the actual question. That's just a vehicle to analyze more important stuff. On the other hand, if you can't solve the problem, that's a whole different issue. It might be the question was too hard, inappropriate for the position, or required an "a ha!" type of solution that you wouldn't get unless you'd seen the question before. That definitely happens, but you get a pretty good question calibration when you use it across many different candidates. That means that unless you're testing out a brand new interview question, the more likely issue is with the candidate instead. Now it's up to you as an interviewer to see if you can figure out where the problem lies and determine if it's a superficial you can work with (candidate is just very nervous and wouldn't necessarily be that bad in a normal situation) or a deeper problem that means the candidate is not a good fit for your team. If you can't do that, you've failed as an interviewer just as much as the candidate failed as an interviewee.

      As for your point about functional languages, that'd make sense if I were hiring you for a position where you'd work with a functional language. If you're interviewing for a 100% .NET or Java shop, busting out Haskell or Lisp in your interview (beyond mentioning them on your resume) is likely to do more harm than good. You'll get "cool points" for knowing a functional language, but if you can't hack C/C++, Java, C#, Javascript or whatever I happen to be looking for, those cool points aren't going to do you much good. Yes, I know, you probably can learn the language. However if you haven't learned at least one of those languages by now, I have to question what you've been doing. Even coming out of university you should know one of Java, C, or C++ enough to answer a basic question. If you're coming from an industry position with only functional programming under your belt, that's a serious red flag.

    29. Re:A total waste of time by eyeye · · Score: 1

      YEAH! He even used the print function, what a loser!
      What you would get with your approach is the worst kind of developer, one who spends days or weeks reinventing his own convoluted and probably bug ridden version of the wheel because he doesn't know how to make his language work for him.

      --
      Bush and Blair ate my sig!
    30. Re:A total waste of time by daveewart · · Score: 1

      This is what I've done in the past when appointing technical staff (usually the posts have been sysadmin/tech-related where programming is just one aspect): I offer the applicants a choice of C, Perl, Python or Fortran: they choose and are given a very short program to look at in that language. "What text does this code output?" is what I ask. Typically, it is something like an NxN multiplication table or similar.

      --
      "If you think the problem is bad now, just wait until we've solved it." --- Arthur Kasspe
    31. Re:A total waste of time by quantaman · · Score: 4, Insightful

      Anytime somebody tries to show me a code sample, the first thing I ask them is where they downloaded it from. Seriously, any employer that asks for a code sample has no clue what they're doing. They should put you at a whiteboard with a pen and have you write something on the fly. A whiteboard is a lot different than a computer and all its associated resources. I've seen great coders freeze up when asked to code on a whiteboard and useless people come up with something great, especially when how clever they can be when writing an algorithm isn't what I'm interested in.

      Programs are large and very complicated systems, in my opinion a great programmer isn't someone who can write the fastest sort, it's the person with the skill and determination to quickly understand, and extend, large complicated programs.

      Thus when interviewing I like to have someone bring in a bit of their code. I then ask them to give an overview of what it does and how it works. I then ask them about how they would go about making a certain change in the requirements. What I'm looking for is how thoroughly they understand the design of the code and how well they can communicate that code to someone else. Even if they did download it they still have to really understand it and that's the hard part.
      --
      I stole this Sig
    32. Re:A total waste of time by somersault · · Score: 1

      You can do inline assembly in C if you want.

      --
      which is totally what she said
    33. Re:A total waste of time by Anonymous Coward · · Score: 0

      Why are people modding things up that are clearly incorrect?

      Yes, you can download code for a code sample. What happens if they ask you about the code? You're screwed.

      Even if you *can* pass off copied code as your own, it still isn't a waste to ask for it as an employer. What people choose to turn in tells you a lot about what they consider good code to look like. Most people think they are good coders, and when they copy a sample that sample is likely to reflect their own coding style. People will turn in bad code, not realizing how bad it is.

      I would never hire someone on the basis of a great code sample but a bad code sample is a good reason to pass on someone. At that point it doesn't matter whether it was original or not - they either can't write good code or they can't identify well-written code. (And most likely can't write it and in addition cheated)

      At the end of the day, programmers are paid to produce code. (Among other things of course) Asking a programmer for code samples is appropriate. Having them take a test is appropriate. Some candidates are offended by these things - you shouldn't be offended by a potential employer trying to determine how good you are.

      That said, if you don't have any appropriate samples just say so. Or turn in something old but be clear that it is old. If the code has issues point out what the issues are. Maybe it was produced in a hurry and lacks comments - say that up front and you'll be fine.

      Turning in a bad sample that you know is bad ok if you can articulate why it is bad up-front. The red flag here is for someone to turn in something they think is great but is actually lousy. Nobody produces good code all the time, but people who constantly produce bad code thinking it is good are very dangerous.

    34. Re:A total waste of time by jrockway · · Score: 1

      > I have to question what you've been doing.

      Really? I think the answer would be "writing code in functional langauges". Yes there is real production code written in Haskell -- darcs and pugs come to mind.

      --
      My other car is first.
    35. Re:A total waste of time by Project2501a · · Score: 2, Funny

      Paula? is that you?

      --
      ----
    36. Re:A total waste of time by Anonymous Coward · · Score: 5, Insightful

      That's a horrible idea. What the hell are they supposed to write? "Write down a linked list object, you have 30 seconds on the clock!"

      Haw! I just had a job interview yesterday and that's exactly what they asked me to do on the white board! Then they left me with my laptop and a coding assignment. In the past I had fantasized about doing that to people whom I had had to interview, so I didn't mind. After all, they want to make sure you can code.

      But, I've gotta say, I think this approach favors 1) people who've recently had programming classes where they cover general algorithms and data structures, 2) programmers who tend to think at an abstract level, whereas what I've found to be a more typically useful skill is the ability to translate business requirements (ie, what the customer wants) into code.

    37. Re:A total waste of time by jrockway · · Score: 1

      Yup. In fact, slashdot stripped out my tags :)

      --
      My other car is first.
    38. Re:A total waste of time by jack_csk · · Score: 1

      Agree. I remember being asked for code samples a few times when I was job hunting. Well, the only codes I might be able to pass would be either from my college stuff or those free time small apps and scripts that I wrote for personal use / fun - none of them would be as systematic and big as my work stuff. I think the employers should be scared if an interviewee can come up with lots of code from his/her previous work.

      Actually, I like the coding simple function on whiteboard interviews - that way, the employer will have a better picture on how the interviewee approach a question, as well as his/her understanding with common algorithms knowledge.

    39. Re:A total waste of time by bastia · · Score: 5, Interesting

      I disagree. I could be very useful in the interview process. We used it just to give us something very concrete and technical to discuss with the engineer. Throwing some people questions makes them very nervous, like they're being tested. Having them bring some of their own code to discuss makes most good engineers very relaxed. Here, they get to show their prospective employer something that they're reasonably happy with. If I ask any questions, they're usually very quick to answer. Now, I'm the "newbie" in the code, and they're just showing me around.

      I suppose that it depends why the potential employer wants it. Ask them. Many programmers just "steal" a page of code from some system they're working on even if it is proprietary. If you don't feel comfortable doing that, just work on something for a few hours. Whatever you have time to do. It might not have to be complete or very complex.

      When one of my managers started asking new candidates for code samples, it was actually quite useful in the interview process. I really didn't care whether they wrote it or downloaded it. We weren't looking for "do you know how to write code." We were really interested in hearing you talk about code. Hopefully, you sent us something you wrote. But it wasn't critical to the interview that you did.

      That is, you'd send us a page or two of code the day before the interview. It didn't even have to be in the programming language we were hiring you for (Java, C++, or Perl). One guy sent us some LISP code. Your interviewers would read over the code. Then, during the interview, we'd take out a copy of the code, ask you to give us an overview of what it does, and ask some more specific questions.

      Some examples: For a systems/tools job, one guy just pointed us to a little module in CPAN. The CPAN code had good PERLDOC comments, of course. It was packaged as a module. The guy could explain why he ended up writing it and talk about the code even though it had been a few years since he touched it. Another guy sent us code to a CGI script that he used on a personal web server to track some data between him and his friends. That code was okay, and the guy could explain what he was doing. But it was also a giant flat script. No subroutines. Almost no comments. Program logic and HTML output intervleaved in a somewhat confusing manner. The developer who sent us the CPAN code got the job. Not just on the basis of his code, but it just confirmed everything else we got out of the interviews.

      For another position, some developers sent us a page or two lifted from some of their Java code. Of course, in any real application, a page or two of code doesn't show you much. Still, one guy sent us code with what were almost certainly errors in it. Rather than telling the developer, "Um, this looks like an error," we just asked him to explain what the code was doing. I've rarely seen a candidate look so nervous. He didn't really seem to know what the code was doing. Either he didn't write the code, or he didn't really feel comfortable talking about code. Bzzt. Not someone we wanted on our team. In any case, if you're going to steal code, try to have good enough taste to steal good code. And if you're showing me code that you didn't write, at least take the time to read it and understand what it does.

      For the same job, another developer sent us code for a few methods. As soon as I started asking about the code, she looked so relaxed. Now we were just two engineers talking about code. She started sketching in the margins of the page to show a rough system architecture and where this code fit in. She explained a bit of the data flow and some use cases where the users interacted with the system. We talked about the data being passed in to one of the methods. At one point, she wanted to explain something, realized that she hadn't sent us that code, and sketched a rough version of the code on the back of one of the pages. Her quick version had a silly error. When I pointed it out, she just laughed and said, "Oh, right. It should be like this," and she fixed it. But she was eager to get back to explaining where that sketched code connected to the other code. That's the kind of developer we were looking for.

    40. Re:A total waste of time by Dun+Malg · · Score: 1

      $string = "this is a sentence.";
      print join ' ', reverse split /[ \.]/, $string;
      print '.';

      Okay, now do it without using a built-in split, join, or reverse function. Oh, yeah, and make sure the result ends up in the same initial string variable (or string buffer object, if you're working in a language with immutable strings) without using any extra storage space beyond a single character.

      It's not as easy as just splitting, reversing the resulting array, and joining it back together. This is a test to see how you handle string and array manipulation, not whether or not you happen to know the language or standard library. My base assumption is that you can do most "simple" interview questions in three lines of code or less if I allowed you to use built-in structures or methods. :)

      Are you hiring coders or puzzle makers? Do you also ask them to write the code left handed?
      And that isn't even a very hard puzzle-- it just weeds out those who can't think under pressure. Move characters one at a time from the end to the beginning, shifting the remaining characters right and keeping count of what you've moved. When you hit a space, start shoe-horning the characters in offset by the length of the words already moved. The only varibles needed outside the string array are a single character, the offset, and the count. By "without using any extra storage space beyond a single character" I presume you only mean "no extra string storage", as stepping through a string is impossible without a reference count.
      --
      If a job's not worth doing, it's not worth doing right.
    41. Re:A total waste of time by Anonymous Coward · · Score: 0

      /bin/zsh
      export TERM=xterm
      alias vi=vim
      xsetroot -solid black

      What lamers don't have zsh? And if they expect you to work with that even-odd checkerboard pattern you need to report them to OSHA asap.

      If there was more than one terminal I would challenge them and say if I can write ls AND chmod in two hours I get THEIR job. I once wrote chmod in ~20 lines, supporting full "auog+-rwxs," syntax and octal using some bitmask magic. Still, pretty cool interview although I don't approve of the artificial challenges.

    42. Re:A total waste of time by Dun+Malg · · Score: 3, Interesting

      But, I've gotta say, I think this approach favors ... programmers who tend to think at an abstract level, whereas what I've found to be a more typically useful skill is the ability to translate business requirements (ie, what the customer wants) into code. Christ Almighty, mod parent up so that more people might see and understand this! In my line of work I deal with many kinds of microcontroller based systems which are configured via serial cable with one-off PC-based "front ends". As a result, I end up working with all manner of shoddy crap cobbled together in Visual Basic by electronic engineers whose idea of a "logical interface" is (apparently) to model the GUI after the layout of the parts on the circuit board. They're all whizzes at coding the devices, but they can't seem to grasp that whole "usability" thing. To set a device to turn off at 9pm and turn on at 8am M-F, first you define an event type to 0800-2100 and remember the number the app assigns that event as. Then you go to the day-type table and define a day as consisting of one or more events (again this is given a number). Then you create a schedule type, which consists of 7 days, each assigned a number as defined by the day-type table. This schedule type (a number!) is then filled in in a box on the device configuration screen. None of these screens are easily accessible from one another, and each screen must be exited back to the top menu to get to the others. We quit buying from that vendor solely because they never improved their front end-- their controller hardware was outstanding. I actually got ahold of the engineer who wrote the software for another such product once, and he practically hung up on me when I offered to send him the improved front end *I* wrote to crib from-- or even steal, if he wanted. They still send out the latest updates to that turd, which I promptly integrate into my vastly superior in-house version. I'm not even bragging here. I'm no coding wizard, I'm a just a process engineer. My version is only just OK. The "official" version is simply horrifyingly bad. Imagine a window full of list boxes that can't be resized beyond 640x480 because all the objects are of fixed size. If you maximize the window, all the contents remain crammed into a 640x480 box in the center, surrounded by empty gray space Why? The engineer's excuse: "Because many customers are working at 640x480 resolution on older hardware". I tried to explain that list boxes can be resized to fit arbitrary window dimensions, but he just didn't get it.
      --
      If a job's not worth doing, it's not worth doing right.
    43. Re:A total waste of time by Anonymous Coward · · Score: 0

      Oops I forgot the "before they can write ls" part.

    44. Re:A total waste of time by miyako · · Score: 1

      Granted, people can download code and offer it up, claiming that they wrote it- but I still think there can be an advantage in asking someone to provide some sample code. While I wouldn't want to go through a bunch of sample code for every single person that I interviewed, if it came down to a couple of people I can see the advantage in looking at some sample code and then quizzing the person on how it works, why they chose to do things a certain way, etc. That way, even if they didn't write the code, you can know that, at the very least, they can look at code someone else has written and tell you what it does (which can, at times, be a more difficult and important skill than being able to write the code in the first place).
      The other thing to remember is that, when it comes to code you want to have someone write on a whiteboard, there are really only a few common things that people are asked to write anyway. Every interview I've had, most of the time that I've been asked to write code on a whiteboard, it's basically come down to "write some algorithm from an Algorithms 101 course in your favorite language" anyway. 99% of the time it's been some combination of searching, sorting, replacing, and reversting strings, and people can easily memorize someone else's implementation of those things anyway.

      --
      Famous Last Words: "hmm...wikipedia says it's edible"
    45. Re:A total waste of time by Harlockjds · · Score: 1

      >but to further elaborate on the value of checking references

      the problem with this is that a lot of companies disallow the giving of references other than 'he worked here from date x to date y' (and all references has to go tough HR even for this basic info) so the only references that you can really check are friends of the prospect... which will always be positive references.

    46. Re:A total waste of time by CastrTroy · · Score: 2, Insightful

      Do people actually remember how an insert on a B-Tree works 10 years after they've taken a class, and never had to write their own B-Tree implementation, because it's a solved problem? I'd ask them to do something a little more creative. Rather than just being able to spew out facts, that anybody could figure out with a 5 minute look in a computer science textbook, ask them how to they would design something. Ask them anything except something that can be memorized. Present a problem, and then ask what data structures they would use, and justify their answer with an explanation.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    47. Re:A total waste of time by jrjarrett · · Score: 1

      I've had a couple of interviews where I have had to write code samples. One, even, where I was supposed to do this over the telephone!

      I choked, badly. In that kind of scenario, I don't do well. I admit, I'm reliant on the compiler to catch syntax issues, and I get wrapped up trying to solve that when hand-writing code on paper under pressure.

      For a new hire, fresh out of school, with little experience? Perhaps it's a way to demonstrate skill. For someone with 15 years of development experience? Not so much.

    48. Re:A total waste of time by ednopantz · · Score: 1

      We ask this of intern candidates and find it useful. With application: Resume, writing sample, and code sample.

      Usually the writing sample is some essay from their civ class. Their code is some class assignment as well. (CS students have reams of this stuff). If any one of the three is awful, they don't get a callback. (hoo boy! and do some stink).

      In the interview, we ask them to explain the code, and ask why did you do X here instead of Y. If you had another hour what would you change first, etc. We also google it to see if it has been downloaded.

      Then we whiteboard them, then we ask them to actually write some code. The code sample isn't the only thing we use, but it plays a useful role. It rules out the obviously bad coders, gives us something concrete to talk about (some candidates get really nervous and this can help them get started), and provides an early look at what they can do.

    49. Re:A total waste of time by zztong · · Score: 1

      I disagree. A pressure situation such as an interview, an unfamiliar environment, and a lack of supporting resources is not a place conducive for all programmers to be effective when you ask them to stand at a board and compose. I think you're likely to weed out some strong programmers with this approach.

      Asking for a code sample I think is better. I'm not sure what everybody looks for when they ask for a code sample, but I think it is a great way to initiate a discussion about code. I think it is better than asking them to site-read some code that I might provide. When we discuss their code I'm the one doing the site-reading and they should be the expert. There are some things I look for, such as a maturity when handling pointers/references, but mostly the code provides fuel for discussion.

      Some people agonize over what code to bring. I don't think it has to be much. You don't have to knock people's socks off with complexity. You could bring me an implementation of a bubble sort or the soundex algorithm, for instance. Some people bring in 1000's of lines of code - an entire applications - and I just have to pick a random spot down deep. That just means they get to be an expert for that much more.

      Now if a person tells me they cannot bring code, I understand. Many people don't get a lot of time to prepare. Some people want to bring in real work rather than a contrived sample, but they are not legally allowed to show code they wrote for someplace else. That's fine. I provide the code then. If a person refuses to bring code because they think it's dumb, then it's probably an indication were not going to get along.

      As to if they downloaded the code. Maybe that doesn't matter too much. I mean they're going to have to answer questions about it. If they downloaded the code then we'll both be site-reading it. I still got a discussion which is what I'm really going to use for a hiring decision. The person takes on some risk that it might become obvious the code wasn't theirs. If I find out, then it's not going to look good. If a person told me they didn't have a sample and brought somebody else's code to discuss, I would find that unusual, but could work with it.

      So my advice to the original topic... bring some code. I don't think it has to be much. I think 2-3 pages is fine. You should be able to ask them how large a sample they'd like to see and what you will be doing with it.

    50. Re:A total waste of time by szembek · · Score: 1

      I'm a software engineer, recent graduate, never heard of a B-Tree in my life. I would rather have a question about how to solve a problem. Explain object orientated programming and it's advantages, etc...

      --
      nothing
    51. Re:A total waste of time by computational+super · · Score: 0, Flamebait
      To set a device to turn off at 9pm and turn on at 8am M-F, first you define an event type to 0800-2100 and remember the number the app assigns that event as. Then you go to the day-type table and define a day as consisting of one or more events (again this is given a number). Then you create a schedule type, which consists of 7 days, each assigned a number as defined by the day-type table. This schedule type (a number!) is then filled in in a box on the device configuration screen.

      You should see Unix (minus the part about "screens").

      --
      Proud neuron in the Slashdot hivemind since 2002.
    52. Re:A total waste of time by computational+super · · Score: 2, Funny

      Oh, that's alright, you can do that in Java, too:

      Runtime.getRuntime( ).exec( "perl -e \"print join ' ', reverse split /[ \.]/, $ARGV[ 0 ];\"", new String[ ] { "this is a sentence" } );

      --
      Proud neuron in the Slashdot hivemind since 2002.
    53. Re:A total waste of time by Pete · · Score: 1
      Dun Malg:
      Are you hiring coders or puzzle makers? Do you also ask them to write the code left handed?

      Heh. I was going to suggest that they also be blindfolded, hands tied behind back, and be forced to type out the code (correctly first time, of course) on a typewriter. With a missing capslock key. And typing with their left pinkie toe. In Brainfuck.

      After all, if the goal is to see how well they can solve a pressure problem with pointlessly silly obstacles thrown in the way, why not go the whole hog? :)

      And that isn't even a very hard puzzle -- it just weeds out those who can't think under pressure. Move characters one at a time from the end to the beginning, shifting the remaining characters right and keeping count of what you've moved.

      Wow. If that's really the kind of solution Osty was thinking of in his original post, I'm quite disturbed. I was trying to think of something with slightly less horribly poor performance :), but couldn't come up with anything - even ignoring some of Osty's misleading restrictions (sheesh, "without using any extra storage space beyond a single character").

      Mind you, this sort of a problem would probably be quite well suited to Brainfuck. In more ways than one.

    54. Re:A total waste of time by stymyx · · Score: 2, Interesting

      I'm a software engineer, recent graduate, never heard of a B-Tree in my life. I would rather have a question about how to solve a problem. Explain object orientated programming and it's advantages, etc... Sounds like you are a Racecar Driver.
    55. Re:A total waste of time by frank_adrian314159 · · Score: 1
      ...idea of a "logical interface" is (apparently) to model the GUI after the layout of the parts on the circuit board

      You mean it's not?

      --
      That is all.
    56. Re:A total waste of time by Metasquares · · Score: 1

      Graduating without once hearing about a B-Tree is kind of strange, but they are incredible data structures and you should look them up. You shouldn't need to memorize things that are easily found (like the specific B-Tree algorithms), but you should at least know they exist or you will never be able to use them properly. Choosing the right data structure makes writing algorithms easier, which in turn makes writing programs easier. Some other interesting and useful data structures are B+ Trees, Splay Trees, Heaps, Hashes, and Skip Lists. Possibly with the exception of skip lists, these are part of a CS graduate's standard repertoire and you should know the basic details of how they work.

      OOP deals with something on a different level (that is, architecture). A knowledge of data structures and algorithms is still essential for filling in the class definitions and methods.

    57. Re:A total waste of time by szembek · · Score: 1

      Yeah actually my degree was in IT, so I'm kind of working my way into the software engineering field post-graduation. That's probably why I haven't been exposed to specific structures and such. Anything I wasn't taught in the CS courses I did take, I can pick up pretty easily with the help of some of the experienced programmers.

      --
      nothing
    58. Re:A total waste of time by Anonymous Coward · · Score: 0

      That sounds like something D. J. Bernstein would do.

    59. Re:A total waste of time by morie · · Score: 1

      A good GUI is important. Sort of like punctuation. Last thing you would want is to have your text appear in one continious block on the screen.

      I tried to explain that a text could be formatted to be better understood, but he just didn't get it.

      --
      Sig (appended to the end of comments I post, 54 chars)
    60. Re:A total waste of time by aghman · · Score: 1

      But, I've gotta say, I think this approach favors 1) people who've recently had programming classes where they cover general algorithms and data structures, 2) programmers who tend to think at an abstract level, whereas what I've found to be a more typically useful skill is the ability to translate business requirements (ie, what the customer wants) into code.

      I can't agree more. I've done quite a few interviews over the past few months and solving coding questions on a whiteboard never seemed to make much sense. In my 5+ year career, I've never written code that way, so why should it matter whether I can remember particular syntax on demand? What if you cannot design a workable system? Thats the important question to answer before hiring an engineer.

    61. Re:A total waste of time by poot_rootbeer · · Score: 1

      One of the better interviews I've had was for a Unix coding job. They sat me at an X terminal logged into a "guest" account and told me to write a simple directory listing program and that they'd be back in two hours.

      Let me get this straight... they expected you to spend TWO HOURS working for them without compensation, and this was one of the BETTER interviews you've had???

    62. Re:A total waste of time by snarfbot · · Score: 0

      sometimes you forget to switch to plain old text, and it gets posted as html, which ignores all the line breaks.

    63. Re:A total waste of time by MikeFM · · Score: 1

      I think code samples are great but you do need to be able to prove they were done by yourself. I suggest doing some opensource projects and posting the code to places such as Freshmeat and to include your name in your code. Create a sort of trail of authority proving you did the work. I think having done full-blown projects shows a lot more than having just thrown together a few bits of code anyway.

      I never liked the whiteboard method because it's hard to code when you're nervous (like at a job interview) and coding on a whiteboard is very different than coding on a computer so it makes you prone to making minor errors. It just isn't a very realistic way to see how people code.

      --
      At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
    64. Re:A total waste of time by MrAnnoyanceToYou · · Score: 1

      Post grad, I would suggest going back and doing some of the basic work regardless. I don't have a degree in CS, (Mainly because I flunked out drunk) but despite the link previously handed (interesting read, by the way)) but knowing a bit about how data tends to be organized and how operating systems tend to work and how architecture tends to be built helps in everything I do. I know I sound like a 'racecar driver programmer' when I say it that way. Because, of course, I am a bit of one.

      But here's my argument. Computer problems, when abstracted, often end up being very much alike. If you learn to attack them methodically and your method includes acquiring as much external knowledge as possible, the way you solve both small and large problems will be the same. However, since large problems are composites of many, many small problems, the solutions to large problems will simply grow out of your knowledge of the small ones. And, if you know how to solve all the little problems, you not only have a larger 'toolbox' of solutions, you also have the capability to know what tools are being used to solve the problems you aren't solving yourself.

      I personally feel that noone should be an architect without years of programming experience. I've seen too many people who thought they would be good at the architecture side of things screw up too badly. That doesn't mean, however, that in each and every one of the places I have ever worked there was someone that shouldn't be in that hat sitting there as well as someone that should be in that hat watching them screw up royally.

    65. Re:A total waste of time by maiden_taiwan · · Score: 1

      any employer that asks for a code sample has no clue what they're doing. They should put you at a whiteboard with a pen and have you write something on the fly.

      We do both. Coding at the whiteboard is necessary but NOT sufficient -- you can't demonstrate large-scale coding ability in 1 hour with a marker. A code sample shows how well a person works within a larger project, and whether they maintainable code or not. We've turned candidates down because they talked a good game and could write subroutines on the whiteboard, but their larger samples were a mess that we wouldn't want to maintain.

      That being said, we recognize that some coding is done under pressure :-) where the end justifies the means, so we ask the candidates about the context in which the code was written ("Get it done now" vs. "get it done right").

    66. Re:A total waste of time by toddbu · · Score: 1
      We've turned candidates down because they talked a good game and could write subroutines on the whiteboard, but their larger samples were a mess that we wouldn't want to maintain.

      If you're just asking for functions then you're doing something wrong. You should be asking them to solve complete problems. To understand their ability to grasp higher-level concepts, ask them non-coding questions. You can easily cover a lot of ground in an hour.

      --
      If you don't want crime to pay, let the government run it.
    67. Re:A total waste of time by toddbu · · Score: 1
      ... so it makes you prone to making minor errors

      Although I generally disregard minor errors, there's something to be said about being picky. At the very minimum, I expect the candidate to walk through the code and explain what it's doing. Most candidates will find an error or two along the way. Even if they miss something. that's ok, as long as it isn't something critical. Misspelled variable names and missing semi-colons are one thing. Failure to allocate memory to a pointer variable is something completely different.

      --
      If you don't want crime to pay, let the government run it.
    68. Re:A total waste of time by toddbu · · Score: 1
      The person takes on some risk that it might become obvious the code wasn't theirs

      So are you saying is that if someone can bluff their way through a piece of code then they're ok? I'm not sure that I want these kind of people on my team. I can't imagine how I'd ever think that somebody who would submit somebody else's code and then lie about it would make a valuable addition to my group. People who cheat before they're even hired are sure to be a problem later.

      --
      If you don't want crime to pay, let the government run it.
    69. Re:A total waste of time by PinkPanther · · Score: 1
      they expected you to spend TWO HOURS working for them without compensation
      I don't think that writing a "directory listing tool" is exactly "working for them". It isn't like they were going places with my code (though I guess they could have...I didn't make them sign an NDA or anything). If a company can truly take off because of the two hours I spent at a keyboard...I wouldn't want any part of them.

      But in all honesty, now that I'm interviewing 2 hours is a minimum amount expected for people we're looking to hire full time. We're a smallish company (new startup) and cannot afford to bring on people who either lack skills or who can't play nicely with others. I've moved away from coding tests to a generic pseudo-code written test (some coding questions, some problem-solving questions). That test takes anywhere from 1.5 hours to 4 hours to complete.

      I don't think that having someone show that they can do some work during an interview, compensation-less, is a problem. If they aren't willing to show that they have the capabilities and desire...why exactly would I want to hire them.

      On the flip side, if they didn't see the kinds of things we're thinking about and asking about, how would they know whether or not to take the chance on us?

      --
      It's a simple matter of complex programming.
    70. Re:A total waste of time by Anonymous Coward · · Score: 0

      How about Haskell? :-)

      revWords = unwords . reverse . words

    71. Re:A total waste of time by ggKimmieGal · · Score: 1

      Computer Science 1 classes have non-computer related majors writing this program without any libraries other than some standard I/O library. Not very hard at all. Just annoying.

    72. Re:A total waste of time by MikeFM · · Score: 1

      Yeh, logic errors are a big deal whereas minor typos aren't. I have trouble not switching to psuedo code when using a whiteboard just ebcause that's what I'm used to doing on a whiteboard.

      --
      At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
    73. Re:A total waste of time by ShinySteelRobot · · Score: 1
      That's a horrible idea. What the hell are they supposed to write? "Write down a linked list object, you have 30 seconds on the clock!"
      ITSATRAP!

      Er, ahem. Sorry. Seriously though, you need to write down a linked list object? That's an easy one, it should only take a few seconds...Lemme see...

      import java.util.*;
      ...
      List linkedList = new LinkedList();

      There you go, 'linkedList' is a linked list object, and it only took you a few seconds to write it down on the board. That should be all the answer they need, because if you're a knowledgeable object-oriented programmer who knows Java then that's the answer I'd expect. Don't give me some data structure BS you learned back in college, you'll rarely (if ever) need to write your own fundamental stuff (such as linked lists, etc) from scratch.
    74. Re:A total waste of time by Benwick · · Score: 1

      echo *

    75. Re:A total waste of time by llefler · · Score: 1

      If you were working for me, I'd be more concerned with your problem solving skills than whether you can code a B-Tree. Most structures I would hope you aren't going to be coding directly anyway. There are plenty of libraries for lists and sorts.

      I would want to know whether you could could break down a problem and put together a reasonable representation of code. Pseudocode would be more than sufficient.

      For instance, if you were given a vendor id and item number, could you generate a UPC (including check digit) using the following reference.

      http://en.wikipedia.org/wiki/Universal_Product_Cod e

      And then, I'd just hand you some code, tell you to take 15 minutes and write a description of what it does. It's much harder to work with someone else's code than it is to write your own.

      --
      It is amazing what you can accomplish if you do not care who gets the credit. -- Harry Truman
    76. Re:A total waste of time by maiden_taiwan · · Score: 1

      If you're just asking for functions then you're doing something wrong....

      Heh... that's what I get for giving a quick answer. You took me too literally. We certainly do not evaluate a software candidate simply by asking them to code a few functions. (Though a surprising number can't even do that.) Candidates with good-looking resumes first have an hour-long technical phonescreen. Then they visit for 4-5 interviews of an hour each, covering programming, databases, back-of-the-envelope problem-solving, previous jobs, etc. Lots of coverage from high-level to low-level, from big problems to small ones. Then they provide a code sample, then references.

      It seems like we're doing a pretty good job at it. Most engineers are happy here, the work is challenging, and the company's been profitable for years.

    77. Re:A total waste of time by geekoid · · Score: 1

      YOu know, I have stopped taking tests.
      I'll walk away. Too many times they where reviewed by people who didn't know what they were doing, or written very poorly. Often the 'solutions' were incorrect, or just different.

      One time a problem was put to me, and I solved it, but the guy said "We really wanted to see an example of recursion."

      I said "This problem doesn't require recursion, and recursion is dificult from a maintainence view point"*
      "If you want an example of recursion, I can whip one out for you right now, what language would you like me to do it in?"

      They told me thatw asn't neccessary.
      So when Intel does stupid things, you can always think "If they had only hired that Geekoid guy, they sure wouldn't have made that mistake!"
      Alert, ego buffer over run.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    78. Re:A total waste of time by Hotawa+Hawk-eye · · Score: 1
      In case it's not obvious, what interviewing I've done has been for development positions. Interviewing for QA, project management, or people management would be substantially different. Then again, I wouldn't be a part of any of those interviews since I'm a developer.

      Why wouldn't you be a part of those interviews, if they're going to be testing the code you write, managing your project, or managing you? I'm in QA and I've been involved in interviewing candidates for a position on my QA team, developers in the area my QA team covers, and I will be involved in interviewing candidates for a new manager for my QA team when someone applies and makes it to the interview stage.

      Generally in interviews I'm responsible for testing knowledge in one of the programming languages we use, and I use two whiteboard tests like some of the others in this thread have mentioned. First I ask the candidates to code review a very short sample of code I've written (which has both blatant and subtle errors) then I ask them to come up with test cases. Then I turn things around and ask them to implement a sample of code for a simple problem and then I code review it to see how they react to the feedback.
    79. Re:A total waste of time by tehcyder · · Score: 1
      If there's any time left after that I'll field any questions the candidate may have about the position, the team, or the company.
      No offence, but you provide a good example of the need for professional HR people in companies.

      In the first place, any reasonably sized company should weed out technically incompetent people before they get to the interview stage, otherwise you're just wasting a lot of people's valuable time.

      Secondly, questions "about the position, the team, or the company" should hardly be reserved as an optional extra if you've got time at the end, unless these are covered by other interviews elsewhere.

      --
      To have a right to do a thing is not at all the same as to be right in doing it
    80. Re:A total waste of time by Fogg · · Score: 1
      Anytime somebody tries to show me a code sample, the first thing I ask them is where they downloaded it from. Seriously, any employer that asks for a code sample has no clue what they're doing. They should put you at a whiteboard with a pen and have you write something on the fly.

      If the code sample is in the thousands of lines (excluding object oriented coding overhead) and addresses a reasonably complex problem, and the interviewee can explain how it works and why it was designed that way (listing alternatives that would have been less efficient or more work than they were worth), then I really wouldn't care if someone else actually wrote the code, since the candidate has demonstrated the necessary analytical capabilities either way.

      On the other hand, the traditional code-on-a-whiteboard test has always struck me as a bit off the mark. Either the proposed task is too simple (so you're really testing the candidate's whiteboard skills), or it's not really fair to ask of someone who is probably much better at working on a computer. Very recent graduates do handle oral exams somewhat better than people who've been out of school for a while, but that doesn't make it a reliable way to sift job candidates.

    81. Re:A total waste of time by Dun+Malg · · Score: 1

      Move characters one at a time from the end to the beginning, shifting the remaining characters right and keeping count of what you've moved.

      Wow. If that's really the kind of solution Osty was thinking of in his original post, I'm quite disturbed. I was trying to think of something with slightly less horribly poor performance :), but couldn't come up with anything - even ignoring some of Osty's misleading restrictions (sheesh, "without using any extra storage space beyond a single character").

      Mind you, this sort of a problem would probably be quite well suited to Brainfuck. In more ways than one.

      Aw, the performance wouldn't be that bad. Traditionally, this is how you ended up doing things in small microcontroller environments where RAM is so tight that you don't have the luxury of allocating another block the size of your string. In small environments like that, though, you're never manipulating big strings, and you don't do it very often, so the performance hit is negligible. Any mare, though, even microcontrollers have so much RAM that this sort of "byte pinching" isn't as common as it used to be. In a big environment, coding like that is silly.
      --
      If a job's not worth doing, it's not worth doing right.
    82. Re:A total waste of time by PinkPanther · · Score: 1
      YOu know, I have stopped taking tests.
      Well then, you would miss out the business opportunity our startup is offering (oh, and a job).

      I don't see how you can justify blindly writing off "tests". By your same logic, you should equally write off "interviews" as they are often conducted by people not experienced in interviewing.

      I would say that in more than 1/2 of the interviews I've ever taken, I've ended up having to steer the interview because the person there was "technical" but didn't have a clue how to ask about or delving deep into a person's technical abilities. Ask "do you know how to..." or "have you ever..." does not often get the kinds of information that an interviewer really wants, unless the answers to those questions lead to fuller discussions (which they often don't if the interviewee is a typical job applicant).

      I recommend that you don't blindly write off an interviewing technique. They exist because they can work, but implemented poorly they can be a waste of time. The same can be said for just about anything...

      --
      It's a simple matter of complex programming.
    83. Re:A total waste of time by Raenex · · Score: 1
      After 5 minutes of mucking around, I left the interview room to track down my interviewer to ask for some tweaked permissions. That was win #1; apparently only 20% of interviewees came foreward before trying some type of coding

      I find these interview "challenges" silly. There are usually two expectations from the interviewer:

      • The interviewee challenges the interviewer somehow (I need more information, tools, etc).
      • The interviewee is supposed to make do with what he has and just get something working.

      And now the poor interviewee is supposed to decide just how his potential employer expects him to behave in their bizarre little game. There are probably tons of good people that are passed over because of tests like this. I understand that these tests are trying to mimic real-world situations, but an interview environment is completely different from an actual working environment. The interview process should be completely transparent, not based on tricks.

    84. Re:A total waste of time by Raenex · · Score: 1

      Almost anybody can get a good reference. It's really the lowest bar there is to getting a job.

    85. Re:A total waste of time by merreborn · · Score: 1

      Three rings, the makers of Puzzle Pirates, have you write a game in using their libraries as part of the interview process.

      I think that's honestly probably one of the best ways to do the whole "show me you can code" thing; however, it's obviously a huge time commitment on the interviewee's part. Obviously, if you're applying for a half dozen jobs, you can't afford to write an application in a proprietary library for each and every one of them...

    86. Re:A total waste of time by PinkPanther · · Score: 1
      LOL. But if memory serves, the wording of the question had something to do with the program having to be written in C, leveraging POSIX functions, only listing regular files (not directories nor symlinks, etc...).

      I pseudo-jokingly asked if I could do it in Perl instead. They responded, "once you have been hired, you can use Perl to your heart's content." ... and I did.

      --
      It's a simple matter of complex programming.
  3. If you can't think of anything by dcapel · · Score: 5, Funny

    You can always "lift" some snippets from here.

    --
    DYWYPI?
  4. find theirs by Amouth · · Score: 4, Funny

    if your really good you get a hold of their code fix it and give it back to him in the interview - personaly i like the idea of handing the person being interviewed something from the cbfuscated C contest and ask them to take 5 min and tell me what it does - if they know you show them (seen it before) hire them... if they can manage to read it in 5 min and know what it does having never seen it before - hire them.. if they just look at you dumb.. send them home.

    but that is my personal view..

    --
    '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    1. Re:find theirs by AstrumPreliator · · Score: 1

      What kind of an interview is that? Figure this out in 5 minutes. All that really shows the employer is that you know the language, synax, grammar, and quirks of a language extremely well. Does that mean you can design software? No. That just means you can throw together code that will compile. In fact if someone could figure out an Obfuscated C contest winner in 5 minutes then I'd be more worried about him writing code like that for the company and causing nightmares later on.

    2. Re:find theirs by Anonymous Coward · · Score: 1, Funny

      It prints "Segmentation fault" and exits.

    3. Re:find theirs by arivanov · · Score: 2, Interesting

      Not necessarily at least for code (not data access and representation). Depends on the code example and language.

      If the target language is sufficiently diverse and expressive the code example can tell you about the way a person thinks at least as much as the interview.

      There is no point to ask for code samples in java, python, ruby or smalltalk. Different people asked about the same problem will usually end up with the same implementation sans variable names and minor stillistic differences. That is the reason why these languages are popular nowdays - they allow industrial programming.

      Now asking for a code example in perl, c and to a much lesser extent c++ is a completely different story. In these languages there is usually more than 1 way to hang yourself (in perl 5 on the average, in C around 3). As a result the code snippet can actually give you some insight on how the person thinks.

      Asking for a data representation and access example and especially online ones (not save/snapshot) is also a completely different ball game. There you have multiple ways of hanging yourself even in otherwise limited choice languages like java and Co. It also gives an insight how a person thinks with regards to scalability, interaction between multiple threads, etc. Example - if a person in an online data representation and access example piles all of their data access in a single thread, locks the access with an exclusive mutex, reads/writes it non-transactionally and the data is passed to other threads via shared data segment - just ask them to turn around and leave. That is just one example. Plenty of others to go around.

      --
      Baker's Law: Misery no longer loves company. Nowadays it insists on it
      http://www.sigsegv.cx/
    4. Re:find theirs by Quantam · · Score: 1

      if your really good you get a hold of their code fix it and give it back to him in the interview

      That actually works; I've done it before. Well, to be precise, it was the various bugs I told them about from looking at their disassembly that got me the job offer (it wasn't an interview, and I was never actually trying to get hired). But try that with Microsoft or Sony at your own risk (though I doubt most people here would even consider working for one of them an option) :P

      --
      You have tried to support your argument with faulty reasoning! Go directly to jail; do not pass Go, do not collect $200!
    5. Re:find theirs by Ihlosi · · Score: 2, Funny
      and ask them to take 5 min and tell me what it does



      Simple: "This does get the person who wrote it fired if it ever turns up in a real project."

    6. Re:find theirs by ArsenneLupin · · Score: 1

      Simple: "This does get the person who wrote it fired if it ever turns up in a real project." But not in five minutes. Usually it takes management a little bit longer than that to notice. And by then, the prankster may already have left anyways...
  5. Who are you interviewing with? by BadAnalogyGuy · · Score: 1

    While it may be standard practice for graphic designers and models to present a portfolio of their work, it is typically eschewed by the technical community during interviews. What kind of prima donna company wants you to submit this sort of thing?

    Even if you were to work up some code samples, how would they know whether these were something you wrote recently or something you wrote a long time ago? I have tons of old Perl code that is written as well as anyone could possibly write it, but I'd be scratching my head for half an hour if you asked me about it in an interview. The code is just so old that it isn't relevant to what I do anymore.

    If they want to know how you program, they will ask you to beat out some code during the interview. If they ask you to submit code samples, send them to SourceForge.

  6. Do they have to be YOUR code samples? by gunny01 · · Score: 2, Funny

    I'm assuming so, but you could just show up with the Linux kernel or the Firefox source. Failing that, grab the FreeBSD source code and change all the varible names to some version of 'foobar'

    --
    kill all the fucking niggers
    1. Re:Do they have to be YOUR code samples? by andy753421 · · Score: 2, Insightful

      *cough* you could always spend some time improving support for the linux bcm43xx drivers... ;)

    2. Re:Do they have to be YOUR code samples? by TheWanderingHermit · · Score: 1

      And above all, leave out that stuff about having a busy life outside of work. How can you call yourself a dedicated coder if you do things like go home at night or have a life?

      And you have the nerve to submit to Ask Slashdot!

      Some people just don't seem to understand that coding isn't a way of life. It is life.

  7. Do you want the job? by JoGlo · · Score: 1
    If you don't, then follow the advice of the anonymous coward above.

    If you do, then you either provide some modules that you have written, or cobble up modules that work in a similar way, but which do not break any confidentiality agreements you may have - in other words, desensitize the code, and make sure you can explain the problem (in generic terms) and the solution that you chose (and why).

    I'm surprised that anyone today is asking for code samples, unless they are looking for some esoteric language that you are expected to know before you start work for them - if that is the case, the ability to explain the problem, and the way you solved it, with demonstrative code that supports your explanation, would probably be the best approach IMO.

    --
    Will those of you who think that you know what you are doing, get out of the way of those of us who know what we are doi
    1. Re:Do you want the job? by ignavusinfo · · Score: 1

      The group I work for often askes applicants for code samples. It's not so much to find the good candidates as it is to weed out the (shall we say) less good ones. We don't have oodles of time to interview all the potential candidates and when hiring for a mid-level position lots of resumés look pretty much alike. A brief code sample is a good indicator of how much attention a candidate gives to detail, something we find important. (If you've never had the pleasure of reviewing samples you might be surprised at what people deem appropriate and polished enough to send to a potential employeer...)

      On the other end of the stick, I enjoy being asked for code: it's what I spend most of every day doing and is a good indicator of how well I can write it. Companies who don't like my style can bin me immediately and not waste my time. I'm surprised at the number of "asking for code samples sucks" replies. I don't disagree that being able to think through a problem is important, but no more important that the quality of the finished product.

    2. Re:Do you want the job? by JoGlo · · Score: 1

      I'm surprised at the number of "asking for code samples sucks" replies. I don't disagree that being able to think through a problem is important, but no more important that the quality of the finished product.

      I agree, and that's why I suggested desensitizing some code that he/she has written, and using that, and why getting someone else to write it is really a stupid idea. If you didn't write it, you have no control over the quality, you can't sensibly discuss why you did it in a certain way, and you certainly don't show your prospective employer just what you're capable of.

      Having said that, when interviewing prospective programmers (I don't do it any more, having risen to the glorified ranks of QA Manager), I would instead of asking them to produce code, give them some code to look at (nothing extra fancy, or complex), and ask them to give me their impression of the style and quality of the code that they were looking at. I found that very enlightening, as the newbie, or poor programmer, often had no opinion as to coding styles, while the experienced coder would recognise redundant of\r badly formed code quite quickly. We are, of course, talking here of 3GLs, and early 4GLs, so I really can't comment on whether this approach would work with today's crop of languages.

      --
      Will those of you who think that you know what you are doing, get out of the way of those of us who know what we are doi
  8. Re:Do you want THAT job? by BadAnalogyGuy · · Score: 1

    If they are asking you for code samples, are you sure you really want to work for those people?

  9. well... by Anonymous Coward · · Score: 0

    ...you could show up at the interview wearing a ski mask, wearing gloves, use a voice changer, give them a URL to the code up at pirate bay and tell them you only want to be paid in e-gold.

    and that you won't be coming into the office very much...

  10. Be honest! by TrisexualPuppy · · Score: 5, Informative

    Tell your employer that it is all classified. There is really nothing that you can do about it. It would be a breach of contract and could leave you in legal jeopardy if you showed any of it to him...

    But the TSP has a solution. Tell him that you will code for him if he can give you a terse, yet challenging assignment. This will let him see what he wants to see (i.e., what he wants to test you on), and you're willing to take out a bit of your time just to show him that you're a hard worker. This strategy worked for me and landed me a job in the upper 80's!

    1. Re:Be honest! by camperdave · · Score: 5, Funny

      FYI, most people call them the late 80's.

      --
      When our name is on the back of your car, we're behind you all the way!
    2. Re:Be honest! by TrisexualPuppy · · Score: 2, Insightful
      FYI, most people call them the late 80's.
      Actually, no. $87500 is not "the late 80's."
    3. Re:Be honest! by 91degrees · · Score: 5, Funny

      That's a shame. I was hoping you could tell me how to get some work in 1973.

    4. Re:Be honest! by Anonymous Coward · · Score: 1, Insightful

      FYI, he meant upper $80Ks, numbnuts. FYI, I'm pretty damned sure he knew what the guy meant. It was a joke. And a little bit of a slam, because the "please envy me" note in puppy's voice was a little too apparent.

      Of course, not getting the joke, Mr. $87,500 finds another opportunity to casually put it out there, in more detail, to make sure everyone gets it. He was forced! He didn't want to have to name his salary! He knows it's not classy!

      And now perhaps the upper-middle-class slashdot chicks will come flocking.

      Hey, you never know.
    5. Re:Be honest! by tgd · · Score: 1

      This strategy worked for me and landed me a job in the upper 80's!

      But what has it done for you in the last 20 years?

      *hopes someone gets it*

    6. Re:Be honest! by tgd · · Score: 1

      Oh dawg gammit...

      Mental note: check if anyone else has used a bad joke before using a bad joke.

      *sigh*

    7. Re:Be honest! by Anonymous Coward · · Score: 0

      If I were in your shoes I would *not* say that all the work is *classified*. I was told by someone whose opinions I respect on such maters that the fact that you have worked, or are currently working on, classified projects is in itself classified information. I do not and have never had a clearance, but I have worked on many projects with access to sensitive information. That being said I have some friends who all I know is that they have active clearances, and if I understand the proceedure correctly there is a security officer that you can field questions about the types of work you have done, projects, etc. From there you can simply say that that all the projects you have worked on in the past years are covered by non-disclosure and that you will honor the needs of your new company by first respecting and honoring those for whom I have worked in the past. That is when I offer to give them up to two weeks to hammer out a little project... Oh, BTW, do you have coding and documentation standards? how do you feel about automated regression testing? What are your standard development toolsets? ...

    8. Re:Be honest! by Anonymous Coward · · Score: 2, Interesting

      what's truly funny is the lack of response on that note. Here's some other figures:

      $40K
      $60K
      $90K
      $120K
      $150K

      Those are all figures of programmers at various levels I know personally. Yes, the $40K guy is a novice and getting screwed to boot. The remainder are an excercise for the questing reader. What kills me is that most of my friends and I consistently hit far above the highest posted salary averages, and we know we're not exactly the highest paid folk in the companies we work for. Considering the breadth of companies we cover, it's quite reasonable to come to the conclusion that salary surveys are more vehicles for employers to keep pay "low" than for employees to ask for raises. If you're below those averages and are a good programmer, you're getting hosed. This does not mean you believe you're a good programmer and you only know how to code in PHP, Java, or .NET though. Those surveys are probably too optimistic for you, and that's another thing I've seen far too much of - people that think they're great programmers (or even architects!) but only know 1 language, and don't even know it well. They do, generally, have some business knowledge, and smooze factor. But that's no reason to think they're technically inclined or capable.

    9. Re:Be honest! by timelorde · · Score: 2, Funny

      I still have some old IBM punch cards in my desk. I'll send 'em to you.

    10. Re:Be honest! by LifesABeach · · Score: 1

      To show source code does not make sense. How is the interviewer to know that it is yours? I do not now of a single business that would authorize the showing of code they paid for, just so that a person could get a job, at a different/competing business. There is also to the ethical question of, "If you show code to this company, you would do the same at the next business you move to. I have always told interviewers that if they wanted to see my code, they could ask the company I worked for to view it; No takers so far.

    11. Re:Be honest! by Ihlosi · · Score: 5, Insightful
      How is the interviewer to know that it is yours?



      Ask questions about it. They usually show very quickly if you understand the code. Then there are four possibilities:



      1. The code isn't yours and you don't understand it. Bad. You're out.

      2. The code is yours and you don't understand it. Also bad. Also out.

      3. The code is yours and you understand it. Good.

      4. The code isn't yours, and you understand it. Outstanding.

    12. Re:Be honest! by TheSHAD0W · · Score: 1

      Show them your notebook PC. After their eyes stop bugging out, they'll hire you on the spot.

      Of course, a few days later, you'll be at your desk when a few guys in ugly suits show up to take you away...

    13. Re:Be honest! by WED+Fan · · Score: 1

      That's a shame. I was hoping you could tell me how to get some work in 1973.

      Well you could get a job as British police detective. Although the method of commute to your job in 1973 will play Hell on your system. (This is one seriously cool show, you have to watch it.)

      --
      Politics is the art of looking for trouble, finding it everywhere, diagnosing it incorrectly and applying the wrong fix.
    14. Re:Be honest! by SSCGWLB · · Score: 1

      I think the parent has hit upon the best solution. Also, it makes you look good because you are 1) Protecting your current employer's (and Goverment's) IP/secrets and 2) being pro-active seeking a solution.

      Personally, if I had to code a small example I would recreate a extensible hash function I wrote back in college. A fast implementation is not trivial, but mine was less then 300 lines of code (c++). I suggest this because it:
      1) Shows a understanding of several different data structures, pointers, classes, inheritence (depends on implementation)
      2) Shows a understanding of space/time tradeoffs
      3) Allows for a number of eligent(sp?) optimizations
      4) Allows for a interesting challenge developing a seed
      5) Small enough to cover in less then a hour
      6) Has well defined requirements (see google)


      Just a Idea!

    15. Re:Be honest! by 91degrees · · Score: 1

      You have a better grasp of how my mind works than I do. I typed 1976 then changed it to 73 and couldn't think why.

      And yes it is a cool show and I do watch it.

    16. Re:Be honest! by Sam+Nitzberg · · Score: 1

      TSP has solutions. Plenty of them.
      But it's more challenging if someone asks for one in Polynomial-Order time ;-)

    17. Re:Be honest! by Philip+K+Dickhead · · Score: 1

      I loved '73!

      Can I get there with a DeLorean and some old refuse?

      --
      "Speaking the Truth in times of universal deceit is a revolutionary act." -- George Orwell
    18. Re:Be honest! by TechnoLust · · Score: 1

      That'll only work if your resume is splattered with government jobs. Who's going to believe that code for a small bank in East Bumblefuck is classified? Instead tell then that you signed an NDA. Or here's a novel concept... give them what they ask for and let them decide if you are qualified for the job.

      --
      "Da ist ein Technölüst in mein Unterpanten!"
    19. Re:Be honest! by LifesABeach · · Score: 1

      An interesting idea, but topics 1 thru 3 require complicity in grand theft. Topic number 4 is intrigging; Why not have the interviewer present code, and have the candidate describe it?

    20. Re:Be honest! by UtucXul · · Score: 4, Funny
      Ask questions about it. They usually show very quickly if you understand the code. Then there are four possibilities:
      1. The code isn't yours and you don't understand it. Bad. You're out.
      2. The code is yours and you don't understand it. Also bad. Also out.
      This is grossly unfair to Perl programmers. You don't really expect us to understand every regex we wrote months (or days) ago, do you?
    21. Re:Be honest! by djh101010 · · Score: 3, Interesting

      An interesting idea, but topics 1 thru 3 require complicity in grand theft. Topic number 4 is intrigging; Why not have the interviewer present code, and have the candidate describe it?

      That's the approach I take. "Here, what does this script do? Go into as much detail as you'd like." It's not so much what they say, but how they approach the problem that I'm interested in.

    22. Re:Be honest! by Anonymous Coward · · Score: 0

      I think he meant that he only has to work if it is between 85-90 degrees outside.

    23. Re:Be honest! by Anonymous Coward · · Score: 0

      Yeah, but now we are in the 00's. Open source rulez!

    24. Re:Be honest! by Anonymous Coward · · Score: 0

      Upper 80's was good for the late 80's but today - not.

      Hmm, never boast about being underpaid.

      In the northeast you barely afford to rent on that salary...

    25. Re:Be honest! by Breakfast+Pants · · Score: 1

      If he follows your advice they will probably decide that since the guy freely gives away IP that doesn't belong to him, he wouldnt work out at their company where they, you know, produce IP.

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    26. Re:Be honest! by TechnoLust · · Score: 1

      IP is usually the concept, not the code. I can write several programs that have very dissimilar code, but look and behave identically. Besides, I've never seen a company request that you deliver a backup of the code repository, they usually want to see a small object or method you wrote to accomplish a common task.

      --
      "Da ist ein Technölüst in mein Unterpanten!"
    27. Re:Be honest! by Soul-Burn666 · · Score: 1

      I know you meant this as a joke, but if you have complex some regex in your code which you can't easily explain, a comment above it explaining it would serve you well.

      --
      ^_^
    28. Re:Be honest! by CaptainJackSparrow · · Score: 1

      He meant a job that payed >$85,000/year, pinhead.

      --
      Though I am not not naturally honest, I am so sometimes by chance. -Shakespeare
    29. Re:Be honest! by Simap · · Score: 1

      From an employer standpoint, what is a good test to give?
      What is the best way to do the coding interview: leave the interviewee alone, stand over his/her shoulder, just sit nearby, or don't bother with real code and just whiteboard something?

      Is it better to have them code during the interview (and how long should it last?), or write something for you on their own time? To me, the code someone produces in an hour or two session for a small problem tells me more than something they can take a few days on before getting back to me. Ex do they understand, design, code, test in that order, or backwards? Is it even reasonable to force someone to develop software when they are outside of their normal dev environment?

      I've made the mistake of giving overly challenging problems, and I'm leaning toward quality/elegance of solving simple problems over ability to solve complex problems in a short period of time. Anyone care to comment what they've found most useful as an interviewing tool?

      In the last round of hiring, we gave out a test that involved parsing some input file, massaging the data slightly based on predefined criteria, and dumping the data to a single DB table. Out of a dozen applicants, nobody got it working, not even the 2 people we hired (1 worked out very well afterwards, 1 didn't). Lessen learned: don't expect applicants to come close to what your dev team does every day in the same time frame.

      Can the /. crowd help me out with some suggestions? :-)

    30. Re:Be honest! by Simap · · Score: 1

      I should have mentioned:

      Prior to giving tests, we asked for code samples. Bad mistake.

      Only awful samples tell you anything. Good samples are deceptive because the applicant could have spend days cleaning up the code and properly documenting it. Most of the time you don't get a functional sample and even then you have to judge based off of what you think it is supposed to do, without any context of the specifications or requirements.

    31. Re:Be honest! by Breakfast+Pants · · Score: 1

      "IP is usually the concept, not the code." Definitely true of trade secrets. Definitely NOT true of copyright. Both are considered IP.

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    32. Re:Be honest! by TechnoLust · · Score: 1
      Well of course you don't give out code that is copyrighted by a previous employer. If someone asks me to do something I feel is wrong, I'm not going to work for them, so it is a moot point. I guess I should explain that I've never worker for a software company. All my coding experience has been for companies that don't give a fuck what language it is written in, as long as it does what they need it to do. Most of my assignments have involved a lot of "business analysis". My first meeting usually goes like this: We're doing things like this. Here are the pros and cons of our process. How can we leverage technology to make it more profitable?

      I have a lot of code samples that show that I can code efficiently, but wouldn't do the prospective employer any good by itself. My resume illustrates that I'm great at looking at a process and then finding ways to improve it. If a company already has business analysts, they don't care that I can do that (although it's a deciding factor if there's another programmer with my skill set and experience) they want to know that I can translate my process to a usable application. I have signed NDAs before, but most of them specify that it's the concept I can't disclose, not that I can't show someone 15 lines of code out of an`app that is tens if thousands of lines long.

      --
      "Da ist ein Technölüst in mein Unterpanten!"
    33. Re:Be honest! by melanio · · Score: 1

      When the poster said the "Upper 80's", the individual was referring to $80,000+ and not the decade.

      - M

    34. Re:Be honest! by Hognoxious · · Score: 1

      I wish wou were late. Not as in late for something, just late.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    35. Re:Be honest! by TrisexualPuppy · · Score: 0, Troll
      And a little bit of a slam, because the "please envy me" note in puppy's voice was a little too apparent.
      Hey, idiot. I only posted this to up my karma. Every post that I make is fake.
  11. Here's a code sample from my younger days... by __aaclcg7560 · · Score: 3, Funny

    10 rem My first program... :P
    20 print "HELLO, WORLD!"
    30 goto 20

    1. Re:Here's a code sample from my younger days... by Dahamma · · Score: 1

      Now I know you're lying! No kid playing around with BASIC would ever use "HELLO, WORLD!" as their first program. Now if you had written:

      10 PRINT "YOU SUCK!"
      20 GOTO 10

      THEN I would have known it was actually your first program in elementary school on that TRS-80 in the lab in fact on all the computers you could get your hands on when the teacher was't looking...
      Umm. Nevermind. It wasn't me! I was playing with my Logo Turtle the whole time!

    2. Re:Here's a code sample from my younger days... by __aaclcg7560 · · Score: 2, Funny

      The real trick is writing out "You Suck!" in Logo Turtle. That's what separates the men from the boys. :P

    3. Re:Here's a code sample from my younger days... by The-Bus · · Score: 1

      You can always try "HELLO NEW JOB!". Add a BEEP in there too, just to jazz it up.

      --

      Small potatoes make the steak look bigger.

  12. One word by djupedal · · Score: 1

    pseudocode

  13. If they want to ask for a code sample... by MarcoAtWork · · Score: 3, Interesting

    ...they ought to give you a problem to solve and expect you to mail in the solution, something like 'ok, let's coordinate, sat morning at 8am I'll send you problem xyz by email, you mail back your code by 5pm, we'll discuss your solution during your follow up interview'.

    There's no way that a prospective employer can reasonably expect to be able to look at your current production code, and if they do and they expect you to bend the rules of your current NDAs I'm not sure it'd be somebody I'd want to work for anyways.

    --
    -- the cake is a lie
    1. Re:If they want to ask for a code sample... by PinkPanther · · Score: 1
      There's no way that a prospective employer can reasonably expect to be able to look at your current production code
      I agree about the "production code" aspect, but I've asked to see what code someone has done on their own, no matter what it is, just to see that they are interested in code outside of 9 - 5. Heck, most of us have some kind of pet project kicking around...even a home website in PHP or something. It may not be "production", but if the person is a professional coder I'd expect it to at least be somewhat cleanly done.

      If they submit your typical "hello world" or nothing at all, then I've got some insight to their engrossment to the art/science...or at least I've got a talking point.

      --
      It's a simple matter of complex programming.
    2. Re:If they want to ask for a code sample... by Lord+Kano · · Score: 1

      There's no way that a prospective employer can reasonably expect to be able to look at your current production code, and if they do and they expect you to bend the rules of your current NDAs I'm not sure it'd be somebody I'd want to work for anyways.

      It might be a test. Not of his skill, but of his trustworthiness.

      LK

      --
      "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
    3. Re:If they want to ask for a code sample... by Cederic · · Score: 2, Insightful


      working 60 hour weeks writing code and everything else that comes up on a software project, you think that when i left that job I had personal code projects at home I'd been writing on?

      no, at home I was playing computer games, getting out and socialising, shooting field archery and playing snooker.

      it isn't that i wasn't interested in code outside of 9-5, it was that the job wasn't 9-5 and i (along with a lot of other people) have more than one interest in life.

      Incidentally, one company I interviewed with did send a programming problem through with a "please send a programmed solution through within three days". I wrote it up and sent it in after two evenings and they liked my solution.

      Do that if you want code examples, don't expect everybody to be writing code in their spare time, and definitely don't expect commercially sensitive code to be brought along to interview.

    4. Re:If they want to ask for a code sample... by Ihlosi · · Score: 1
      working 60 hour weeks writing code and everything else that comes up on a software project, you think that when i left that job I had personal code projects at home I'd been writing on?

      Yeah. Would you chose a neurosurgeon who pokes around people's brains in his spare time ? I wouldn't.

      Once I get a (well paid) job in management, maybe then I'll start coding in my spare time. If I have any.

    5. Re:If they want to ask for a code sample... by Anonymous Coward · · Score: 0
      >There's no way that a prospective employer can reasonably expect to be able to look at your current production code, and if they do and they expect you to bend the rules of your current NDAs I'm not sure it'd be somebody I'd want to work for anyways.

      It might be a test. Not of his skill, but of his trustworthiness.

      Either way, the correct response is to walk out of the interview. If it was a sincere test, their next sentence should be, "You're hired -- we're looking for integrity first." If it was not a test, you're best off showing them your back. If they want you to screw yor previous employer, they also intend to screw you.

    6. Re:If they want to ask for a code sample... by Eternauta3k · · Score: 1
      Yeah. Would you chose a neurosurgeon who pokes around people's brains in his spare time ? I wouldn't.
      Thanks, you just gave me a new sig.
      --
      Yeah. Would you choose a neurosurgeon who pokes around people's brains in his spare time? I wouldn't.
    7. Re:If they want to ask for a code sample... by soundvessel · · Score: 1
      agree about the "production code" aspect, but I've asked to see what code someone has done on their own, no matter what it is
      And even then, many employers have employment agreements that effectively own the IP you work on, even in your spare time, while you're employed by the company.
    8. Re:If they want to ask for a code sample... by kchrist · · Score: 1

      I hear this from time to time but I've never heard of a company exercising these alleged "rights" over code written on an employee's own time. In California this is illegal. What states would allow this sort of thing? And more importantly, why?

    9. Re:If they want to ask for a code sample... by soundvessel · · Score: 1
      I hear this from time to time but I've never heard of a company exercising these alleged "rights" over code written on an employee's own time. In California this is illegal. What states would allow this sort of thing? And more importantly, why?
      I've not heard of it ever being exercised, either. The 'legitimate reason' is essentially a non-compete clause: if you work for business X engaged in the practice of Y, and in your off time are developing product Z, which would be in direct competition of practice Y, then you're ostensibly in violation of that. Therefore, the innovations you may be making in your version of their product should belong to them while you're employed by them.

      By saying legitimate reason I'm not saying I agree that it's legitimate, just that I can see the argument being made.

    10. Re:If they want to ask for a code sample... by Eideewt · · Score: 1

      "Yeah. Would you chose a neurosurgeon who pokes around people's brains in his spare time ? I wouldn't."

      There's something to be said for a guy who can poke around in brains without killing/zombifying enough people to be jailed.

  14. The answer is obvious! by Frogbert · · Score: 2, Funny

    Experts Exchange is well known for its well written, bug free and easy-to-read code samples. You should give it a try!

  15. RoR coders needed by drDugan · · Score: 2, Interesting

    are you a front end engineer? I'll hire you right now!

    (only half joking)

    1. Re:RoR coders needed by booch · · Score: 2, Interesting

      What kind of Rails programmers are you looking for? What kind of project? Where? How much? Etc. (I.e. a link would be great!)

      --
      Software sucks. Open Source sucks less.
    2. Re:RoR coders needed by JDGRS · · Score: 1
  16. Why is asking for code samples a bad sign? by BadAnalogyGuy · · Score: 5, Insightful

    Everyone seems to be in agreement except for a straggler a few posts down from here. Companies that ask for code samples are bozos and you don't want to work for them. But why?

    The answer has to do with corporate culture. Companies are made up of human beings and each one has different goals and needs and personalities. Some people get along famously while others will tear each other apart if left alone in the same room. Some people are very friendly and easy-going, others are hard-edged and driven. The type of people you hire will determine the culture of your company.

    Do people have fun at your company? Are they tired all the time? Do you have high rates of turnover? Do people think they work for the greatest company in the world? The worst? Do people dread meeting with other employees? Do people have a great time pounding out ideas together? Do people focus solely on their job position? Do people look at the company as a whole and see their role as a part of the greater whole? All these things are determined by the type of people you employ.

    The type of people you employ is determined by your interview process. If you make the interview process a relaxed one where the interviewee has the chance to articulate his thoughts well, you'll get one kind of employee. If you make the interview process a difficult, high pressure affair, you'll get another kind of employee. If you ask them to submit code samples, you'll get people who are either incredibly anal or look for shortcuts. If you ask them to code on a white board, you'll get people who can think on their feet.

    No one type of company works best for all situations. You wouldn't want cowboy coders in the bank software business. OTOH, you wouldn't want incredibly anal people working on next-generation UI stuff. But the type of people you hire is not only indicative of the culture of your company, it is a clue as to the personalities of the people working there.

    Another problem with the code sample thing is that it shows that the company values code quality over quality of character. My cousin BasementDweller78 is a wiz at coding. He can drop his pants and shit better code than I ever could. But he's a complete asshole. He isn't pleasant to be around. He's your prototypical computer geek. He's also the one that will get hired at a company that values code over people.

    So when some company asks for a code sample we all react with our gut and run far away. It's because we don't want to be around the type of people who would judge us on inanimate code. We'd rather be judged as humans and don't fear whiteboards nor do we lack confidence in our programming abilities. We are just a certain subset of all programmers. Those who value a pleasant working environment. Pleasant for us, that is.

    1. Re:Why is asking for code samples a bad sign? by Darth+Liberus · · Score: 1
      Hear, hear!

      The company I work for did a pretty good job of interviewing me... there was a ten minute "let's see if we like you" part, followed by a reasonably rigorous (but fair) test of the language. The only drawback is that the managers would generally pick the most technically competent person and ignore soft skills like "can understand and follow directions", "has a good personality" and "can think for themselves."

      Fortunately I'm now the final decision maker when it comes to hiring programmers on my project, and I place a lot of weight on soft skills - I know what it takes to get the job done, and once you're in the pool of technically qualified candidates you're judged (almost) entirely on the basis of whether or not you're a good worker. And I must say I'm quite proud of the team I've assembled, they are a bunch of freaks but they love their jobs and when we need to knock one out of the park we do it... unlike some of the other teams I have to work with ;)

      --
      Beauty is just a light switch away.
    2. Re:Why is asking for code samples a bad sign? by camperdave · · Score: 4, Funny

      He can drop his pants and shit better code than I ever could... He isn't pleasant to be around.

      He probably isn't pleasant to be around because of his coding style.

      --
      When our name is on the back of your car, we're behind you all the way!
    3. Re:Why is asking for code samples a bad sign? by GDTRFB · · Score: 1

      I asked for code samples during the last round of interviews I conducted for a PHP developer. It was an amazingly successful filter. Those candidates that did not present any samples did so either because "it's owned by my employer and I'm not allowed to show it to you" or because they just didn't have any. The "proprietary code" candidates were still able to show an functioning application and discuss how it worked. When I questioned them on some aspect "How do you prevent the user from reloading the page" for instance, they were able to tell me and we could talk about. This told me they knew something. The candidates that did not have a working application online to demonstrate, also couldn't talk about coding in general. These interviews did not last long. The people that did present code samples also fell into two groups. Those whose code was well organized and showed decent OO design skills; and those that embedded their overly complex PHP directly into the HTML on the page. More importantly than that, it also showed me who comments their code and who doesn't. In the end it came down to two coders with good problem solving skills but one of them wrote well-documented code that would have been a pleasure to maintain if it was dumped in my lap. We hired the good commenter. When you've got to go back and revisit code you wrote after 18-24 months having the comments in there is a necessity. If a candidate isn't writing good comments in their code now, they won't write good comments in their code after you hire them.

    4. Re:Why is asking for code samples a bad sign? by bar-agent · · Score: 1

      Yeah, that's web development. Their code samples are right there on the intarweb. But if you're hiring for an embedded developer, or application developer, or any other kind of developer it's a bit harder.

      --
      i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
    5. Re:Why is asking for code samples a bad sign? by AutopsyReport · · Score: 1

      I need a work warning on posts like this! Me and my cubicle just couldn't stop laughing after reading that one :)

      --

      For he today that sheds his blood with me shall be my brother.

    6. Re:Why is asking for code samples a bad sign? by consumer · · Score: 1

      If you ask them to submit code samples, you'll get people who are either incredibly anal or look for shortcuts.

      Where are you getting this from? I always ask for code samples because then I have something technical to discuss with the person. It works very well. If they send in lousy code, that tells me they don't understand what good coding style is. I don't care much what the code does, and it doesn't need to be more than a couple pages out of a larger project. I just want to get them to talk about the decisions they made when writing this code. It's not even a problem when people bring in code that they just worked on after it was originally written by someone else, as long as they can talk intelligently about why the code is done the way it is and demonstrate some depth of knowledge about the language.

  17. A way to impress with code samples... by nixkuroi · · Score: 1

    Instead of waiting for them to ask, tell them that all of the work you've done has been proprietary and that you don't mind doing a simple theoretical project to show your code style. I did that and it got me the job. Later the guy told me that it was that initiative (and the completed code) that convinced him to choose me.

    Good luck.

  18. i prefer.. by poisonfruitloops · · Score: 2, Insightful

    i had a few interviews fresh out of uni. One place gave the final 3 applicants a puzzle to take home and solve based on a real-world situation, though no "code" was involved, we were asked to provide simple pseudo-code.

    I thought that was odd as we could all go to external sources or each other.

    The next place asked me in the interview "What can you tell me about this code? Problems, inefficiencies.. anything?". I thought that was a much better idea. Plus who wants to write code up on a white board when all nervous in an interview anyway right?

  19. the point is not to see your code by jameswestcoast · · Score: 1

    the point is for you to be able to explain your code to someone you might be working with. Can you explain it clearly? Are you enthusiastic about it? Find something that was fun in college; maybe something you could talk about right now if you had to. That's where I'd start. BTW, Google does code reviews.

  20. Just say you invented this: by bunbuntheminilop · · Score: 5, Funny

    float InvSqrt (float x){
    float xhalf = 0.5f*x;
    int i = *(int*)
    i = 0x5f3759df - (i>>1);
    x = *(float*)
    x = x*(1.5f - xhalf*x*x);
    return x;
    }

    1. Re:Just say you invented this: by Anonymous Coward · · Score: 0

      Look at page 158 of "The Software Optimization Cookbook : High-performance Recipes for the Intel Architecture" by Richard Gerber (published by Intel press). The reciprocal square root of the exponent was the easy part. Computing the mantissa bits using an approximation developed from an application of Newton's root-finding method is the more subtle part.

    2. Re:Just say you invented this: by GrizlyAdams · · Score: 1

      But I *DID* write that, I swear! id owes me royalties on it!
      Erm, wait, no that was this:

      int crash() {
          unsigned long *pBadULong;
          for (;;) {
              pBadULong = (unsigned long *)(rand() & (0 - 0xff))+1;
              *pBadUlong = rand();
          }
      }

      Always more fun without a MMU.

    3. Re:Just say you invented this: by oliverthered · · Score: 1

      that would be more fun if you made pBadULong a function pointer and started it off at a random address.

      --
      thank God the internet isn't a human right.
    4. Re:Just say you invented this: by gnasher719 · · Score: 1

      Then I'd ask you to fix the bugs in it, and to explain what it does.

      If you can explain it, you have a good chance of getting hired for certain jobs.
      If you can't explain it, then we can both have a good laugh about your joke, and I can look at the next candidate.

  21. After 8 Years in IT by umbrellasd · · Score: 1

    Just keep an eye on past and current projects for ones that are reasonably self-contained (there are always a few gems that you write while working) and then go home and reimplement it on your own hardware and on your own time. It is perfectly acceptable to use a code sample like this for interview purposes, provided that proprietary information is not present. I have several samples from the past few years which are loosely based on insights that I gained during particular projects. I went home and reworked them into a sample, and it is very fast to do this because most of the thinking work is already complete and you have all of the details in your mind.

    You typically sign an agreement that says work that you do on your own time and hardware without any of your previous companies resources is owned by you. Thankfully, companies do not own the knowledge and experience that you gain while working for them. That is yours, and you are free to display it. Indeed, no one would hire any software developers if it were otherwise.

    1. Re:After 8 Years in IT by umbrellasd · · Score: 1

      Ok, I better qualify "knowledge" before I get slammed. By this, I am referring to your understanding of things other than trade secrets and the like. So, your knowledge of .NET, or Java, or Python, or building relational databases, or implemented object-oriented software architectures, or developing in an Agile framework, and so on.

      My comment was in the context of code sample, so I'm assuming you're bright enough to not share your knowledge of trade secrets and the like in your code samples, :-).

    2. Re:After 8 Years in IT by Anonymous+Brave+Guy · · Score: 1

      You typically sign an agreement that says work that you do on your own time and hardware without any of your previous companies resources is owned by you.

      Unfortunately, for many people that isn't true. A lot of employment contracts these days, particularly from big companies, seem to claim blanket IP rights to everything the employee does while employed (regardless of any connection to the employment).

      Personally, I refuse to sign such contracts, and in fact after a takeover a couple of years ago so many staff from our formerly small and privately-owned company objected to the aggressive IP clauses in the new contract that the new employer had to throw it out and give us the old wording back, complete with exceptions for things not related to our employment.

      But many people, particularly the young and inexperienced, don't appreciate this, and some do get screwed because of it.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    3. Re:After 8 Years in IT by Ihlosi · · Score: 1
      Unfortunately, for many people that isn't true. A lot of employment contracts these days, particularly from big companies, seem to claim blanket IP rights to everything the employee does while employed (regardless of any connection to the employment).

      Your fortune cookie for today says:

      Beware of employee who writes pr0n mods for popular computer games in his spare time.

    4. Re:After 8 Years in IT by Xentor · · Score: 1

      Eh, not all companies have the same rules... I looked over my employment agreement (aka "contract", even though it says it isn't a contract), and the company owns anything I make while employed, provided that:

      1) It's made using company resources/equipment (Obviously)
      2) It's related to the business

      Accent on #2... I work for the financial industry, so if I wrote some stock trading software at home, in my spare time, it'd belong to the company under this agreement. Of course, if I wrote a bunch of computer games (Which is what I actually do), they're all mine.

      --
      "The amount of intelligence on this planet is a constant. The population is growing." -Cole's Axiom
  22. Open Source? by davburns · · Score: 2, Interesting

    It's probably too late for your "upcoming" interview, but if you donate some code to the odd open source project here or there, then you have something you can be proud of -- especially if the prospective employer uses the stuff you helped to write.) Many projects list names of contributors in a "credits" or "release notes" file, which gives you a way to show that the code is yours -- instead of stolen from someone else.

    1. Re:Open Source? by BadAnalogyGuy · · Score: 1

      Or change your name to Linus Torvalds or some other well-represented name in the source code.

    2. Re:Open Source? by Aladrin · · Score: 1

      I'm surprised that it took this long for someone to post this answer. It's so obvious that it's almost painful.

      Everyone seems intent on stating that if they ask for code samples, you don't want to work for them. I work for a company that wanted a code sample, and life is good. I love this company. I think instead, companies that DEMAND code samples are the ones to watch out for.

      At any rate, having open source work you can show will have 2 effects:

      You'll have code to show.

      You'll weed out companies that are allergic to open source.

      --
      "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
  23. Really good advice by ILuvRamen · · Score: 3, Interesting

    Just ask them to sign something saying they won't use it or you'll sue em. That will impress them and know that they can count on you not to show off any code you write for them and show off the coolest stuff. Either that or show a simple example of how you fixed a common problem that other programmers leave in most programs and be able to explain how you thought of it and why you implemented it as well as have an example of another popular program that didn't fix the problem (preferably from Microsoft.) For example, if you found a way to sync up the highlighted line between multiple bound listboxes to eliminate the delay between the mouse down and mouse up (I'm even still working on that one) and you show that then there ya go. They'll be impressed that it's yours, it's smart, supposed professionals leave it in their programs, and there's a decent reason for it...though you could find a fix with a better reason than "it looks prettier" like with the listboxes. Btw if you do fix that listbox problem, send me to code too lol.

    --
    Google's Super Secret Search Algorithm: SELECT @search_results FROM internet WHERE @search_results = 'good'
    1. Re:Really good advice by Zadaz · · Score: 1
      Just ask them to sign something saying they won't use it or you'll sue em.
      Except that's exceptionally bad advice. The information isn't his to protect, it's property of his company and he's signed contracts to maintain its confidentiality. As an employee he doesn't have any power to re-engineer his contract to include external third parties.

      What it would show me (as an interviewer) is that this person doesn't understand the proprietary and classified contract he's signed and is a security risk.

      I would even consider contacting his employer and pointing out their security risk. I'd certainly like to know if my (former) employees were shopping my classified code.

      I ask them to write out some psuedocode to a posed problem, then give them two samples of source code to talk about. The first is self contained and self explanatory, but has a few ways it can be improved. The second is complicated, relies on a number of outside dependencies, and solves a problem far outside the core expertise I'm looking for. This lets me see how they react when their back is against the wall.
  24. Google by phalse+phace · · Score: 1

    Google, of course.

  25. toddbu is majorly underrated by Travoltus · · Score: 1

    Plus, you stole my response. Right to the letter. Kudos, you must be a manager, if not then you should be.

    --
    --- Grow a pair, liberals... stop letting the Republicans bully you!
  26. There's nothing wrong with code samples by CaptKilljoy · · Score: 1
    Personally, I always have them code at a whiteboard, however I also ask for a code sample if available.
    • The level of coding question to ask them during the interview.
    • The quality of what they think their best code is. We've all worked with people who were smart enough to solve whiteboard problems but wrote unmaintainable garbage when it came time to code.
    • What they claim (emphasis on claim) to be able to do. If there's a discrepancy with the skills at the whiteboard, then it's feedback for the next person interviewing to probe deeper. Either we're catching the person in a lie (valuable information) or s/he's one of those people that just don't do well standing at a whiteboard, in which case we do it a slightly different way.
    I don't think anybody is advocating code samples as the sole factor in deciding to hire. It's just a valuable piece of the bigger picture.
  27. Here's what to use... by Channard · · Score: 2, Funny

    10 PRINT "Give me a JOB!" 20 GOTO 10

  28. Improve their stuff approach... by Anonymous Coward · · Score: 0

    I wanted a job in a company, so before my interview I, personally, hacked their website.
    Found several holes in it to be honest...

    So, I let it slip during the interview, hehehe...

    Long story short, I got what I asked for and my first project was to do a security assessment on all
    the sites they had built.

    Ofc, I could had been prosecuted, but you gotta take some risks. :)

  29. A small test at the interview by snutte · · Score: 0

    A small test is used at the company I work for. Since you always have signed big NDA's at your old job a small test does the trick, no longer than a page with sample code that has some error in it and some questions. The errors are typically pointer stuff and such but some are quite tricky.

  30. Notepad? by Mia'cova · · Score: 1

    Just a thought.......

  31. Any CS student should know ... by Ihlosi · · Score: 1
    Oh, yeah, and make sure the result ends up in the same initial string variable (or string buffer object, if you're working in a language with immutable strings) without using any extra storage space beyond a single character.

    ... that no single extra character is necessary.

    My solution still needs three pointers/indexes, though.

  32. There's only one place to go by Anonymous Coward · · Score: 0

    Pull it our of your asshole where you and Slashdot get the rest of your programming skills from.

  33. GeekInterview! by Anonymous Coward · · Score: 0
    GeekInterview.com! If I might post a response:
    oop (Object Orinatated Princables) are having four concepts.1) no "primative" types.Evry thing has to be an objekt. this is y u have java.lang.Integer, and autoboximng was turned on in java5, when before it was "compiler only", not it is an enduser feature.2) classesevry objekt has to hav a class behind it. this is y JavaScript is not a OOP language. 3) Polymorphicobjs must be able to prend to be objs of a diffent class. in het jav tis is called "casting".4) encapsulton.u can not hav gloabels in OOP, but all variables & methods must be "encapsulted" in an obj.i is hope tihs helps.


  34. Explain the situation by lorcha · · Score: 1

    Call your interviewer ahead of time and tell him/her the same thing that you just told us. Offer to work through some technical problems during the interview so they can see how you think. Most people in the business world (that you want to work for, anyhow) are sane and would understand your situation.

    I have never been asked for code samples as part of an interview. Probably because the vast, overwhelming majority of code that people get paid to write is either proprietary, classified, or both. Seems a strange request in this day and age where people could just download some code and hand it in.

    --
    "Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
  35. Code Samples are Important by Anonymous Coward · · Score: 0

    I can't understand why a company wouldn't insist on looking over prospective employees before giving them a job. The company I work for is big on integrated systems and code re-use - if we write something once we try to use it whenever we need the same functionality again. Depending on the workload at the time, we'll work as a single team, a handful of smaller teams, or individually. We're also expected to be able to bugfix problems quickly in our own projects or projects by other developers in the company.

    All of this means that our code absolutely must conform to the house standards - naming conventions, DB designs, project layouts, comments, everything. If a project breaks the conventions because the developer did a half-arsed job and we need to fix a bug, we'll spend a lot more time trying to understand exactly what he thought he was doing before we can fix the problem.

    Code samples let us see exactly what sort of code an interview candidate produces. If his code is a mess - no comments, no formatting standards, inconsistent naming conventaions - there's little point in us employing him. It is vital to work out if a programmer is competent, but it's also imperative that we know the guy won't produce incomprehensible spaghetti code.

    Database designs are even more important. Given the choice I'd insist on seeing a sample of the candidate's DB work, and if I saw a crap database design the interview would be pretty much over. Maybe you can bodge your front-end and business layers, but if the DB's wrong then the data isn't worth very much.

    If I weren't doing tedious business apps, though, my attitude would be different. If I were interviewing for a games company, I wouldn't care too much about code re-use; I'd just want the guy who showed me the coolest algorithm.

  36. From the other side.... by RationalRoot · · Score: 1

    Having been the interviewer....

    I don't ever remember asking for or getting offered code samples. Ever.
    If it's short, it's out of context or trivially simple. If it's long, I'm hardly going to read it in an interview.
    The first problem is do you understand code. I'll show you some mediocre code with pre installed problems and ask you to comment. Any companies bug database will point you to plenty of samples. I don't expect you to spot everything in an interview, but if you don't spot something important then I'll ask about it. If you are still looking blank, I'll try to comunicate a little more clearly. I may even explain the problem and see how you take it in. If it's a junior position then I want to know about your capacity to learn.
    From then on, I want bigger pictures than code. Any monkey can write a loop, hell most integrated environments will template it out for you. Fill in the blanks coding.
    I'll give you some design problems and ask you to comment. Often I'll leave you missing some key information to see if you realise that you need to ask some questions, or if you are the barrel along regardless type.

    --
    http://davesboat.blogspot.com/
    1. Re:From the other side.... by generationxyu · · Score: 1
      A question we commonly ask is "look at this function on the board. It takes as input a filename and a Camera*. It then gets a frame of video from the camera in a loop, encodes it, and writes it out to the file. What's wrong with it?"

      There's plenty of things wrong with it -- The code doesn't gracefully handle the file not existing, doesn't check for NULL, the loop is written as a for when it would be more clear as a while, variables are named things like x when they should be named things like currentFrame. It's a very open-ended question, it weeds out people who aren't willing to think about edge cases, but gives a lot of room for mentioning improvements. I've never seen anyone address *everything* that could be fixed -- but then again, I have seen people who had very valid arguments about something we'd never thought of.

      --
      I mod down pyramid schemes in sigs.
  37. you said it by anthony_dipierro · · Score: 1
    Unfortunately, all of the coding I've done work-wise since college is not only proprietary, but often classified. To be honest, with long days at work and a busy life outside of it, I haven't had much time to code on my own. So, what should I show my interviewer?

    How about showing them some of the code that is proprietary but not classified?

  38. You get asked for code? by Programmer_Errant · · Score: 1

    I never get asked for code. I have code samples all over usenet and in an open source project. Though it's probably a good thing that I've never been asked. It's mostly experimental prototype code and even I can't understand it if I haven't worked on it recently. A word of advice. Stay away from the advanced stuff. There's maybe 10 people in the world that actually understand stuff in the esoteric area I coded in. If they were hiring managers, I'd have it made. But they're not, so as far as real hiring managers are concerned, it really is spagetti code.

    So pick something real simple that will demonstrate some clean design and coding principles. It will get complicated enough as it is.

    1. Re:You get asked for code? by geekoid · · Score: 1

      ".. mostly experimental prototype code and even I can't understand it if I haven't worked on it recently."
      do tell more!

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  39. mod me down for obvious... by marktoml · · Score: 3, Insightful

    However this is a good reason to have considered (at least considered!) doing a bit of work for an open source project. There are lots of them on SourceForge (and many other fine places) begging for help. A few bits added in make nice examples you can point to when asked for code samples. I know, it seems like a huge time investment that you don't have, but it really doesn't have to be. Further, every little bit helps the project guys.

    1. Re:mod me down for obvious... by crlove · · Score: 1

      You tell me that now! Kidding. Good idea, a little late for this particular interview, but something I've been meaning to do for awhile now. Now I have another reason!

  40. you're wasting your time .... by nblender · · Score: 3, Insightful

    In the time that it's going to take for you to read all of these responses, you could have sat down and written some code that will impress them. They're not looking for your magnum opus... They want to see stuff that shows you can understand a problem and translate your understanding into compilable syntax. In fact, they probably don't even care about compilable syntax. Think of a cute hack and write it instead of reading slashdot. Take it in and say "I can't show you any of the code I've written professionally, so I wrote this last night. You can confirm with google that I didn't download it from anywhere if you like, or you can ask me any questions about it and I'll be happy to answer them." Don't pick something related to the companies' core business. They understand their problems _way_better_ than you do. Second, decide whether you want to work for a company that quantifies you based on your code output. I'm a coder and I only spend about 10% of my work time actually writing production code. The rest is hacking test cases, prototyping, designing, staring at graphs, and attending team meetings.

  41. For eln's delecate sensibilities about perl... by tlambert · · Score: 2, Funny

    For eln's delecate sensibilities about perl...

    echo "this is a sentence" | awk '{ cnt = NF; while ( cnt > 0 ) { printf( "%s ", $cnt ); --cnt; } printf("\n"); }'

    Happier?

    -- Terry

  42. Brilliant! by Anonymous Coward · · Score: 0

    [somebody has to deliver the punchline]

  43. Not all that Common by Rycross · · Score: 1

    I was asked for a code sample only once. More common was to email me a quiz that involved a simple coding problem. But even that was fairly rare, as most companies just did a quick phone screen and got me to whiteboard stuff in interviews.

    What I did when I was asked was simply state that all my relevant work in the language they asked for was done for my current job, and thus I couldn't disclose any of the code to them in good concious. I then asked them if, instead, they would like to give me a simple programming task that I could write up for them. They were very flexible, and agreed. In the end, I was told that this made an impression on them because it not only showed them I was able to accomplish a simple task in the target language, but that I also respected my employer's intellectual property.

  44. Whose luck? by Dareth · · Score: 1

    "Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them."

    Whose luck are you measuring, the candidates or yours?

    I go through tons of applications looking for qualified people. It would be my luck to discard the one or two who actually know what the position they applied for is.

    --

    I only look human.
    My mother is a halfling and my dad is an ogre, so that makes me an Ogreling
  45. Funny Applicant by Anonymous Coward · · Score: 0

    I had a job applicant once who had on his resume that he "wrote the Win32 subsystem".

    We asked him in just to see what kind of a tool he was. He might as well have put "discovered the element Protactinium" on there...

    He never showed up for the interview.

  46. Why do I ask for code samples? by jlazzaro74 · · Score: 1

    There seem to be a lot of people that think code samples are useless, but I disagree. A sample still serves a useful purpose, it just can't be the entire basis of hiring or not. I ask for a code sample just so I can see if they have a style that will fit with the rest of the group. I want to see comments, I want to see some damn whitespace, I want to see variable names that make sense, and I want to see that things that should take three lines aren't being done in thirty. This isn't where I decide if they know what they are doing, I still ask them to interpret some of our code and find a couple of planted bugs, and I ask questions that only someone who used the language on a daily basis could answer.

    I know I can only hope they are being honest about it being their own code, but that's no different from the rest of the interview process, where you just have to have a finely tuned BS radar. If you're in doubt, asking a few questions about why they did this instead of that or what the purpose of this or that section was will weed out a lot of posers. If they pass off someone else's code and then start handing me work that looks like it was written by a monkey, they're going to have a very, very bad time.

    In short, I would just tell them that all your recent work is classified or otherwise proprietary. Any reasonable employer should understand that and adjust the interview appropriately. If they make a big deal out of it, they are probably pricks that you don't want to work with anyhow.

  47. Two things by Mycroft_514 · · Score: 2, Interesting

    If they request code samples, then they are anal and you don't want to work for them (as others have stated), or two, they are looking to see if you lift code from another source. Depending on the company, that can be either a good thing or a bad thing. If they are an ethical company, and they find you lifting code, then you are toast. If they aren't an ethical company, why do you want to work for them?

    Either way, if a company asked me to bring in a code sample, I would cancel the interview, since obviously, I don't want to work for them.

    Oh, and ANY code I worked on for previous employers is not my property, and to display it to someone else is violating the no compete clause I may have signed when leaving the previous company, or with my current employer.

    In many job interviews over the last 25 years, not once have I been asked to show "code samples". With one company I was asked to take a basic programming test, but that only took a half hour. (Stupid test, they had an invalid question on it, where the correct answer would depend on the setting of a compile time switch in several languages).

    1. Re:Two things by geekoid · · Score: 1

      "hat can be either a good thing or a bad thing. If they are an ethical company, and they find you lifting code, then you are toast. If they aren't an ethical company, why do you want to work for them?"

      to make money exploiting their unethical behaviour? ;)

      Having a portfolio is perfectly reasonable thing to ask for.

      Jeez, there not looking for you to drop the sourse to a million line piece of work.

      "(Stupid test, they had an invalid question on it, where the correct answer would depend on the setting of a compile time switch in several languages)."

      unless, of course, the real test was to see who would bring that up.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    2. Re:Two things by Mycroft_514 · · Score: 1

      Actually, I did bring it up. The people administering the test submitted the multiple choice answers to a scoring SERVICE. They didn't know bupkus about coding.

      What was even scarier was that they gave an hour to take the test, and I finished and walked out with a passing score (they will only tell you pass/fail) after about 1/2 hour. The other person taking the test was still struggling at the 1 hour mark.

  48. Simplicity * by RingDev · · Score: 1

    The purpose of a code sample isn't to check your understanding of complexe theory, or your ability to whip out amazing code. It's a quick quality check. I ask for a code sample usually, not to check for skill, but to check for finish. Are variables named appropriately? Are methods and members appropriately commented? Are stack limits checked? etc... nothing real fancy, just a quick snippet to make sure the coder can produce maintainable code.

    I think the last time I handed someone a code sample it was a very simple contact list app. Nothing more than a hand full of textboxes and a tiny data layer that talked to Access. Took maybe 4 hours to write. There was nothing fancy or impressive in the code, but I spent the majority of the time making sure that the code was consistantly written and inline with most industry standards.

    -Rick

    --
    "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
  49. Classified by coinreturn · · Score: 1

    Wrong. The fact you are working on classified work is not in itself classified, though it may be considered sensitive, in that if you reveal that fact to anyone, you may be making a target of yourself. The actual "contract" you sign regarding the classified work is NOT classified, including abbreviations that represent particular clearance codewords (though actual codewords are classified, generally only at secret level).

  50. If the labor market is an oligopsony by tepples · · Score: 1

    If loving Perl be wrong, I don't wanna be right.

    So how do you eat if nobody in town loves Perl?

  51. Strings of words by tepples · · Score: 1

    The OP was referring to reversing the _words_ in a string, not the _characters_ in a string. Quite a different beast.

    Then set up the API so that each element of the string represents a word. Chinese in UTF-16 does this ordinarily, and there are at least a few data compression programs (e.g. "huffword") that use this as an intermediate representation.

  52. Haskell# or Lisp#? by tepples · · Score: 1

    As for your point about functional languages, that'd make sense if I were hiring you for a position where you'd work with a functional language. If you're interviewing for a 100% .NET or Java shop, busting out Haskell or Lisp in your interview (beyond mentioning them on your resume) is likely to do more harm than good. You'll get "cool points" for knowing a functional language, but if you can't hack C/C++, Java, C#, Javascript or whatever I happen to be looking for, those cool points aren't going to do you much good.

    Until you bust out Haskell# or Lisp#. There are plenty of languages that run on the .NET framework and on the Java virtual machine.

  53. perl: command not found by tepples · · Score: 1

    oh, that's alright, you can do that in Java, too:

    Runtime.getRuntime( ).exec( "perl -e \"print join ' ', reverse split /[ \.]/, $ARGV[ 0 ];\"", new String[ ] { "this is a sentence" } );

    This code produces incorrect results on all input strings except "denied permission exec: SecurityException:" or "found not command perl:" or perhaps "name file or command Bad".

  54. Show bug fixes by mutterc · · Score: 1

    Disclaimer: I have a lot of trouble getting interviews, so I've only tried this out once or twice.

    When someone asks for a code sample, show some interesting bugs you've fixed.

    My personal favorite is a place where someone strcpy'd into a buffer gotten from malloc(strlen(src)) (bug: 1 should be added for the terminating null), and the bug only showed up when the string's length was an exact multiple of 16, because the platform's malloc() implementation rounded allocation up to multiples of 16. Oy, that was a tough one to track down.

    I've also seen and whacked a depressingly large number of instances of strcpy(foo, NULL) in my current day job (the clueless attempting to zero out a buffer). It doesn't necessarily have to be a full-on WTF like that, though.

    Usually these kinds of things can be generalized enough that they don't really reveal anything proprietary.

  55. The link by GlobalEcho · · Score: 1

    You forgot to hyperlink it

        ExpertSexChange.com

  56. If you are serious about finding a job by /dev/trash · · Score: 1

    You'll find time to write some code to show them, eh?

  57. Re:Simplicity * by crlove · · Score: 1

    I hope that's all they want. Thanks.

    I'm just worried about a line in the email saying "It is highly encouraged for you to bring sample work as this is an important part of our interviewing process. "

    I mean, what the hell does that mean?

  58. Re:Simplicity * by RingDev · · Score: 1

    Unless they specificly said that they want to see a sample that shows your understanding of x, y, and z, that is exactly what it is.

    Exceptional code may be worth its weight in gold, but maintainable code is worth its weight in diamonds.

    Comment your code blocks, ensure proper indention, use hungarian notation for your variable names (or any standard, just be consistant through out!), etc... Clean, ledgible, and easily understood is the key to a good 'demo' app.

    -Rick

    --
    "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
  59. Code is irrelevant - consistency is key. by shoolz · · Score: 1

    Were I to interview a developer, I would ask to see 5 very short, but very different code samples. I would look to see that there is a consistency between all 5 of them in terms of scoping, declarations, comments, and even simple things like indentation and whether or not they consistently stick to studlyCaps or whatnot...

    IMO, coding is exceptionally easy - it's all just functions, declarations, conditions, and loops. It is the ability to code CONSISTENTLY that makes one coder better than the next.

  60. This is a trick question by Anonymous Coward · · Score: 0

    The reason they are asking you for code samples is so they can see if you would actually take the IP of the company you work for and show them.
    Basically they want to see if you are HONEST and will abide by an NDA, or are you only interested in yourself and would be willing to steal code from your current employer.

    Ive been in this game for 16 years, that is exactly what they are doing.

    1. Re:This is a trick question by crlove · · Score: 2, Insightful

      Except they specifically told me not to bring anything proprietary.

  61. Re:Simplicity * by crlove · · Score: 1

    Thanks, you (and everyone else here at ./) have been a big help. I think I've got enough to work with :)

  62. not everything should be classified (?) by dheera · · Score: 1

    imho, if i were an employer i wouldn't hire anybody that said all their work was classified. a programmer is worthless unless they actually took enough interest to do *some* amount of coding OUTSIDE the job.

    1. Re:not everything should be classified (?) by Anonymous Coward · · Score: 0

      Thank you very much, but I code enough at work.

      I do like my life, my lady, skiing, talking, and any number of other things that do not involve me sitting in front of my computer for the remaining few hours left to me.

    2. Re:not everything should be classified (?) by geekoid · · Score: 1

      You are wrong.

      I know some very good programmers that ahve nothing to do with programming when they leave work.
      There probably better employess for having diverse interests.

      I did a lot of start up work with NDA's so I can't show any recent code to anybody.

      When I get home, I just want to read to my kids, talk to my wife, and do some yard work. Maybe enjoy the occasional role playing game. Yes, I am boring, but I can code circles around you!

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    3. Re:not everything should be classified (?) by dheera · · Score: 1

      well, same here, i don't do it every day of course. but what good is a researcher that doesn't ponder ideas when they are bored? like say getting 1 day per week unsupervised (at work) to do whatever you want and hopefully think of something good? and if the company requires an employee to work so many hours that they don't get such said unsupervised time, that company is spoiling lives by turning people with beautiful innovative minds into dull ones. and i wouldn't hire anyone who came out of such a company. i'd rather hire from people who had worked at places that permit such exploration. google, pixar, universities, etc etc etc. jp morgan? hell no. they think work == life over there.

  63. Not code - documentation by Xaria · · Score: 1

    Write a project document, including a design, use cases and test plan for a straightforward program. You could even write the interfaces for them (classes, methods, etc in java speak) but don't bother actually coding it except perhaps for a method or two. If you can show that you know your stuff well enough to get to a decent design then you're better than half the monkeys coming out of university these days.

  64. Huh! by jd · · Score: 1

    Wouldn't this be bigger?

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    1. Re:Huh! by Kymermosst · · Score: 1

      No, I think this is probably the biggest.

      --
      "Alcohol, Tobacco, Firearms, and Explosives" should be a convenience store, not a government agency.
    2. Re:Huh! by earnest+murderer · · Score: 1

      Hey now, we don't want the poor fella to get caught.

      --
      Platform advocacy is like choosing a favorite severely developmentally disabled child.
    3. Re:Huh! by earnest+murderer · · Score: 1

      Wouldn't this be bigger?

      In the Yo Momma category, yes that would be much bigger.

      --
      Platform advocacy is like choosing a favorite severely developmentally disabled child.
  65. Re:Simplicity * by anubi · · Score: 1
    Rick,

    When I was asked for a sample how I code, I brought in my project code ( all of it ) from a data structures class I had just taken at the local college.

    I was working on proprietary stuff at work, but I felt the class stuff was general enough - as from the talk we had, I felt he just wanted to see if I wrote clean maintainable code. I could really see where he was coming from, as I have seen other classmates work, and would have been extremely miffed if someone handed the mess to me in exchange for a paycheck. Not many of us wrote clean code. ( Or, at least it didn't *look* clean! )

    Turns out I did not get the job, but it was for other things. I didn't really wanna get into pure coding, aa my love is designing physics gizmos. The job was pure coding.

    I can't blame an employer one bit for wanting a sample. Badly written code may be coaxed into working, but trying to modify or debug badly written code is a nightmare. Its often best to throw the whole damned thing away and start over.

    --
    "Prove all things; hold fast that which is good." [KJV: I Thessalonians 5:21]

  66. That can backfire by geekoid · · Score: 2, Insightful

    I ahad someone do this to me once, I took a look at it and knew immediatly what it did so I told them straight off.
    They were unhappy that I didn't 'Walk the process'.
    I told them its 8 lines of code, 4 of them that just defining variables. If someone needs to sit down and think about it for more then 2 seconds then they are not principle material.

    Needles to say they didn't call me back; Which was fine since by that time I could see they weren't exactly the sharpest knife in the box.

    FUnny thing is, I had worked with the guy they hired before, and the y certianly got what they deserve.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    1. Re:That can backfire by djh101010 · · Score: 2, Insightful

      I ahad someone do this to me once, I took a look at it and knew immediatly what it did so I told them straight off. They were unhappy that I didn't 'Walk the process'.

      Well, seems to me, that didn't backfire at all. You learned something about the people interviewing you. Remember, an interview is just as much "Do I want to work here", as "Do I want to hire you". The interviewer gets to set the agenda, but if you don't go into it with a "are they good enough to employ me" point of view, you're doing it wrong. It's one thing if you're broke, unemployed, and hungry of course, but even still, the interview process is your chance as a professional, to decide who you want to work for.

  67. No code samples? Your skills lack depth. by ulatekh · · Score: 1

    Computer programming is too large and too difficult of a subject to learn merely at work. If you're not programming in your off-time, then you probably don't feel very strongly about the subject of computer science. I'd say there's a good chance you care more about the size of your paycheck than you do the quality of your code. I'd also say there's a big chance your skills lack depth. You're the programmer that finds it hard enough to merely get something to work; when asked to improve performance, or to make your code run on multiple non-symmetric processors, I'm guessing you get the "deer-in-the-headlights" look in your eyes.

    My favorite interview question, to ask and be asked, is "Show us a piece of code that you wrote, that you're proud of, and explain to us what it does and how it works." That tells me everything I need to know about a programmer.

    So what about the ability to get along with others, you ask? Not surprisingly, I say "bollocks" to that. This recent trend of caring more about people's feelings than their brains, ethics, or effort, is a stupid idea that has nothing to do with actual accomplishment or success or anything else, and anyone that subscribes to it is doomed to a downward spiral of irrelevance. You accomplish nothing by getting along fabulously as you run the company straight into the ground. If you're unclear on why, there's a famous book that explains it in voluminous detail.

    --
    "Once we've identified and embraced our sickness, we'll have strength...and that's when we get dangerous." - John Waters
  68. Original code by Tjp($)pjT · · Score: 1

    Interesting experience at MSFT. As all my work was primarily as a contractor and I was interviewing as a contractor I asked if they would give permission for me to use as future samples code I wrote for them. They understood the issue a bit better then. I did spend 3 of the interview sessions (MSFT can be brutal with all day interviews with loads of people) writing code on a whiteboard. The seemed to focus on approach and problem solving skipping being excruciatingly exact (every semicolon in its place, etc.) in favor of a solution that would work. Some of the tasks did not take small amounts of code. However, the simplest was you read n items off disk and you want to write them back sorted. I just used an appropriate STL construct to store them and iterator to go through on write. I didn't know the MSFT STL was pretty broken at the time. When asked for an alternate solution, I replaced the STL code with a "sort(input_array, output_array_pointer)" When he asked what the sort routine was I just commented "probably quick sort unless there is a compelling reason to use another, and every development environment or OS has one that has been painstakingly optimized, so just adjust it for the Windows flavor of invocation. Why bother reinventing something already done well." Apparently that caused some discussion, but they hired my services anyway.

    --
    - Tjp

    I am in wallow with my inner money grubbing capitalistic pig. ... Oink!

  69. Content doesn't matter so much by dmleach · · Score: 1

    My previous job was the first time I'd been asked to submit a code example. The interview focused quite a bit on object oriented technique, and they told me that's what they'd like to see in my submitted code.

    As it happens, the best example of OO technique I had done at that time was a version of Tetris I had programmed during my down time at my then-current job. I checked with my recruiter to get his opinion on whether or not it would be appropriate, sent it in, and got the job.

    Don't think that your code needs to be related to the business of the job you're after, or really even business related at all. Interviewers are just looking to see that you have the ability you claim.

  70. -1, Troll? (Was Re:A total waste of time) by Flagran · · Score: 1

    Who modded this troll? It's hilarious! Go find something better to do with your mod points.

    --
    Make love, not sigs
  71. We Own Your Brain by umbrellasd · · Score: 1
    A contract that claims ownership of all creative works (in all areas) while employed will not hold up in court. Carte blanche statements like that are too general. The law will require specific areas of ownership. Otherwise you are in the realm of enslavement and thus far, the laws against that are holding.

    You can certainly intimidate someone into signing a document like that, and can threaten to take them to court (and thus possibly get what you want), but it will not hold up if it goes in front of a judge. A company can put a competitive business clause into a contract and you are held to that, but even here the company must stipulate a realistic timeframe. If companies were allowed to enforce a clause that says, "We own all of your IP now and in the future, whether employed by us or not, whether related to our business or not, in perpetuity," the economic and civil liberty consequences would be disasterous.

    Anyway, I'm not a lawyer. Then again, quite a few SCOTUS judges including at least one influential head justice were not lawyers or judges. Laws are made by and we are held accountable to them by the people.

    It does really sadden me however, that most citizens can no longer go to the courthouse, state their case in plain English, and have a reasonable expectation of a fair outcome in the face of highly-payed, well-educated, corporate lawyers that can navigate through the legal morass that our judicial process has become, and have the training and the money necessary to persuade and manipulate a jury to achieve their desired outcome.

    That said, these are just my opinions, but if someone tried to do this to me, I'd get myself in a court, represent myself, and make a simple statement of what I believe and what the situation is, and see if I'm right. And anyway, this is pretty far afield of the original question which talks about sample code. Most people are careful (and all should be) to choose sample code which has no commercial value (in other words, it is just a confirmation of your technical capabilities). Would you bring a piece of sample code to the interview table that could be very lucrative? I hope not; go sell that product yourself. Therefore, if your sample code has no commercial value, it is not "property" and is not in conflict with the IP clause of your employement contract.