Re: An interview question

Discussion in 'C Programming' started by Seebs, Mar 5, 2010.

  1. Seebs

    Seebs Guest

    On 2010-03-05, Debanjan <> wrote:
    > He want me to solve the problem using standard library function,but
    > without declaring any header file and of-course I was not allowed to
    > copy paste either from <time.h>.What I was told that if I want to use
    > struct tm it's the same layout as http://en.wikipedia.org/wiki/Time.h,that
    > is the fifth member is the tm_mon.


    Sounds stupid to me. I would see no reason to attempt such a thing, I
    also don't necessarily think it's a good thing to make the assumption that
    struct tm has exactly those members in that order. It may or may not be
    guaranteed, I can't remember, but... I sure wouldn't wanna bet on it.

    -s
    --
    Copyright 2010, all wrongs reversed. Peter Seebach /
    http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
    http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
     
    Seebs, Mar 5, 2010
    #1
    1. Advertising

  2. Seebs

    Seebs Guest

    On 2010-03-05, Debanjan <> wrote:
    >> Sounds stupid to me.  I would see no reason to attempt such a thing, I
    >> also don't necessarily think it's a good thing to make the assumption that
    >> struct tm has exactly those members in that order.  It may or may not be
    >> guaranteed, I can't remember, but... I sure wouldn't wanna bet on it.


    > May be he wants some platform specific stuffs !


    Sounds like a pretty bad interview question to me.

    Look at it this way: It doesn't sound like a question I'd be able to answer.
    I was on the language committee for about a decade, and I've done compiler
    maintenance. If a question on an interview sounds to me like it's
    unanswerable, I respectfully submit that the question is probably poorly
    chosen. :)

    -s
    --
    Copyright 2010, all wrongs reversed. Peter Seebach /
    http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
    http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
     
    Seebs, Mar 5, 2010
    #2
    1. Advertising

  3. On 2010-03-05, Debanjan <> wrote:
    >> Sounds stupid to me.  I would see no reason to attempt such a thing, I
    >> also don't necessarily think it's a good thing to make the assumption that
    >> struct tm has exactly those members in that order.  It may or may not be
    >> guaranteed, I can't remember, but... I sure wouldn't wanna bet on it.

    >
    > May be he wants some platform specific stuffs !


    Maybe he's an imbecile. You don't want to work for him.

    --
    Andrew Poelstra
    http://www.wpsoftware.net/andrew
     
    Andrew Poelstra, Mar 5, 2010
    #3
  4. Seebs

    Default User Guest

    Seebs wrote:

    > Sounds like a pretty bad interview question to me.


    Sounds like a terrific one to me. You can just get up, shake his hand,
    and leave without wasting any more of your time.



    Brian

    --
    Day 396 of the "no grouchy usenet posts" project
     
    Default User, Mar 5, 2010
    #4
  5. Seebs

    Seebs Guest

    On 2010-03-05, Default User <> wrote:
    > Seebs wrote:
    >> Sounds like a pretty bad interview question to me.


    > Sounds like a terrific one to me. You can just get up, shake his hand,
    > and leave without wasting any more of your time.


    Oooh, good point. I had not considered that angle.

    -s
    --
    Copyright 2010, all wrongs reversed. Peter Seebach /
    http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
    http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
     
    Seebs, Mar 5, 2010
    #5
  6. "Default User" <> writes:
    > Seebs wrote:
    >> Sounds like a pretty bad interview question to me.

    >
    > Sounds like a terrific one to me. You can just get up, shake his hand,
    > and leave without wasting any more of your time.


    Or you can tell the interviewer that it's a very silly thing to do,
    and he can tell you that was the answer he was looking for.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Mar 6, 2010
    #6
  7. Seebs

    Tim Rentsch Guest

    Seebs <> writes:

    > On 2010-03-05, Debanjan <> wrote:
    >>> Sounds stupid to me. I would see no reason to attempt such a thing, I
    >>> also don't necessarily think it's a good thing to make the assumption that
    >>> struct tm has exactly those members in that order. It may or may not be
    >>> guaranteed, I can't remember, but... I sure wouldn't wanna bet on it.

    >
    >> May be he wants some platform specific stuffs !

    >
    > Sounds like a pretty bad interview question to me.
    >
    > Look at it this way: It doesn't sound like a question I'd be able to answer.
    > I was on the language committee for about a decade, and I've done compiler
    > maintenance. If a question on an interview sounds to me like it's
    > unanswerable, I respectfully submit that the question is probably poorly
    > chosen. :)


    You may be assuming the OP has relayed the question accurately;
    he might not have. Also the interviewer may have had other,
    quite different motivations for asking the question, which
    didn't come through in the posted description.
     
    Tim Rentsch, Mar 6, 2010
    #7
  8. Seebs

    Richard Bos Guest

    Keith Thompson <> wrote:

    > "Default User" <> writes:
    > > Seebs wrote:
    > >> Sounds like a pretty bad interview question to me.

    > >
    > > Sounds like a terrific one to me. You can just get up, shake his hand,
    > > and leave without wasting any more of your time.

    >
    > Or you can tell the interviewer that it's a very silly thing to do,
    > and he can tell you that was the answer he was looking for.


    And then you can tell him that you'd prefer your employer not to be
    trying to set traps for his employees.

    Really, if _you_ would do that to _him_, you'd never get hired. Why
    should he be allowed any more dishonesty than you?

    Richard
     
    Richard Bos, Mar 10, 2010
    #8
  9. (Richard Bos) writes:
    > Keith Thompson <> wrote:
    >> "Default User" <> writes:
    >> > Seebs wrote:
    >> >> Sounds like a pretty bad interview question to me.
    >> >
    >> > Sounds like a terrific one to me. You can just get up, shake his hand,
    >> > and leave without wasting any more of your time.

    >>
    >> Or you can tell the interviewer that it's a very silly thing to do,
    >> and he can tell you that was the answer he was looking for.

    >
    > And then you can tell him that you'd prefer your employer not to be
    > trying to set traps for his employees.
    >
    > Really, if _you_ would do that to _him_, you'd never get hired. Why
    > should he be allowed any more dishonesty than you?


    In a real job, you're likely to be faced with bad requirements.
    As an interviewer, how would you judge an applicant's ability and
    willingness to question such requirements?

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Mar 10, 2010
    #9
  10. Seebs

    Default User Guest

    Keith Thompson wrote:

    > (Richard Bos) writes:
    > > Keith Thompson <> wrote:
    > >> "Default User" <> writes:
    > >> > Seebs wrote:
    > >> >> Sounds like a pretty bad interview question to me.
    > >> >
    > >> > Sounds like a terrific one to me. You can just get up, shake his

    > hand, >> > and leave without wasting any more of your time.
    > >>
    > >> Or you can tell the interviewer that it's a very silly thing to do,
    > >> and he can tell you that was the answer he was looking for.

    > >
    > > And then you can tell him that you'd prefer your employer not to be
    > > trying to set traps for his employees.
    > >
    > > Really, if you would do that to him, you'd never get hired. Why
    > > should he be allowed any more dishonesty than you?

    >
    > In a real job, you're likely to be faced with bad requirements.
    > As an interviewer, how would you judge an applicant's ability and
    > willingness to question such requirements?


    That's true, but irrelevant. The requirements in a real job should not
    be a deliberate trap to see what the reaction will be.

    In the given case, the applicant has no way of knowing a trap has been
    set. The best he or she can do is assume that this is a legitimate
    question. Given that assumption, then the only reasonable conclusion is
    that it's a clueless question that indicates a clueless interviewer,
    futher indicating a clueless organization.

    Like I said, get up and leave. Whether it's a dumb question or a trap
    doesn't matter.




    Brian

    --
    Day 400 of the "no grouchy usenet posts" project
     
    Default User, Mar 10, 2010
    #10
  11. "Default User" <> writes:
    > Keith Thompson wrote:
    >> (Richard Bos) writes:
    >> > Keith Thompson <> wrote:
    >> >> "Default User" <> writes:
    >> >> > Seebs wrote:
    >> >> >> Sounds like a pretty bad interview question to me.
    >> >> >
    >> >> > Sounds like a terrific one to me. You can just get up, shake his

    >> hand, >> > and leave without wasting any more of your time.
    >> >>
    >> >> Or you can tell the interviewer that it's a very silly thing to do,
    >> >> and he can tell you that was the answer he was looking for.
    >> >
    >> > And then you can tell him that you'd prefer your employer not to be
    >> > trying to set traps for his employees.
    >> >
    >> > Really, if you would do that to him, you'd never get hired. Why
    >> > should he be allowed any more dishonesty than you?

    >>
    >> In a real job, you're likely to be faced with bad requirements.
    >> As an interviewer, how would you judge an applicant's ability and
    >> willingness to question such requirements?

    >
    > That's true, but irrelevant. The requirements in a real job should not
    > be a deliberate trap to see what the reaction will be.


    That doesn't answer the question. Being able to respond reasonably
    to unreasonable requirements is a valuable skill. How do you test
    that in the course of an interview?

    And I wouldn't say this is necessarily a trap. If I were an
    interviewer, I'd give the applicant some credit for giving a
    reasonably good answer that conforms to the requirements. I'd give
    even more credit for pointing out the problem with the requirements.

    You could even phrase the question in a way that avoids any question
    of dishonesty, such as "How would you respond to a requirement
    like this?".

    > In the given case, the applicant has no way of knowing a trap has been
    > set. The best he or she can do is assume that this is a legitimate
    > question. Given that assumption, then the only reasonable conclusion is
    > that it's a clueless question that indicates a clueless interviewer,
    > futher indicating a clueless organization.


    The best he or she can do is *ask*.

    > Like I said, get up and leave. Whether it's a dumb question or a trap
    > doesn't matter.


    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Mar 11, 2010
    #11
  12. Seebs

    Default User Guest

    Keith Thompson wrote:

    > "Default User" <> writes:


    > > That's true, but irrelevant. The requirements in a real job should
    > > not be a deliberate trap to see what the reaction will be.

    >
    > That doesn't answer the question. Being able to respond reasonably
    > to unreasonable requirements is a valuable skill. How do you test
    > that in the course of an interview?


    There's no indication that it's supposed to be an unreasonable
    requirement. If you think it is, and the interviewer thinks it's just
    dandy, then you fail anyway.

    > And I wouldn't say this is necessarily a trap. If I were an
    > interviewer, I'd give the applicant some credit for giving a
    > reasonably good answer that conforms to the requirements. I'd give
    > even more credit for pointing out the problem with the requirements.


    The evidence at hand is that the interviewer is incompetent. You have
    to assume a trap to come around to a competent interviewer. So either
    it's a trap or the interviewer is unqualified to interview. Either way,
    I'm out of there.



    Brian


    --
    Day 401 of the "no grouchy usenet posts" project
     
    Default User, Mar 11, 2010
    #12
  13. On 2010-03-11, Default User <> wrote:
    >
    > The evidence at hand is that the interviewer is incompetent. You have
    > to assume a trap to come around to a competent interviewer. So either
    > it's a trap or the interviewer is unqualified to interview. Either way,
    > I'm out of there.
    >


    I once had an employer ask if I knew Java, and the correct
    answer (which I got) was "no". The company did a lot of
    embedded development and he wanted to make sure I could
    manage memory (or at least knew I was supposed to).

    --
    Andrew Poelstra
    http://www.wpsoftware.net/andrew
     
    Andrew Poelstra, Mar 11, 2010
    #13
  14. "Default User" <> writes:
    > Keith Thompson wrote:
    >> "Default User" <> writes:
    >> > That's true, but irrelevant. The requirements in a real job should
    >> > not be a deliberate trap to see what the reaction will be.

    >>
    >> That doesn't answer the question. Being able to respond reasonably
    >> to unreasonable requirements is a valuable skill. How do you test
    >> that in the course of an interview?

    >
    > There's no indication that it's supposed to be an unreasonable
    > requirement.


    I agree that, based on the limited information we have so far,
    it's likely that the interviewer's question was bad, but not
    deliberately so. To put it more harshly, the interviewer thought
    it was a good question, but only because he was incompetent.

    > If you think it is, and the interviewer thinks it's just
    > dandy, then you fail anyway.


    If I'm right and the interviewer is wrong, and I'm unable to convince
    him of that, then yes, I lose. There's not much to be done about
    that (unless you're willing to lie and tell the interviewer what
    he wants to hear; I'm not).

    >> And I wouldn't say this is necessarily a trap. If I were an
    >> interviewer, I'd give the applicant some credit for giving a
    >> reasonably good answer that conforms to the requirements. I'd give
    >> even more credit for pointing out the problem with the requirements.

    >
    > The evidence at hand is that the interviewer is incompetent. You have
    > to assume a trap to come around to a competent interviewer. So either
    > it's a trap or the interviewer is unqualified to interview. Either way,
    > I'm out of there.


    Let's forget about this particular question for a moment.

    In the real world, the ability to recognize bad requirements (and
    to bring them to the attention of whoever generated them with
    the goal of fixing them) is a valuable skill for a programmer.
    You're typically not going to be asked to judge the quality of the
    requirements; it's going to require some initiative. If you were
    an interviewer, how would you test candidates for this ability?

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Mar 11, 2010
    #14
  15. Seebs

    Default User Guest

    Keith Thompson wrote:


    > Let's forget about this particular question for a moment.
    >
    > In the real world, the ability to recognize bad requirements (and
    > to bring them to the attention of whoever generated them with
    > the goal of fixing them) is a valuable skill for a programmer.


    Yes, but that normally consists of getting with the architech and the
    requirements writer(s) and going over concerns.

    > You're typically not going to be asked to judge the quality of the
    > requirements; it's going to require some initiative. If you were
    > an interviewer, how would you test candidates for this ability?


    You'd present a list of requirements, and ask what the sort of
    evaluation the programmer would do prior to starting the job. Ask for
    any concerns with the requirements as shown and explanations of why
    there would be a concern.

    If you want to test something, test it. Don't hide it in another test.




    Brian

    --
    Day 401 of the "no grouchy usenet posts" project
     
    Default User, Mar 11, 2010
    #15
    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:
    691
    John Timney \(Microsoft MVP\)
    Oct 23, 2004
  2. Digital Puer
    Replies:
    17
    Views:
    4,231
    Andrew Thompson
    Dec 27, 2003
  3. Jerry

    An interview question

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

Share This Page