Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Question to ask an interviewee

Question to ask an interviewee

Scheduled Pinned Locked Moved The Lounge
questioncomtools
52 Posts 25 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Brady Kelly

    int i = 0;
    i = i++;

    What is the value of i after executing these statements.

    J Offline
    J Offline
    John M Drescher
    wrote on last edited by
    #3

    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

    B J C 3 Replies Last reply
    0
    • P Programm3r

      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: ^_^

      R Offline
      R Offline
      R Giskard Reventlov
      wrote on last edited by
      #4

      How would you solve a problem like Maria?

      me, me, me

      P L D 3 Replies Last reply
      0
      • J John M Drescher

        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

        B Offline
        B Offline
        Brady Kelly
        wrote on last edited by
        #5

        Clue: The ++ operator is called post-increment.

        J 1 Reply Last reply
        0
        • R R Giskard Reventlov

          How would you solve a problem like Maria?

          me, me, me

          P Offline
          P Offline
          phannon86
          wrote on last edited by
          #6

          A combination of a gun and finding out where Graham Norton lives...

          He who makes a beast out of himself gets rid of the pain of being a man

          1 Reply Last reply
          0
          • R R Giskard Reventlov

            How would you solve a problem like Maria?

            me, me, me

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #7

            digital man wrote:

            How would you solve a problem like Maria?

            I would need to call Julie Andrews for phone a friend.

            Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004

            1 Reply Last reply
            0
            • P Programm3r

              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: ^_^

              N Offline
              N Offline
              No e
              wrote on last edited by
              #8

              We usually prepare a small test and actually give it to them. Simple things, but you would be amazed how many people can't even do the basics.

              1 Reply Last reply
              0
              • J John M Drescher

                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

                J Offline
                J Offline
                jchigg2000
                wrote on last edited by
                #9

                You're actually keeping track of the number of lines of code you produce??

                J 1 Reply Last reply
                0
                • P Programm3r

                  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: ^_^

                  D Offline
                  D Offline
                  Duncan Edwards Jones
                  wrote on last edited by
                  #10

                  Why should you avoid floating point variable types in financial applications?

                  '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

                  B 1 Reply Last reply
                  0
                  • R R Giskard Reventlov

                    How would you solve a problem like Maria?

                    me, me, me

                    D Offline
                    D Offline
                    Duncan Edwards Jones
                    wrote on last edited by
                    #11

                    digital man wrote:

                    How would you solve a problem like Maria?

                    Maria isn't a problem. Maria is an "opportunity" :-)

                    '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

                    1 Reply Last reply
                    0
                    • B Brady Kelly

                      int i = 0;
                      i = i++;

                      What is the value of i after executing these statements.

                      V Offline
                      V Offline
                      Vikram A Punathambekar
                      wrote on last edited by
                      #12

                      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

                      B N 2 Replies Last reply
                      0
                      • V Vikram A Punathambekar

                        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

                        B Offline
                        B Offline
                        Brady Kelly
                        wrote on last edited by
                        #13

                        I should have qualified that it was C#

                        1 Reply Last reply
                        0
                        • D Duncan Edwards Jones

                          Why should you avoid floating point variable types in financial applications?

                          '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

                          B Offline
                          B Offline
                          Brady Kelly
                          wrote on last edited by
                          #14

                          Cos everyone knows that cents only have two digits, fool!

                          1 Reply Last reply
                          0
                          • B Brady Kelly

                            int i = 0;
                            i = i++;

                            What is the value of i after executing these statements.

                            D Offline
                            D Offline
                            Dario Solera
                            wrote on last edited by
                            #15

                            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

                            1 Reply Last reply
                            0
                            • B Brady Kelly

                              int i = 0;
                              i = i++;

                              What is the value of i after executing these statements.

                              A Offline
                              A Offline
                              Anthony Mushrow
                              wrote on last edited by
                              #16

                              For some crazy reason 0. It must get the current value of i and store it, increment, then set the stored value back into i undo-ing the increment.

                              My current favourite word is: I'm starting to run out of fav. words!

                              -SK Genius

                              Game Programming articles start -here[^]-

                              B 1 Reply Last reply
                              0
                              • A Anthony Mushrow

                                For some crazy reason 0. It must get the current value of i and store it, increment, then set the stored value back into i undo-ing the increment.

                                My current favourite word is: I'm starting to run out of fav. words!

                                -SK Genius

                                Game Programming articles start -here[^]-

                                B Offline
                                B Offline
                                Brady Kelly
                                wrote on last edited by
                                #17

                                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:

                                W 1 Reply Last reply
                                0
                                • B Brady Kelly

                                  Clue: The ++ operator is called post-increment.

                                  J Offline
                                  J Offline
                                  John M Drescher
                                  wrote on last edited by
                                  #18

                                  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

                                  1 Reply Last reply
                                  0
                                  • J jchigg2000

                                    You're actually keeping track of the number of lines of code you produce??

                                    J Offline
                                    J Offline
                                    John M Drescher
                                    wrote on last edited by
                                    #19

                                    Since I work on my own code and projects this is pretty easy. I use project line counter from www.wndtabs.com[^]

                                    John

                                    1 Reply Last reply
                                    0
                                    • P Programm3r

                                      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: ^_^

                                      M Offline
                                      M Offline
                                      Mushtaque Nizamani
                                      wrote on last edited by
                                      #20

                                      http://www.newinterviewquestions.com/list.htm[^] This may help according to a job category.

                                      Regards, Mushq

                                      N 1 Reply Last reply
                                      0
                                      • P Programm3r

                                        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: ^_^

                                        T Offline
                                        T Offline
                                        ToddHileHoffer
                                        wrote on last edited by
                                        #21

                                        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

                                        O C L 3 Replies Last reply
                                        0
                                        • V Vikram A Punathambekar

                                          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

                                          N Offline
                                          N Offline
                                          Nemanja Trifunovic
                                          wrote on last edited by
                                          #22

                                          Vikram A Punathambekar wrote:

                                          Isn't that technically undefined, at least in C++?

                                          Yep, in fact gcc and MSVC will give different results.

                                          Programming Blog utf8-cpp

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups