Question to ask an interviewee
-
SK Genius wrote:
For some crazy reason 0
It's not a crazy reason, it's a very logical reason. But, hey, you got it. :rose:
-
Clue: The ++ operator is called post-increment.
I know that it is the post increment and that
int i,j;
i = 0;
j = i++;So after this j=0 and i=1 But in your case with i being on the both side made me have a little doubt. To my defense I had less than 5 hours sleep and no caffeine yet. My 36 year old brain does not function until the first few cups of coffee take effect.. Either way, I agree this is a good question because it leads to a follow up question to ask why is the answer 1? [EDIT]I read the other posts... And well at least the answer is 1 in vc6.[/EDIT]
John
modified on Friday, May 23, 2008 9:43 AM
-
You're actually keeping track of the number of lines of code you produce??
Since I work on my own code and projects this is pretty easy. I use project line counter from www.wndtabs.com[^]
John
-
Hi all, What would you consider a good question to ask to a potential programmer to see whether he/she is worth their salt? Thanks in advance for any suggestions Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
http://www.newinterviewquestions.com/list.htm[^] This may help according to a job category.
Regards, Mushq
-
Hi all, What would you consider a good question to ask to a potential programmer to see whether he/she is worth their salt? Thanks in advance for any suggestions Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
I wouldn't ask them anything. Sit them down in front of pc with VS and sql server. Ask them to create a simple web page (if it is asp.net) or winform (if a windows job) using the pubs database that has a drop down list with authors and grid populated with books by each author. If they can make it work under the pressure of the interview then hire them. If not, don't.
I didn't get any requirements for the signature
-
Isn't that technically undefined, at least in C++? You can't change the value of an lvalue on the right side of the = sign. Crikey, Score: 5.0 (2 votes). I haven't written a single line of C++ production code, and don't even remember when I last wrote any C++ code at all. Maybe my mentor at my previous company was right in asking me to switch from C# to C++. :^)
Cheers, Vikram.
The hands that help are holier than the lips that pray.
modified on Friday, May 23, 2008 11:59 AM
Vikram A Punathambekar wrote:
Isn't that technically undefined, at least in C++?
Yep, in fact gcc and MSVC will give different results.
-
I wouldn't ask them anything. Sit them down in front of pc with VS and sql server. Ask them to create a simple web page (if it is asp.net) or winform (if a windows job) using the pubs database that has a drop down list with authors and grid populated with books by each author. If they can make it work under the pressure of the interview then hire them. If not, don't.
I didn't get any requirements for the signature
-
Hi all, What would you consider a good question to ask to a potential programmer to see whether he/she is worth their salt? Thanks in advance for any suggestions Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
Here's a couple of ideas: ------------- Just sit there staring at them, kinda quivering. Start chain smoking (fumble with each match and cigarette - hand tremors are a nice visual touch) and look around nervously as if startled by a nearby noise. Swat at imaginary insects flying around your head. Occasionally, smile for no apparent reason, and then look off to one side as if there's someone beside you giving you advice. Nod in agreement, and/or shush the imaginary person. Do all that for about 15 minutes (remember - don't ask a question or speak to the candidate). When your show is completed, tell him thanks for coming in and to call back in an hour to see if he got the job. Oh yeah, it would help if your eyes were red and you were sweating profusely. ------------- Walk in with a loaded 9mm semi-auto, and lay it on the desk pointed at the candidate. Ask him if he'd like to declare any inaccuracies on his resume before you start the interview. If he craps his pants at the sight of your 9mm, dismiss him immediately. If he lays his own gun up on the table, give him points for coming to the interview prepared for anything.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001modified on Friday, May 23, 2008 9:43 AM
-
Hi all, What would you consider a good question to ask to a potential programmer to see whether he/she is worth their salt? Thanks in advance for any suggestions Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
Programm3r wrote:
What would you consider a good question to ask to a potential programmer to see whether he/she is worth their salt?
Some of common Microsoft interview questions[^] are pretty good.
-
Not knowing the answer (0 or 1) even though I have 11 years of experience and I have written > 500K lines of C++ code I would have to answer that this is bad code and the coder should be shot on the spot.
John
John M. Drescher wrote:
would have to answer that this is bad code and the coder should be shot on the spot.
Good answer!
Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog
-
I wouldn't ask them anything. Sit them down in front of pc with VS and sql server. Ask them to create a simple web page (if it is asp.net) or winform (if a windows job) using the pubs database that has a drop down list with authors and grid populated with books by each author. If they can make it work under the pressure of the interview then hire them. If not, don't.
I didn't get any requirements for the signature
That is very similar to what we do. It works very well.
Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog
-
SK Genius wrote:
For some crazy reason 0
It's not a crazy reason, it's a very logical reason. But, hey, you got it. :rose:
Reading the thread, I was rather saddened that I came up with 1 instead of 0. What's come over me? I still didn't get it. Then I did the experiments (VS2008):
C#: result is 0, as noted.
C++: result is 1, as I thought.Although it was cited as 'a very logical reason' that the value was set back, it would seem to conflict with the logic that is supposed to define the post-increment operator. Certainly the logic that has defined it heretofore! I'd love, therefore, to know what that 'a very logical reason' it's set back to 0 in c#. An Aside: If it's to appease the memory management . . . that's not a good reason. It's an unpleasant artifact that needs to be addressed and corrected.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"How do you find out if you're unwanted if everyone you try to ask tells you to go away?" - Balboos HaGadol -
Hi all, What would you consider a good question to ask to a potential programmer to see whether he/she is worth their salt? Thanks in advance for any suggestions Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
Give them the fizz-buzz problem in the language you are hiring for. If you don't know what that is, Scott Hanselman explains in his podcast and has some links on his blog: http://www.hanselman.com/blog/HanselminutesPodcast53HiringAndInterviewingEngineers.aspx[^] I also have an implementation in LINQ: http://blog.colinmackay.net/archive/2008/04/16/2251.aspx[^]
Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog
-
Reading the thread, I was rather saddened that I came up with 1 instead of 0. What's come over me? I still didn't get it. Then I did the experiments (VS2008):
C#: result is 0, as noted.
C++: result is 1, as I thought.Although it was cited as 'a very logical reason' that the value was set back, it would seem to conflict with the logic that is supposed to define the post-increment operator. Certainly the logic that has defined it heretofore! I'd love, therefore, to know what that 'a very logical reason' it's set back to 0 in c#. An Aside: If it's to appease the memory management . . . that's not a good reason. It's an unpleasant artifact that needs to be addressed and corrected.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"How do you find out if you're unwanted if everyone you try to ask tells you to go away?" - Balboos HaGadolRHS expression is evaluated to 0, then i is incremented, but the RHS expression value is assigned back to i.
-
int i = 0;
i = i++;What is the value of i after executing these statements.
-
I wouldn't ask them anything. Sit them down in front of pc with VS and sql server. Ask them to create a simple web page (if it is asp.net) or winform (if a windows job) using the pubs database that has a drop down list with authors and grid populated with books by each author. If they can make it work under the pressure of the interview then hire them. If not, don't.
I didn't get any requirements for the signature
-
Hi all, What would you consider a good question to ask to a potential programmer to see whether he/she is worth their salt? Thanks in advance for any suggestions Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
I had an interviewer ask me one time if I could write a program to do some fairly simple task (don't remember what it was) and have my program compile without any errors. I said, "probably not." I got the job. Guess he liked my honesty.
Gary Kirkham Forever Forgiven and Alive in the Spirit For God so loved the world, that He gave His only begotten Son, that whoever believes in Him shall not perish, but have eternal life. Me blog, You read
-
That is very similar to what we do. It works very well.
Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog
I had to do that at my last job. I passed and then got to test new candidates. When were interviewing for a "Senior" level asp.net position and a lot of candidates couldn't make a simple web page. We even wrote the stored procs for them and told them that they could code it however they wanted. All they had to do was make it work. Over 50% of them failed. But they could talk on and on about all the object oriented stuff like inheritance, abstraction and encapsulation. Theory is one thing, programming in real life is something else.
I didn't get any requirements for the signature
-
A bit harsh but very good.
Visit http://www.notreadytogiveup.com/[^] and do something special today.
Trollslayer wrote:
A bit harsh
You mean coding in Visual Studio during an interview? :~ Try a whiteboard :)
-
http://www.newinterviewquestions.com/list.htm[^] This may help according to a job category.
Regards, Mushq
If the "approval" for answers and the english correction for the whole site is the same as in this question[^] I wouldn't trust on it. What is a "arithematic progression" and a "gemotric mean". I know about "arithmetic progression" and "geometric mean". BTW... even the "typos" how can be the therms in an arithmetic progression bigger than the result as they are in the "approved" answer? And another jewel... see[^]
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson Rating helpfull answers is nice, but saying thanks can be even nicer.
modified on Friday, May 23, 2008 12:41 PM