Interview question

Discussion in 'C++' started by Noah Roberts, Apr 27, 2007.

  1. Noah Roberts

    Noah Roberts Guest

    How would you answer this question?

    "Describe the structure of a class."

    I was stumped, quite frankly.
     
    Noah Roberts, Apr 27, 2007
    #1
    1. Advertising

  2. Noah Roberts

    Zeppe Guest

    Noah Roberts wrote:
    > How would you answer this question?
    >
    > "Describe the structure of a class."
    >
    > I was stumped, quite frankly.


    A class is composed by member variables that contain the data associated
    to the class instances, and the member functions that describe
    operations on the instances. A class can contain private memebrs and
    functions, that can be accessed only by instances of the class itself,
    and public member and functions that can be accessed by anyone. In a
    good obect oriented code the member variables are usually private, while
    the public member functions represent the class interface, which
    represent the level of abstraction at which the class has to be used.

    and so on... there is so much to write..

    Regards,

    Zeppe
     
    Zeppe, Apr 27, 2007
    #2
    1. Advertising

  3. Noah Roberts wrote:
    > How would you answer this question?
    >
    > "Describe the structure of a class."
    >
    > I was stumped, quite frankly.


    Did you ask what they mean by 'a class'? Perhaps it was the
    memory layout of an instance they were interested in or perhaps
    it was the syntactical form of 'a class definition'... You can
    spin this in any direction showing off the knowledge of the
    virtual inheritance and its implementation, virtual function
    pointer table, the fact that the layout is only guaranteed
    between access specifiers, the fact that member functions don't
    take up space in the instance (beyond the first virtual function),
    and so on.

    If you didn't ask, you still have choices and so you could simply
    start by saying "if you mean blah, then blahblah". If the
    intervewer nods, you made the right guess. If they keep listening
    without indicating whether you guessed right, you finish one
    description, and begin another, "And if you mean blahblah,
    then blahblahblah"...

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Apr 27, 2007
    #3
  4. Noah Roberts

    James Kanze Guest

    On Apr 27, 5:45 pm, Noah Roberts <> wrote:
    > How would you answer this question?


    > "Describe the structure of a class."


    > I was stumped, quite frankly.


    I would be too. What are they asking for, in fact?

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Apr 27, 2007
    #4
  5. Noah Roberts

    Zeppe Guest

    James Kanze wrote:
    > On Apr 27, 5:45 pm, Noah Roberts <> wrote:
    >> How would you answer this question?

    >
    >> "Describe the structure of a class."

    >
    >> I was stumped, quite frankly.

    >
    > I would be too. What are they asking for, in fact?
    >


    ahah, I'm the only one that has interpreted it in the naive way? :p

    Regards,

    Zeppe
     
    Zeppe, Apr 27, 2007
    #5
  6. Noah Roberts

    Guest

    On Apr 27, 11:45 am, Noah Roberts <> wrote:
    > How would you answer this question?
    >
    > "Describe the structure of a class."
    >
    > I was stumped, quite frankly.


    I'm guessing they didn't really know what they were asking and
    probably pulled this out of a book completely out of context.
     
    , Apr 27, 2007
    #6
  7. Noah Roberts

    Guest

    On Apr 27, 2:15 pm, wrote:
    > On Apr 27, 11:45 am, Noah Roberts <> wrote:
    >
    > > How would you answer this question?

    >
    > > "Describe the structure of a class."

    >
    > > I was stumped, quite frankly.

    >
    > I'm guessing they didn't really know what they were asking and
    > probably pulled this out of a book completely out of context.


    Or maybe they were looking for the syntactical structure of a class
    declaration? Hard to tell from that question.
     
    , Apr 27, 2007
    #7
  8. wrote:
    > On Apr 27, 11:45 am, Noah Roberts <> wrote:
    >> How would you answer this question?
    >>
    >> "Describe the structure of a class."
    >>
    >> I was stumped, quite frankly.

    >
    > I'm guessing they didn't really know what they were asking and
    > probably pulled this out of a book completely out of context.


    <shrug> Why does it matter?

    It really serves no good purpose to guess what they meant or
    whether they knew what they were asking about. Interviews are
    not conducted to evaluate the candidate's knowledge about any
    particular subject (or at least not conducted only to evaluate).

    It's much more important to see how the candidate handles
    situations like the one Noah described. Whether the candidate
    is stumpted or not shouldn't matter either. The answer should
    be given right away, and it should be to the best of the
    candidate's understanding of what he was asked.

    It's a very old tale, but it's quite possible that it has the
    origins in real life... Once a very strict professor was talking
    to a student at an oral exam. The professor was still undecided
    whether to pass or fail the guy. So he said, "If you answer this
    last question, I'll pass you, if you don't, you failed. How many
    hairs are there in my beard?" The student replied immediately,
    "ten thousand three hundred ninety-seven." "How do you know?"
    "Well, that's a different question, professor".

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Apr 27, 2007
    #8
  9. wrote:
    > On Apr 27, 2:15 pm, wrote:
    >> On Apr 27, 11:45 am, Noah Roberts <> wrote:
    >>
    >>> How would you answer this question?

    >>
    >>> "Describe the structure of a class."

    >>
    >>> I was stumped, quite frankly.

    >>
    >> I'm guessing they didn't really know what they were asking and
    >> probably pulled this out of a book completely out of context.

    >
    > Or maybe they were looking for the syntactical structure of a class
    > declaration? Hard to tell from that question.


    I agree, it's hard. No surprise Noah was "stumpted". Even James
    Kanze admitted he'd be stumpted. It doesn't matter, though. One
    would still be expected to give _an_ answer. Whatever one thinks
    they wanted to hear.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Apr 27, 2007
    #9
  10. On 27 Apr 2007 11:02:03 -0700, James Kanze wrote:

    >On Apr 27, 5:45 pm, Noah Roberts <> wrote:
    >> How would you answer this question?

    >
    >> "Describe the structure of a class."

    >
    >> I was stumped, quite frankly.

    >
    >I would be too. What are they asking for, in fact?


    To me, they are asking to say goodbye and go looking for a true job
    :)

    --
    Gennaro Prota
    https://sourceforge.net/projects/breeze/
     
    Gennaro Prota, Apr 27, 2007
    #10
  11. Noah Roberts

    Guest

    On Apr 27, 2:34 pm, "Victor Bazarov" <> wrote:
    > wrote:
    > > On Apr 27, 2:15 pm, wrote:
    > >> On Apr 27, 11:45 am, Noah Roberts <> wrote:

    >
    > >>> How would you answer this question?

    >
    > >>> "Describe the structure of a class."

    >
    > >>> I was stumped, quite frankly.

    >
    > >> I'm guessing they didn't really know what they were asking and
    > >> probably pulled this out of a book completely out of context.

    >
    > > Or maybe they were looking for the syntactical structure of a class
    > > declaration? Hard to tell from that question.

    >
    > I agree, it's hard. No surprise Noah was "stumpted". Even James
    > Kanze admitted he'd be stumpted. It doesn't matter, though. One
    > would still be expected to give _an_ answer. Whatever one thinks
    > they wanted to hear.


    Oh, definitely. I would have asked them what they meant. If they
    explained badly or got standoffish, I'd realize that I probably didn't
    want to work for them. Then I'd have some real fun and describe the
    molecular structure of Silicon...
     
    , Apr 27, 2007
    #11
  12. Gennaro Prota wrote:
    > On 27 Apr 2007 11:02:03 -0700, James Kanze wrote:
    >
    >> On Apr 27, 5:45 pm, Noah Roberts <> wrote:
    >>> How would you answer this question?

    >>
    >>> "Describe the structure of a class."

    >>
    >>> I was stumped, quite frankly.

    >>
    >> I would be too. What are they asking for, in fact?

    >
    > To me, they are asking to say goodbye and go looking for a true job
    > :)


    Or begging to say at least something so they can justify hiring him
    to become their saviour... :)
     
    Victor Bazarov, Apr 27, 2007
    #12
  13. Noah Roberts

    Drew Lawson Guest

    In article <f0tfof$qp2$>
    "Victor Bazarov" <> writes:
    > wrote:
    >> On Apr 27, 2:15 pm, wrote:
    >>> On Apr 27, 11:45 am, Noah Roberts <> wrote:
    >>>
    >>>> How would you answer this question?
    >>>
    >>>> "Describe the structure of a class."
    >>>
    >>>> I was stumped, quite frankly.
    >>>
    >>> I'm guessing they didn't really know what they were asking and
    >>> probably pulled this out of a book completely out of context.

    >>
    >> Or maybe they were looking for the syntactical structure of a class
    >> declaration? Hard to tell from that question.

    >
    >I agree, it's hard. No surprise Noah was "stumpted". Even James
    >Kanze admitted he'd be stumpted. It doesn't matter, though. One
    >would still be expected to give _an_ answer. Whatever one thinks
    >they wanted to hear.


    When I was 25, I'd have gone for panic followed by bluffing followed
    by depression. At 45, I've gotten better at, "I'm not sure I
    understand the question." Sometimes that's what they are after.
    It helps if I follow that up with a couple plausible directions --
    that shows the ability to think and the ability to spot a faulty
    spec.

    I've given interview questions before where the main point was
    seeing how the candidate approached the question, since no one can
    really handle a truely interesting problem in the time of most
    interviews. (And I've seen candidates fail to grasp several
    consecutive clues about how to answer a question.)

    I hate interviewing, both sides of the table.


    --
    |Drew Lawson | Of all the things I've lost |
    | | I miss my mind the most |
    |http://www.furrfu.com/ | |
     
    Drew Lawson, Apr 27, 2007
    #13
  14. Noah Roberts

    James Kanze Guest

    On Apr 27, 8:34 pm, "Victor Bazarov" <> wrote:
    > wrote:
    > > On Apr 27, 2:15 pm, wrote:
    > >> On Apr 27, 11:45 am, Noah Roberts <> wrote:


    > >>> How would you answer this question?


    > >>> "Describe the structure of a class."


    > >>> I was stumped, quite frankly.


    > >> I'm guessing they didn't really know what they were asking and
    > >> probably pulled this out of a book completely out of context.


    > > Or maybe they were looking for the syntactical structure of a class
    > > declaration? Hard to tell from that question.


    > I agree, it's hard. No surprise Noah was "stumpted". Even James
    > Kanze admitted he'd be stumpted. It doesn't matter, though. One
    > would still be expected to give _an_ answer. Whatever one thinks
    > they wanted to hear.


    That is, of course, the key.

    In a normal situation, a job interview works both ways; you also
    use it to determine whether you want to work there or not. It
    depends somewhat on the context, but usually, such a question
    goes a long way in answering that question.

    There are times, however, when you want the job, no matter what.
    In those cases, you try to guess what they are looking for in an
    answer, and feed that back to them.

    FWIW: I once "failed" a job interview because they asked "what
    does the keyword static mean in C++". The answer they were
    looking for was "that what is being declared isn't on the
    stack". I wrote about a half a page, explaining the different
    meanings according to context. (It's effect on scope, on object
    lifetime, and on the absense of a this pointer.) That wasn't
    what they were looking for, so out I went. But to be frank,
    when they explained what they were looking for, I don't think
    I've have wanted the job anyway.

    --
    James Kanze (Gabi Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Apr 28, 2007
    #14
  15. Noah Roberts

    Guest Guest

    "Noah Roberts" <> wrote in message
    news:f0t5pn$1b6$...
    > How would you answer this question?
    >
    > "Describe the structure of a class."
    >
    > I was stumped, quite frankly.


    A struct(ure)?

    Jim
     
    Guest, Apr 28, 2007
    #15
  16. Noah Roberts

    Digital Puer Guest

    On Apr 27, 9:07 am, "Victor Bazarov" <> wrote:
    > Noah Roberts wrote:
    > > How would you answer this question?

    >
    > > "Describe the structure of a class."

    >
    > > I was stumped, quite frankly.

    >
    > Did you ask what they mean by 'a class'? Perhaps it was the
    > memory layout of an instance they were interested in or perhaps
    > it was the syntactical form of 'a class definition'... You can
    > spin this in any direction showing off the knowledge of the
    > virtual inheritance and its implementation, virtual function
    > pointer table, the fact that the layout is only guaranteed
    > between access specifiers, the fact that member functions don't
    > take up space in the instance (beyond the first virtual function),
    > and so on.




    What's a good source for this kind of low-level informaton
    about c++? A book or URL would be great.
     
    Digital Puer, Apr 30, 2007
    #16
  17. On 2007-04-30 08:37, Digital Puer wrote:
    > On Apr 27, 9:07 am, "Victor Bazarov" <> wrote:
    >> Noah Roberts wrote:
    >> > How would you answer this question?

    >>
    >> > "Describe the structure of a class."

    >>
    >> > I was stumped, quite frankly.

    >>
    >> Did you ask what they mean by 'a class'? Perhaps it was the
    >> memory layout of an instance they were interested in or perhaps
    >> it was the syntactical form of 'a class definition'... You can
    >> spin this in any direction showing off the knowledge of the
    >> virtual inheritance and its implementation, virtual function
    >> pointer table, the fact that the layout is only guaranteed
    >> between access specifiers, the fact that member functions don't
    >> take up space in the instance (beyond the first virtual function),
    >> and so on.

    >
    >
    >
    > What's a good source for this kind of low-level informaton
    > about c++? A book or URL would be great.


    I'm not quite sure what you mean with low-level since it's not clear
    what the question is really about, however The C++ Porgramming Language
    and The Design and Evolution of C++ (both by Bjarne Stroustrup) will
    provide you with lots of information.

    --
    Erik Wikström
     
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=, Apr 30, 2007
    #17
  18. Noah Roberts

    Aston Martin Guest

    On Apr 27, 11:46 pm, wrote:
    > On Apr 27, 2:34 pm, "Victor Bazarov" <> wrote:
    >
    >
    >
    > > wrote:
    > > > On Apr 27, 2:15 pm, wrote:
    > > >> On Apr 27, 11:45 am, Noah Roberts <> wrote:

    >
    > > >>> How would you answer this question?

    >
    > > >>> "Describe the structure of a class."

    >
    > > >>> I was stumped, quite frankly.

    >
    > > >> I'm guessing they didn't really know what they were asking and
    > > >> probably pulled this out of a book completely out of context.

    >
    > > > Or maybe they were looking for the syntactical structure of a class
    > > > declaration? Hard to tell from that question.

    >
    > > I agree, it's hard. No surprise Noah was "stumpted". Even James
    > > Kanze admitted he'd be stumpted. It doesn't matter, though. One
    > > would still be expected to give _an_ answer. Whatever one thinks
    > > they wanted to hear.

    >
    > Oh, definitely. I would have asked them what they meant. If they
    > explained badly or got standoffish, I'd realize that I probably didn't
    > want to work for them. Then I'd have some real fun and describe the
    > molecular structure of Silicon...


    dave, am sorry but cud not help. Silicon is an element, u cud have
    said atomic structure rather than molecular structure :))
     
    Aston Martin, Apr 30, 2007
    #18
  19. Noah Roberts

    Aston Martin Guest

    On Apr 30, 11:37 am, Digital Puer <> wrote:
    > On Apr 27, 9:07 am, "Victor Bazarov" <> wrote:
    >
    >
    >
    > > Noah Roberts wrote:
    > > > How would you answer this question?

    >
    > > > "Describe the structure of a class."

    >
    > > > I was stumped, quite frankly.

    >
    > > Did you ask what they mean by 'a class'? Perhaps it was the
    > > memory layout of an instance they were interested in or perhaps
    > > it was the syntactical form of 'a class definition'... You can
    > > spin this in any direction showing off the knowledge of the
    > > virtual inheritance and its implementation, virtual function
    > > pointer table, the fact that the layout is only guaranteed
    > > between access specifiers, the fact that member functions don't
    > > take up space in the instance (beyond the first virtual function),
    > > and so on.

    >
    > What's a good source for this kind of low-level informaton
    > about c++? A book or URL would be great.


    Inside the C++ Object Model
    By Stanley B. Lippman
    Publisher: Addison Wesley
    Pub Date: May 03, 1996
    ISBN: 0-201-83454-5
     
    Aston Martin, Apr 30, 2007
    #19
  20. Noah Roberts

    Noah Roberts Guest

    Victor Bazarov wrote:
    > Noah Roberts wrote:
    >> How would you answer this question?
    >>
    >> "Describe the structure of a class."
    >>
    >> I was stumped, quite frankly.

    >
    > Did you ask what they mean by 'a class'? Perhaps it was the
    > memory layout of an instance they were interested in or perhaps
    > it was the syntactical form of 'a class definition'... You can
    > spin this in any direction showing off the knowledge of the
    > virtual inheritance and its implementation, virtual function
    > pointer table, the fact that the layout is only guaranteed
    > between access specifiers, the fact that member functions don't
    > take up space in the instance (beyond the first virtual function),
    > and so on.


    Yeah, I tried that route but it was obviously not what he was looking
    for. Then he said something like, "You know about private, public, ...
    well?" So I tried to talk about permission and scope...and then he
    moved on to some other hard to figure out question.

    This was an interview with Logitech. I don't think it was a problem of
    people not knowing what they are asking. He had a very heavy accent
    though...maybe he didn't know how to relate what he was saying.

    Obviously I didn't get the job or it wouldn't bother me as much. I
    don't even know if this was why...I just wanted to see if anyone else
    would have been able to figure it out :p
     
    Noah Roberts, Apr 30, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gopal Krish

    Interview question

    Gopal Krish, Oct 22, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    681
    John Timney \(Microsoft MVP\)
    Oct 23, 2004
  2. Digital Puer
    Replies:
    17
    Views:
    4,004
    Andrew Thompson
    Dec 27, 2003
  3. Jerry

    An interview question

    Jerry, May 27, 2005, in forum: Java
    Replies:
    22
    Views:
    938
    Brooks Hagenow
    Jun 12, 2005
  4. Replies:
    9
    Views:
    459
    Andrey Tarasevich
    Jan 22, 2005
  5. reema
    Replies:
    0
    Views:
    281
    reema
    Aug 26, 2008
Loading...

Share This Page