Question to ask an interviewee
-
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
I should have qualified that it was C#
-
Why should you avoid floating point variable types in financial applications?
'--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
Cos everyone knows that cents only have two digits, fool!
-
int i = 0;
i = i++;What is the value of i after executing these statements.
1? :-O
If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker My Photos/CP Flickr Group - ScrewTurn Wiki
-
int i = 0;
i = i++;What is the value of i after executing these statements.
-
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