|
Dijkstracula posted:Something that I did that seemed to work for me at least when I was doing the over-the-phone shared document coding questions, was to transform the notes I would jot down in the first few seconds of thinking through the question and turn them into comments. This is especially helpful for me if I'm thinking through a recursive or DP problem. So, as an anonymized example from one of my interviews, I might end up with something like Yeah actually that is a pretty good idea. I also realized the original post may have been talking about code samples, as in code you send to the interviewer to evaluate. I thought (or maybe he does) he meant during an interview. In which case I don't agree that they should get some marks off for not commenting.
|
# ? Jun 7, 2012 00:55 |
|
|
# ? Jun 4, 2024 12:08 |
|
"marks off" for not commenting or "marks on" for commenting? The example given was two candidates, one with some comments, one with none. I could see how making comments might give you a leg up. It seems weird, though. You ask for code samples to make sure you want their code in your codebase. So if they don't write comments on the board, why not ask them to do so? It seems like you could miss out on a candidate who normally writes good comments if you just assume that "no comments on the whiteboard" implies "no comments ever" or "usually bad comments". I'll definitely be writing comments if I ever have to write code in an interview, though. Seems like it might be helpful, both in writing the code and in standing out over those who don't.
|
# ? Jun 7, 2012 01:23 |
|
Safe and Secure! posted:"marks off" for not commenting or "marks on" for commenting? The example given was two candidates, one with some comments, one with none. I could see how making comments might give you a leg up. This all falls outside the realm of purpose for coding questions, in my opinion. The purpose of the "bang out a FizzBuzz implementation" question is to just make sure that they actually know how to write code. I've seen people not know the syntax for a "for" loop in the language that they're claiming to have 5+ years of experience working with. If you can do it effortlessly, good. You've proven that you haven't done a bunch of rote memorization and bullshitted your way through the phone screening. Now we can dig into whether you'll be a good fit for the team, which means talking about their philosophy on software design. I ask "philosophical" questions, like "How big should a class be?" or "How many parameters to a method is too many?" or "How do you feel about comments?" There's no right or wrong answer to those questions, but having someone with a similar philosophy join the team is important. For example, some people like to write a lot of comments. That's fine. I lean toward "self-commenting" code, only commenting to provide justification for doing something weird or to give the overall intent of a chunk of code, but with descriptive names and small, well-tested methods. If someone says "I like to write giant methods with variables that look like they were named by an obfuscator, but I meticulously comment every single line of code," I know that I'm probably not going to work well with them. New Yorp New Yorp fucked around with this message at 01:59 on Jun 7, 2012 |
# ? Jun 7, 2012 01:57 |
|
Safe and Secure! posted:"marks off" for not commenting or "marks on" for commenting? The example given was two candidates, one with some comments, one with none. I could see how making comments might give you a leg up. I wouldn't have someone write comments on a whiteboard, I wouldn't even have them write code on one, pseudo-code at best. I'm talking about sitting you down at a laptop, IDE open, bash out a fizz buzz implementation or whatever. Now it's a trivial test but this is probably the first and possibly the last code the interviewer is ever going to see you write, so make it good. I'm sure a lot of candidates are good but don't interview well but there's not much I can do about that, bad candidates and good ones who appear bad are fairly indistinguishable. I usually ask questions like Ithaqua as well, just general coding questions to see how much of a hacker they are. I tend to write comments like Ithaqua as well, commenting where I've done something weird, with a javadoc at the top of the method. Bonus points goes to anyone who know what cyclomatic complexity is as well. Aramoro fucked around with this message at 09:19 on Jun 7, 2012 |
# ? Jun 7, 2012 09:16 |
|
I did a technical test for an interview I'm doing with a company a few days ago. They wanted me to build an application with the following requirements:quote:This project will consist of 3 pages They gave me 2 hours to do all this. I got most of it done, except for the pagination and the search, which I wrote the backend for, but didn't have time to plug into the front end. Since I emailed my code to them, a few days ago, I haven't heard a word from them. I already had a technical interview and a HR interview (two separate phone interviews) with this company. Do you all think it is reasonable to expect someone to get all of that done in two hours, or did I just gently caress it up? I basically worked on this the entire two hours. The first half hour I spent getting postgres running on my machine (I was expecting a fizzbuzz via etherpad, or a codility or something like that, so I wasn't really prepared) how!! fucked around with this message at 04:11 on Jun 8, 2012 |
# ? Jun 8, 2012 04:05 |
|
how!! posted:Do you all think it is reasonable to expect someone to get all of that done in two hours, or did I just gently caress it up? I basically worked on this the entire two hours. The first half hour I spent getting postgres running on my machine (I was expecting a fizzbuzz via etherpad, or a codility or something like that, so I wasn't really prepared) Did they have any requirements as to what you wrote it in? Two hours would be quite generous of them if this were a Rails app.
|
# ? Jun 8, 2012 05:41 |
|
kitten smoothie posted:Did they have any requirements as to what you wrote it in? Two hours would be quite generous of them if this were a Rails app. I did it in django.
|
# ? Jun 8, 2012 07:10 |
|
If you're given a FizzBuzz of say, reversing a string in C#, and the interviewer doesn't explicitly specify a constant string, is it "more correct" to make your sample customizable, as such?C# code:
|
# ? Jun 8, 2012 15:26 |
|
aBagorn posted:If you're given a FizzBuzz of say, reversing a string in C#, and the interviewer doesn't explicitly specify a constant string, is it "more correct" to make your sample customizable, as such? Overthinking. Just write it in one line. Also, new string(input.Reverse().ToArray()); should work just fine; the ToCharArray is redundant.
|
# ? Jun 8, 2012 15:42 |
|
I would think that would be fine, I'm not familiar with c# at all really but I can't see that as over thinking. If I was given a problem which was to reverse a string I would assume it was an arbitrary string. I think I would do pretty much what you had there, a string reversing method and a calling method to prompt for the string in question. (Like I say, not familiar with C# but what would it do if the entered String was empty or null)
|
# ? Jun 8, 2012 15:49 |
|
Aramoro posted:I would think that would be fine, I'm not familiar with c# at all really but I can't see that as over thinking. If I was given a problem which was to reverse a string I would assume it was an arbitrary string. I think I would do pretty much what you had there, a string reversing method and a calling method to prompt for the string in question. (Like I say, not familiar with C# but what would it do if the entered String was empty or null) Yeah I could have it check for an empty or null string and throw an exception, obviously. But that would go into the realm of REALLY overthinking it. I think Ithaqua is right, here. I was worried about getting too complex for the fizzbuzz
|
# ? Jun 8, 2012 16:31 |
|
String reverse questions generally will ask you to do it without using any built-in string methods, no? Every single language pretty much has a function/method that does this, so when they ask you to reverse a string, they generally tell you that you can't use any built-in methods. Then after that they usually want you to implement it in a way that you're using the least amount of space possible. I'm not familiar enough with C#, but does reverse or toArray allocate more memory? (I'm guessing reverse has to, not sure how c# allocates when calling toArray). Anyways, in my experience being asked the string reverse questions generally means you can't use any built-in functions.
|
# ? Jun 8, 2012 17:17 |
|
C# strings are immutable, so it's impossible to implement an in-place reverse or to reverse a string without the two copies that method does (one for ToArray, one in the string constructor) (although one or both could get optimized out).
|
# ? Jun 8, 2012 17:30 |
|
Plorkyeran posted:C# strings are immutable, so it's impossible to implement an in-place reverse or to reverse a string without the two copies that method does (one for ToArray, one in the string constructor) (although one or both could get optimized out). Wouldn't it be better philosophically (for the purpose of the question) to use a StringBuilder then?
|
# ? Jun 9, 2012 16:38 |
|
I know the best way to improve my coding skills is by coding a lot, but I always have trouble thinking of things to code. What should I do?
|
# ? Jun 10, 2012 00:56 |
|
Gee Wizard posted:I know the best way to improve my coding skills is by coding a lot, but I always have trouble thinking of things to code. What should I do? Find an interesting open source project in a language/technology that you know, and start contributing.
|
# ? Jun 10, 2012 00:59 |
|
astr0man posted:Find an interesting open source project in a language/technology that you know, and start contributing. GitHub makes the barrier to entry so so low too, there's no excuse not to do this. Sucks when people stop maintaining projects or accepting pull requests though
|
# ? Jun 10, 2012 02:27 |
|
Deus Rex posted:GitHub makes the barrier to entry so so low too, there's no excuse not to do this. Sucks when people stop maintaining projects or accepting pull requests though Github is the poo poo. It makes it so trivial to fork other people's projects and actually organize your own. Also you are right about the barrier of entry thing, I feel a ton less 'detached' from other opensource developers now that looking through their projects, looking through or submitting issues, and branching and at least being able to submit pull requests is so conveniently centralized. I love github so much.
|
# ? Jun 10, 2012 04:15 |
|
Safe and Secure! posted:"marks off" for not commenting or "marks on" for commenting? The example given was two candidates, one with some comments, one with none. I could see how making comments might give you a leg up. There's no possible interview/whiteboarding question that could be complex enough to warrant more than maybe one or two very small inline comments anyway so this sounds like an irrelevant question. I dunno, maybe if you're interviewing at like Palantir or some place that puts a lot of emphasis on Knowing Your poo poo, but even then I'm willing to bet that you're writing a lot of really clear pseudocode. My anecdotal experience is that novices over-comment anyway, so putting a lot of comments on a whiteboard would start to raise flags for me. Also, in production, it's important to learn to disregard comments anyway
|
# ? Jun 10, 2012 10:19 |
|
When you're writing on a whiteboard, the comments come out of your mouth.
|
# ? Jun 10, 2012 10:39 |
|
There is big difference between disregaurding comments and treating them with mistrust though. Comments are really handy when you've done something unusual and a year later you're looking at the code to work out what you've done. But yes, comments like 'This is a for loop' are not handy. I don't think I would have ever thought to write comments on a whiteboard though, as you would just be writing pseudo code Aramoro fucked around with this message at 10:45 on Jun 10, 2012 |
# ? Jun 10, 2012 10:42 |
|
I can't think of anything more full of despair than trying to decipher a complex piece of software from comments that are > 1 year old.
|
# ? Jun 10, 2012 11:34 |
|
Markov Chain Chomp posted:I can't think of anything more full of despair than trying to decipher a complex piece of software from comments that are > 1 year old. Trying to decipher complex software without comments that's over a year old.
|
# ? Jun 10, 2012 12:05 |
|
All I know is that in the code bases I've had to work on, the comments are usually out of date and not correct, so it's actually easier to decipher the code without the misleading comments.
|
# ? Jun 10, 2012 12:14 |
|
Volte posted:All I know is that in the code bases I've had to work on, the comments are usually out of date and not correct, so it's actually easier to decipher the code without the misleading comments. That's just bad developers, comments are not innately bad. Javadocs and inline should be used where appropriate.
|
# ? Jun 10, 2012 12:20 |
|
Volte posted:All I know is that in the code bases I've had to work on, the comments are usually out of date and not correct, so it's actually easier to decipher the code without the misleading comments. Yep. Aramoro posted:That's just bad developers, comments are not innately bad. Javadocs and inline should be used where appropriate. You've never actually worked on a production code base, have you.
|
# ? Jun 11, 2012 01:58 |
|
If you want to see whether someone writes good code just ask them for a link to their github. If they don't have a github, don't ask them to interview. I don't see how this is hard.
|
# ? Jun 11, 2012 02:22 |
|
Markov Chain Chomp posted:Yep. I'm going to go ahead and say that if you're changing code such that related comments are no longer relevant, and you're not changing those comments as well, you are a terrible developer (and probably a terrible employee/coworker in general). This half page of commentchat is full of terrible opinions in my opinion.
|
# ? Jun 11, 2012 02:59 |
|
Edit: Wrong thread. Apologies.
|
# ? Jun 11, 2012 04:07 |
|
Markov Chain Chomp posted:You've never actually worked on a production code base, have you. Been working as a Software Engineer for a bit over 10 years now, just now i'm a Senior Software Engineer at a software company producing an suite of Enterprise applications for companies like Philps, Sears and Aviva. So i'm going to go ahead and say yeah, I've worked on a production code base. I would also say if you change the funcationality of some code without changing a related comment you're a terrible developer. Also the person who did your code review is a terrible developer. It probably means the code you've written is also terrible never minding the comments. Markov Chain Chomp posted:If you want to see whether someone writes good code just ask them for a link to their github. If they don't have a github, don't ask them to interview. I don't see how this is hard. Not all developers contribute to things on github, I don't, none of my collegues do because it's not part of our job. I do the professional part of interviews sometimes and I do not want to spend my time trailing though some github abortions to work out if someone is good or not, I don't even know if they did it or not. I would rather sit them down with a laptop and an IDE and get them to write some code.
|
# ? Jun 11, 2012 06:09 |
|
hieronymus posted:Wouldn't it be better philosophically (for the purpose of the question) to use a StringBuilder then?
|
# ? Jun 11, 2012 06:15 |
|
Markov Chain Chomp posted:If you want to see whether someone writes good code just ask them for a link to their github. If they don't have a github, don't ask them to interview. I don't see how this is hard. What about people who don't or can't program in their spare time? I've seen contracts that mostly prohibit non-work related projects. Also, what's the story behind your avatar?
|
# ? Jun 11, 2012 06:17 |
|
mustermark posted:What about people who don't or can't program in their spare time? I've seen contracts that mostly prohibit non-work related projects. IANAL but I have an incredibly hard time believing a contract like that is enforceable
|
# ? Jun 11, 2012 06:23 |
|
Deus Rex posted:IANAL but I have an incredibly hard time believing a contract like that is enforceable Regardless even if I decided to work outside of California one of my first points of contention in a contract would be to strike out anything related to the company owning code I do on my own time, or if there isn't then include a point stating that I own the code I do on my own time.
|
# ? Jun 11, 2012 06:34 |
|
Pweller posted:I'm going to go ahead and say that if you're changing code such that related comments are no longer relevant, and you're not changing those comments as well, you are a terrible developer (and probably a terrible employee/coworker in general). Of course you try to catch stuff like that, but if your thesis here was actually correct, code reviews would also catch all bugs. They don't. Things slip through, even with a review process. I'm not sure what we're arguing about here. Even basic programming texts tell you "be wary of comments." Calling me a terrible developer because I'm not generating code that's 100% free of human error is hilarious. Aramoro posted:Been working as a Software Engineer for a bit over 10 years now, just now i'm a Senior Software Engineer quote:So i'm going to go ahead and say yeah, I've worked on a production code base. quote:I would also say if you change the funcationality of some code without changing a related comment you're a terrible developer. Also the person who did your code review is a terrible developer. It probably means the code you've written is also terrible never minding the comments. quote:Not all developers contribute to things on github, I don't, none of my collegues do because it's not part of our job. I do the professional part of interviews sometimes and I do not want to spend my time trailing though some github abortions to work out if someone is good or not, I don't even know if they did it or not. I would rather sit them down with a laptop and an IDE and get them to write some code. You've called me terrible, so I mean this with as much offense as possible. You sound like a dinosaur. I pray that you continue working on stuff that nobody's ever going to see because you're literally programming cancer. You don't need to look at anybody's github in detail to figure out if they're worth interviewing or not. A simple glance will tell you that one. Something that a person has spent hundreds or thousands of hours on gives me a much better idea of how they are as a programmer than a lovely coerced thirty minute interview problem. I get to see what sort of things they're passionate about, what engineering choices they make, and if they're vaguely aware of how to pick the best tool for the job. And if you can't trust them to submit stuff that's genuinely theirs, what the gently caress are you doing interviewing them in the first place. I'm not advocating github in place of an interview, merely as a decent filter for who to interview. By the way, the fact that you think an IDE is required to program is pretty telling. I'd recommend you read this article by Steve Yegge as soon as possible.
|
# ? Jun 11, 2012 06:44 |
|
mustermark posted:What about people who don't or can't program in their spare time? I've seen contracts that mostly prohibit non-work related projects. Your first question's already been answered in good detail. Nobody owns you, and you should be pretty mad at anyone who tells you otherwise (non-compete is a different issue and completely rational). Who doesn't love Mark Pincus?
|
# ? Jun 11, 2012 06:47 |
|
Markov Chain Chomp posted:You don't need to look at anybody's github in detail to figure out if they're worth interviewing or not. A simple glance will tell you that one. Something that a person has spent hundreds or thousands of hours on gives me a much better idea of how they are as a programmer than a lovely coerced thirty minute interview problem. I get to see what sort of things they're passionate about, what engineering choices they make, and if they're vaguely aware of how to pick the best tool for the job. And if you can't trust them to submit stuff that's genuinely theirs, what the gently caress are you doing interviewing them in the first place. I'm not advocating github in place of an interview, merely as a decent filter for who to interview. Just because someone doesn't want to spend a ton of spare time creating meaningful programs and putting them on github doesn't make them a bad programmer. I find it hard to believe that most people really have the mental energy to put in 8 serious hours of programming a day and then do more when they get home, there's such a thing as downtime afterall. If you don't see the massive conveniences a modern IDE gives you I don't know what to tell you. If you're not using an IDE, you're crazy.
|
# ? Jun 11, 2012 06:50 |
|
Markov Chain Chomp posted:Titles don't mean anything. The fact that you just dropped yours is a smell. You questioned my credentials, just telling you what they are i'm not trying to drop anything there. Markov Chain Chomp posted:You've called me terrible, so I mean this with as much offense as possible. You sound like a dinosaur. I pray that you continue working on stuff that nobody's ever going to see because you're literally programming cancer. If you change the funcationality of code and do not change the associated comment you are a terrible developer. That is just unargueable. Perhaps I am a dinosaur because I don't spend my free time writing projects, but to be honest I would rather spend my free time with my wife and friends. I would have thought to be programming cancer you would have to be spreading your code around various open source projects, slowly builking it up each time. Markov Chain Chomp posted:You don't need to look at anybody's github in detail to figure out if they're worth interviewing or not. A simple glance will tell you that one. Something that a person has spent hundreds or thousands of hours on gives me a much better idea of how they are as a programmer than a lovely coerced thirty minute interview problem. I get to see what sort of things they're passionate about, what engineering choices they make, and if they're vaguely aware of how to pick the best tool for the job. And if you can't trust them to submit stuff that's genuinely theirs, what the gently caress are you doing interviewing them in the first place. I'm not advocating github in place of an interview, merely as a decent filter for who to interview. Like I say none of the people I work with use github but they're all good programmers...so..well you're wrong. Markov Chain Chomp posted:By the way, the fact that you think an IDE is required to program is pretty telling. I'd recommend you read this article by Steve Yegge as soon as possible. I didn't say it was nessesary at all, but try deploying an enterprise application on WebSphere with notepad and tell me how far you get.
|
# ? Jun 11, 2012 07:09 |
|
Aramoro posted:I didn't say it was nessesary at all, but try deploying an enterprise application on WebSphere with notepad and tell me how far you get. https://www.youtube.com/watch?v=xpF5wOcy7os
|
# ? Jun 11, 2012 07:27 |
|
|
# ? Jun 4, 2024 12:08 |
|
baquerd posted:If you don't see the massive conveniences a modern IDE gives you I don't know what to tell you. If you're not using an IDE, you're crazy. quote:By the way, the fact that you think an IDE is required to program is pretty telling. I'd recommend you read this article by Steve Yegge as soon as possible. pigdog fucked around with this message at 08:37 on Jun 11, 2012 |
# ? Jun 11, 2012 08:33 |