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. Funny interview question

Funny interview question

Scheduled Pinned Locked Moved The Lounge
questioncsharpc++htmlcom
39 Posts 19 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.
  • N Offline
    N Offline
    Nish Nishant
    wrote on last edited by
    #1

    Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


    Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

    M J Z L V 11 Replies Last reply
    0
    • N Nish Nishant

      Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Just use a C++ keyword that is not in C, such as: main() { int this=1; } ;) Seems rather silly as an interview question, though. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

      V N B 3 Replies Last reply
      0
      • N Nish Nishant

        Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


        Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

        J Offline
        J Offline
        Josh Knox
        wrote on last edited by
        #3

        Seems like a sort of useless question. Does this question reveal any skills on the prospect's part that are necessary for the job? Josh Knox

        We will rid the world of buttmunching pussnuts. Armed only with my blunt spoon of death and my circumcising potato peeler. Death and torture to them all. - Michael Martin

        ---Bob3D---

        1 Reply Last reply
        0
        • N Nish Nishant

          Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

          Z Offline
          Z Offline
          Zyxil
          wrote on last edited by
          #4

          i've said it before, but i believe that these "quick and dirty" questions to test programming knowledge are useless if you are going to interview someone for an important position, programming or otherwise, take the time to get to know them. two interviews are good, one to weed out the ones who can't make a first impression, and the second round for getting to know them, spend two or three hours with them talking about all kinds of stuff, not just programming there are no easy answers to hard problems -John

          1 Reply Last reply
          0
          • N Nish Nishant

            Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


            Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

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

            Nishant S wrote: What do ya guys think? Stupid question and us interviewee's, subjected to mind game questions should be able to physically beat interviewer's that ask crap like this half to death. ;P ...and if you wondering it's 1 months tomorrow. Michael Martin Australia mjm68@tpg.com.au "I personally love it because I can get as down and dirty as I want on the backend, while also being able to dabble with fun scripting and presentation games on the front end." - Chris Maunder 15/07/2002

            M N 2 Replies Last reply
            0
            • M Michael Dunn

              Just use a C++ keyword that is not in C, such as: main() { int this=1; } ;) Seems rather silly as an interview question, though. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

              V Offline
              V Offline
              Vagif Abilov
              wrote on last edited by
              #6

              The task was opposite: to write a valid C program that will not compile in C++. "this" is not a valid "C" keyword. Vagif Abilov MCP (Visual C++) Oslo, Norway Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros. Tomasz Sowinski

              M E 2 Replies Last reply
              0
              • M Michael Dunn

                Just use a C++ keyword that is not in C, such as: main() { int this=1; } ;) Seems rather silly as an interview question, though. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                N Offline
                N Offline
                Nish Nishant
                wrote on last edited by
                #7

                Michael Dunn wrote: Seems rather silly as an interview question, though. Jus what I thought (anyway I had tons of other stuff to ask which made more sense to me) Nish


                Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                U 1 Reply Last reply
                0
                • N Nish Nishant

                  Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


                  Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                  V Offline
                  V Offline
                  Vagif Abilov
                  wrote on last edited by
                  #8

                  Absolutely useless question, if you ask me. What if the guy started in C++ bypassing "C"? Vagif Abilov MCP (Visual C++) Oslo, Norway Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros. Tomasz Sowinski

                  1 Reply Last reply
                  0
                  • N Nish Nishant

                    Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


                    Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                    B Offline
                    B Offline
                    benjymous
                    wrote on last edited by
                    #9

                    this doesn't compile under c++ http://www.codeproject.com/lounge.asp?msg=300626#xx300626xx[^] [edit] Though I think answering that question with "Why?" would be a fairly valid answer :-D [/edit] [edit2] This reminds me of a question that a computer science lecturer once asked in a tutorial - "If a computer program takes no input, and produces no output, how can you be certain that it has run correctly?" (to which the answer he was waiting for was "what is the point of a program that takes no input and provides no output?" [/edit2] -- Help me! I'm turning into a grapefruit!

                    1 Reply Last reply
                    0
                    • N Nish Nishant

                      Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


                      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                      J Offline
                      J Offline
                      Jeremy Falcon
                      wrote on last edited by
                      #10

                      Nishant S wrote: Write a valid C program that would not comopile under C++

                      int main()
                      {
                      #ifdef __cplusplus
                      this is such bad syntax
                      #endif
                      return 0;
                      }

                      :laugh: Jeremy Falcon Imputek "Oh no there was a knife in that kitchen drawer and I cut myself - please remove the kitchen." - David Wulff

                      1 Reply Last reply
                      0
                      • V Vagif Abilov

                        The task was opposite: to write a valid C program that will not compile in C++. "this" is not a valid "C" keyword. Vagif Abilov MCP (Visual C++) Oslo, Norway Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros. Tomasz Sowinski

                        M Offline
                        M Offline
                        Michael Dunn
                        wrote on last edited by
                        #11

                        No, that's exactly what I did. My code is valid C but it will not compile under C++ because it uses a C++ keyword as a variable. :confused: You can just as easily write:

                        main()
                        {
                        int private=1, protected=1, mutable=1;
                        }

                        and so on. All valid C since none of those are reserved words. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                        V 1 Reply Last reply
                        0
                        • N Nish Nishant

                          Hi guys Today we were interviewing some candidates for some programmer jobs. My boss suggested a few interview questions to us and one of them was this :- Write a valid C program that would not comopile under C++ Hmmmm, now what kinda question is that? Would it be a proper test of a candidate? As for me I was confused for a while till I thought of type safety in C++. I haven't tried it out but I presume that if we do some unsafe type casting it'll be valid in C but invalid in C++. What do ya guys think? Nish


                          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                          M Offline
                          M Offline
                          Megan Forbes
                          wrote on last edited by
                          #12

                          Might get some interesting answers! :-D


                          The following statement about your geekness is true. The previous statement about your geekness is false.

                          N 1 Reply Last reply
                          0
                          • L Lost User

                            Nishant S wrote: What do ya guys think? Stupid question and us interviewee's, subjected to mind game questions should be able to physically beat interviewer's that ask crap like this half to death. ;P ...and if you wondering it's 1 months tomorrow. Michael Martin Australia mjm68@tpg.com.au "I personally love it because I can get as down and dirty as I want on the backend, while also being able to dabble with fun scripting and presentation games on the front end." - Chris Maunder 15/07/2002

                            M Offline
                            M Offline
                            Michael Dunn
                            wrote on last edited by
                            #13

                            Heh, that reminds me of how I felt when I got the question "what's the difference between a macro and an inline function?" I got this at Microsoft. I guess the interviewer thought I'd been able to get through two phone interviews without letting it slip that I don't actually know C++ well enough to know the difference. X| --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                            1 Reply Last reply
                            0
                            • M Megan Forbes

                              Might get some interesting answers! :-D


                              The following statement about your geekness is true. The previous statement about your geekness is false.

                              N Offline
                              N Offline
                              Nish Nishant
                              wrote on last edited by
                              #14

                              Megan Forbes wrote: Might get some interesting answers! But I never asked a question :-( Just stated a funny incident and then everyone goes angry and start asking me what good it does :-( Nish


                              Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                              M V 2 Replies Last reply
                              0
                              • M Michael Dunn

                                No, that's exactly what I did. My code is valid C but it will not compile under C++ because it uses a C++ keyword as a variable. :confused: You can just as easily write:

                                main()
                                {
                                int private=1, protected=1, mutable=1;
                                }

                                and so on. All valid C since none of those are reserved words. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                                V Offline
                                V Offline
                                Vagif Abilov
                                wrote on last edited by
                                #15

                                Sorry, you're right of course! Silly me X| Vagif Abilov MCP (Visual C++) Oslo, Norway Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros. Tomasz Sowinski

                                1 Reply Last reply
                                0
                                • N Nish Nishant

                                  Megan Forbes wrote: Might get some interesting answers! But I never asked a question :-( Just stated a funny incident and then everyone goes angry and start asking me what good it does :-( Nish


                                  Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                                  M Offline
                                  M Offline
                                  Megan Forbes
                                  wrote on last edited by
                                  #16

                                  sorry - I meant some of the people be interviewed might give you some cool answers to the C / C++ code question that would be worth sharing :cool:


                                  The following statement about your geekness is true. The previous statement about your geekness is false.

                                  1 Reply Last reply
                                  0
                                  • L Lost User

                                    Nishant S wrote: What do ya guys think? Stupid question and us interviewee's, subjected to mind game questions should be able to physically beat interviewer's that ask crap like this half to death. ;P ...and if you wondering it's 1 months tomorrow. Michael Martin Australia mjm68@tpg.com.au "I personally love it because I can get as down and dirty as I want on the backend, while also being able to dabble with fun scripting and presentation games on the front end." - Chris Maunder 15/07/2002

                                    N Offline
                                    N Offline
                                    Nish Nishant
                                    wrote on last edited by
                                    #17

                                    Michael Martin wrote: ...and if you wondering it's 1 months tomorrow. 11 rather :-( Nish


                                    Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                                    L 1 Reply Last reply
                                    0
                                    • N Nish Nishant

                                      Michael Dunn wrote: Seems rather silly as an interview question, though. Jus what I thought (anyway I had tons of other stuff to ask which made more sense to me) Nish


                                      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                                      U Offline
                                      U Offline
                                      Uwe Keim
                                      wrote on last edited by
                                      #18

                                      You should rather ask him whether he knows CodeProject.com. If he/she doesn't, I would recommend NOT taking him. If he answers "YES of course", ask him whether he is a member, and only take him if his member ID is less than 50000. -- Scanned MSDN Mag ad with YOUR name: www.magerquark.de/misc/CodeProject.html See me: www.magerquark.de

                                      N E T 3 Replies Last reply
                                      0
                                      • N Nish Nishant

                                        Megan Forbes wrote: Might get some interesting answers! But I never asked a question :-( Just stated a funny incident and then everyone goes angry and start asking me what good it does :-( Nish


                                        Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                                        V Offline
                                        V Offline
                                        Vagif Abilov
                                        wrote on last edited by
                                        #19

                                        The interview result might be quite funny: a developer A is given a job because his program did not compile. Developer's program compiled unfortuntely, so he's not got a job. An exceptional case where you have to show your skills in writing a program that does not compile. :) Vagif Abilov MCP (Visual C++) Oslo, Norway Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros. Tomasz Sowinski

                                        N 1 Reply Last reply
                                        0
                                        • U Uwe Keim

                                          You should rather ask him whether he knows CodeProject.com. If he/she doesn't, I would recommend NOT taking him. If he answers "YES of course", ask him whether he is a member, and only take him if his member ID is less than 50000. -- Scanned MSDN Mag ad with YOUR name: www.magerquark.de/misc/CodeProject.html See me: www.magerquark.de

                                          N Offline
                                          N Offline
                                          Nish Nishant
                                          wrote on last edited by
                                          #20

                                          Uwe Keim wrote: You should rather ask him whether he knows CodeProject.com. If he/she doesn't, I would recommend NOT taking him. The problem is that only an elite minority have regular internet access in Trivandrum. Forget regular, I wonder how many people even manage to chk mail at least once a week! This is the "3rd" word Uwe and Trivandrum is a rather 3rd worldish 3rd world city. Nish


                                          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

                                          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