Thread: Tricky C question asked in an interiew - display name?

  1. #16
    Registered User
    Join Date
    Sep 2006
    Quote Originally Posted by JennyG View Post
    How to display name on screen with a C program without using printf,puts,putch,cprintf,sprintf ?

    fwrite (and I assume fprintf, should be included in the above list).
    Any suggestion/solution ?

    - Jenny
    OK, so we have (these require the OS to support them, of course).

    1) use inline assembly code
    2) use graphics mode, and draw out the name.
    3) use a graphics library
    4) poke directly into video memory, as you could with DOS
    5) use an API to write it out
    6) use a system call, to do it.

    And my idea's:

    6) call a bat file, and have it print out the name
    7) use pipes, to output it >
    8) use ASCII style art, to write out the letters (letters would be larger than normal char's, but readable.

    Seems like a pretty resourceful list, in total.

  2. #17
    Registered User
    Join Date
    Mar 2010
    Quote Originally Posted by phantomotap View Post
    If an interviewee can't read documentation/requirements the ability to resolve a "trick question" is meaningless.
    I think it's a good question, but I have to agree with you on the 'trick question' thing. Likewise questions requiring you to have memorised specific detailed facts (the kind of thing you should just look up).

    Quote Originally Posted by phantomotap
    If an interviewee can't read documentation/requirements the ability to resolve a "trick question" is meaningless.
    Fine if you have usable requirements available to read! I've had requirements (musings! whims!) come to me that were vaguer than that interview question. Some, you can kinda of figure out what was probably going through some marketing chaps head. Some you really can't, and need to round people up and get clarifications. It's important to know when you haven't got the information you need, rather than blundering along regardless. Unfortunately I learned that the hard way.

    I'd imagine there was probably more context to the interview than we're getting, anyways. But I like it without the context!

  3. #18
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    That is the point of such questions, Soma.

    Applying what you do know to areas you do not understand has nothing to do with resolving a "trick question".

    I've never been in a situation as a programmer where resolving a "trick question" has been useful. Neither have you.

    Being capable of independent research is useful. Being capable of asking for and processing requirements is useful. This question can not gauge such abilities. It only gauges the ability to recognize a "trick question". Sure, if the candidate recognizes a "trick question" they may also have the capacity to give one of innumerable "correct" answers, but if they don't recognize a "trick question" you've not learned "how they approach a new problem that is outside their experience" or "how they handle deficient or ambiguous requirements". You've learned exactly one thing: they suck with "trick questions".

    Actually, you can prove this to yourself based on your own experience as an interviewer if you really have done a lot of interviewing.

    How many times have you asked "trick questions" of any sort where upon receiving the answer you immediately had to ask leading/related questions to understand why a given answer was offered?

    Let's look back at this question; the answer "I'd use a different library interface." doesn't tell you anything about my abilities because if you understand the nature of the "trick" that answer is obvious. (Look at what Salem said.) You must, to judge anything, follow up with "Why would you use a different library interface?". Unfortunately, the answer "Because you told me I could not use that one." is perfectly valid. You've put yourself into a position where you have to ask more and more leading/related questions in order to get the interviewer to a point where you can probe his abilities because so far you've learned nothing of value.

    Why waste time with "trick questions" which don't tell you anything when you can just start with questions that actually gauge an individuals understanding of development? Why start with "How to display name on screen with a C program without using standard IO routines?" when you can start with "Here is the documentation for a system level IO API; write me a copy of `puts'."?

    This is exactly like "How do you get an elephant in a refrigerator?" question. It doesn't judge readiness; it doesn't judge "thinking outside the box". It judges the candidates familiarity with "trick questions". "Well, I'd cut the elephant into small pieces." perfectly answers the question. "I'd just drive the elephant into a very large refrigerator." perfectly answers the question. Neither of these answers gives you, as an interviewer, insight into my abilities as a programmer.

    Give a candidate a list of requirements and ask for a criticism of the document; such an approach bypasses this "trick question" crap which means that it actually has a reasonable chance to gauge the development abilities of a candidate.

    Would you want a candidate who would not bother to question or clarify these requirements?
    I forgot to answer this; I'd want Subsonics. His answer doesn't seem to satisfy you because you think this question gauges readiness through the ability to recognize a lack of specificity and gather requirements. (It doesn't; it is a bad "trick question" with infinitely many interpretations and valid answers.) I think his answer is perfect; it solves the requirements as stated with very little effort and shows a level of familiarity with the C standard library.

    But the selection of candidate here is meaningless. I wouldn't ask this question.

    I've had requirements come to me that were vaguer than that interview question.
    And exactly how this is a bad interview question, those are bad requirements.

    Last edited by phantomotap; 09-09-2012 at 12:11 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A tricky(maybe simple) question
    By wayne08 in forum C++ Programming
    Replies: 9
    Last Post: 04-20-2010, 09:35 AM
  2. Tricky C Question
    By ganesh bala in forum C Programming
    Replies: 11
    Last Post: 01-28-2009, 12:58 PM
  3. prolog question; Can they be asked?
    By Unregistered in forum A Brief History of
    Replies: 15
    Last Post: 02-28-2002, 12:09 AM
  4. Replies: 1
    Last Post: 11-01-2001, 05:59 PM
  5. A question asked a million times, but where do I start?
    By Unregistered in forum Game Programming
    Replies: 10
    Last Post: 09-09-2001, 09:15 AM