You Get What You Ask For

  • Awesome Interviewer 2007-07-30 15:08
    If I could comment first I would locate the comments form and enter some text. I would consult with google concerning the need for captchas. Then I would probably fill that out with "cognac" and press the submit button after locating it.
  • Anonymoose 2007-07-30 15:09
    Seriously, you posted a word document? That's a pretty big WTF right there.
  • TheRubyWarlock 2007-07-30 15:14
    The REAL WTF is that some idiot actually believes in using technical "tests" to weed out candidates. The correct answer IS to look it up.
  • dmitriy 2007-07-30 15:16
    I read the second question in the Word document, and my guess is that the answer involves subqueries and joins. I'm not sure a single query is the best way to approach the problem, though.
  • rycamor 2007-07-30 15:18
    This is the best laugh I have had all week.

    Note: Based on my understanding, the purpose of these low-level programming questions is to draw out the participant’s knowledge and usage of reference materials and web knowledge-base searches to derive the answers, demonstrating his approach and thought process. My role as IT Architect for the past 8.5+ years has been to focus on the bigger picture and higher-level architect and design issues that solve specific business problems, so I don’t know the answers to these specific programming questions off-hand (and don’t want to give the impression that I do by going through the actual exercise of copying something off the web, which is done easily enough).

    What does our IT Architect consider low-level? Representing a tree in a SQL database, joining two tables in a query, and working with elements in a set. Gotta love it.
  • Anonym 2007-07-30 15:20
    I cant remember if i ever replied here but i'd like to express my opinion on the general lack of quality of thedailywtf.

    a) Grammar - sorry im not a native english speaker but i believe Alex is - there are so many spelling errors and mistakes even i could make out in this article.

    b) Word Document - nothing to add here - this is just being lazy

    c) The third entry about Lee Burch’s candidate. Seriously compare what is written in the word document with the excerpt given in the article. You make the guy look bad for no reason - he acknowledges that he is not a programmer but IT Architect (which i would translate in Project Manager) and to his best knowledge he also said that he could simply copy & paste answers to these simply question by using google (which is easy) but prefered to do not. He even explained why he gave links to possible solutions.
    Furthermore judging by the test questions at Lee Burchs company i really got to say that they are looking for a 1 or 2 season IT programming student. If i would judge candidates by these test (i.e. they passed it) i still wouldnt know if they are any good.
  • Srdjan 2007-07-30 15:21
    I don't see what is so wrong with the responses for number 3, unless the applicant is applying for a position that is lower than IT Architect. If so, then he is an idiot. However, if he's applying for an IT Architect or better position, then the recruiter/HR person is an idiot for sending him those questions. Like the applicant and a poster here said, the answer is "Look it up".
  • FredSaw 2007-07-30 15:21
    At least he's only going to have to write one complicatedstoredprocedure.
  • BillWaite 2007-07-30 15:29
    I agree that when you don't know how to do something, looking it up is the right thing to do. The problem is that the guy was too lazy to actually look it up and solve the problems. The interviewer only wanted him to solve 3 problems, which shouldn't be a big deal, but he decided instead to spend 5 minutes writing what basically boiled down to, "I bet I could solve those problems if I really wanted to put in the effort. But I don't, so I'll just tell you that I could probably solve them."
  • Patrick 2007-07-30 15:33
    Of course, besides hitting Google, I would consult with my developers/DBA, colleagues, and internal knowledge databases to see if there’s a more specific best-practice solution.


    Stands on the shoulders of his peers...check! Give that man the Senior Architect position!
  • dubbreak 2007-07-30 15:36
    BillWaite:
    I agree that when you don't know how to do something, looking it up is the right thing to do. The problem is that the guy was too lazy to actually look it up and solve the problems. The interviewer only wanted him to solve 3 problems, which shouldn't be a big deal, but he decided instead to spend 5 minutes writing what basically boiled down to, "I bet I could solve those problems if I really wanted to put in the effort. But I don't, so I'll just tell you that I could probably solve them."


    Reminds me of a commercial I saw recently..
    interviewer: "There are 10 people that really want this job. What are you willing to do to get it?"

    interviewee: "..." (picks up resume, covers mouth while he yawns then shrugs)
  • Ryan 2007-07-30 15:38
    The correct answer IS to look it up.


    If you have to look up how to do an SQL join, then you have no business coding anything.
  • ThePants999 2007-07-30 15:39
    I'm not impressed with this "worst response he's ever seen". The article did not summarize the document at all well, and although the architect in question probably should have known more than he did, I thought it was a good response from someone in his position.
  • BillWaite 2007-07-30 15:45
    Ryan:
    The correct answer IS to look it up.

    If you have to look up how to do an SQL join, then you have no business coding anything.


    Actually, Question 2 really had nothing at all to do with a SQL join. In fact, though the schema for two tables is shown, you can solve the problem using only ONE table. Alex's question summaries/titles are blatantly retarded (though I still maintain that the guy is too lazy to be a good candidate).
  • Crabs 2007-07-30 15:50
    I had to look up how to do an SQL join. Some of us don't use databases on a daily basis.

    This is not to say that it's not ridiculously easy. But there's no shame in looking something up.

    Hell, I've looked up "hello world", just so I could figure out what the hell I was doing in a new language.
  • wikipantia 2007-07-30 15:53
    Anonym:

    b) Word Document - nothing to add here - this is just being lazy


    At least the original author stripped the metadata, leaving only Alex's information from the last save. Could be worse.
  • snoofle 2007-07-30 15:55
    I gotta say, if someone gave me questions like that, and they were irrelevant to the job for which I was applying, I'd assume they were idiots and walk out. If they were relevant, but I still couldn't answer them, I'd make a mental note to bone up on those skills, and politely end the interview so as not to waste my/their time. If the questions were sensible and relevant, I'd wonder why the other person needed to ask them, and their response would determine if I let the interview proceed further.

    As far as the response given by this candidate that he'd look it up, I think I would have shortened it to:

    "I'd get one of my developers to do it; I am (applying for a position as) a manager/Architect!"
  • anon 2007-07-30 15:56
    Ryan:
    The correct answer IS to look it up.


    If you have to look up how to do an SQL join, then you have no business coding anything.


    And if you have to look up any of these things, you have no business being an architect in an environment using Relational DBs and OO programming. Saying those things are beneath an architect is like saying knowing how to add is beneath a chip designer- he might not do it everyday, but he can do it.
    Maybe that guy could be an architect, in a different environment. My guess is no.
  • Davis 2007-07-30 15:56
    Can whoever takes these screen shots, please turn off their damn ClearType (a.k.a. MSFuzzyType) settings!

    Damn thats a hard image to read! Just what I need to see when trying to read black text on a white background.. a bunch of rainbow-looks-like-an-anti-aliased-jpeg garbage image.

    I love the daily WTF, but that image is horrible, where are those damn goggles...
  • snoofle 2007-07-30 15:57
    BillWaite:
    Ryan:
    The correct answer IS to look it up.

    If you have to look up how to do an SQL join, then you have no business coding anything.


    Actually, Question 2 really had nothing at all to do with a SQL join. In fact, though the schema for two tables is shown, you can solve the problem using only ONE table....

    For the non-db developers among us, how might one do that?
  • BillWaite 2007-07-30 16:04
    snoofle:
    BillWaite:
    Ryan:
    The correct answer IS to look it up.

    If you have to look up how to do an SQL join, then you have no business coding anything.


    Actually, Question 2 really had nothing at all to do with a SQL join. In fact, though the schema for two tables is shown, you can solve the problem using only ONE table....

    For the non-db developers among us, how might one do that?


    The sample output shows they only want Course Number and Instructor, both of which are columns in the Instructors table. No information from the Courses table is needed. But as for how to do it, I don't know; I would have to look it up.
  • Sharkie 2007-07-30 16:05
    With the general quality of coders in the employment pool, I'd be absolutely thrilled to find one that would actually perform web searches to locate solutions, as well as work with internal resources towards the best solution.

  • James 2007-07-30 16:05
    Not sure I'd count this guy out so fast. Remember, Laziness is a Virtue. I'm having trouble finding the named 'axiom', but I'm pretty sure Rule #1 is "Never write it if somebody else has done it for you", and Rule #2 is "If you look hard enough, somebody has already done it."

    Anyway, without the context of what job he was applying for, we don't know if his answers were a WTF or not. I've applied for jobs before where they ask questions that lay outside the skillset in the advert, so if I didn't know SQL (I'm actually pretty bad at it), and applied to a position for a .NET developer (with no mention of SQL), I imagine my answers would be similar to this guy's if a SQL question came up during the interview. It's slightly more intelligent than "Uh, I'm not really familiar with SQL, so I don't know."
  • nightkhaos 2007-07-30 16:06
    I have seen many occasions where someone has failed an exam or job application just because they did not answer the question that was asked I think it is kinda sad that some people can look at a question and see something completely different to what is written on the page.
  • jtl 2007-07-30 16:14
    2+2=

    Here I would just ask my daddy for the answer, or use my calculator.
  • htg 2007-07-30 16:22
    I think I would have looked at the answers, agreed that the approach was sensible, and then not hire the guy because he actually didn't do it - unless the other candidates were worse. Hey, I asked you some questions, so damn well answer them. I let you do them in your spare time at home because I expect you to use Google anyway.

    Hell, I can't write a simple file loader on some days if I haven't done I/O for a while, and need to look up the code online. APIs are massive and tests that are API centred can be quite useless except for specific required knowledge, demonstrate to me that you know what to search for, that you won't reinvent the wheel without good reason, and that you can do it quickly, efficiently and with some decent comments/documentation. Indeed thought process can be a valid form of documenting something when you are explaining why you chose to do something in a particular way.

    My view of the role of architect, because that is my job title, is that you do the important stuff as well as the high level stuff. The database schema is extremely important so you want to be involved with that, but the code to interface with it? Well I'd write some code so that the minions can use it as a basis for their code if they haven't done it before. Network code as well, unless you have an experienced minion you can trust. But do I want to code piles of business logic? Nope.
  • JS 2007-07-30 16:23
    Wow, that guy must be some kind of wizard, summoning a fantastic oracle known as "Google" to find his answers.

    But seriously, I agree with him that Question 3 doesn't make sense.
  • Strilanc 2007-07-30 16:23
    There's nothing wrong with looking up answers. But he didn't do that, he just said he would look them up. If you're so good at searching, why don't you do a search and give me the answer?
  • snoofle 2007-07-30 16:27
    BillWaite:
    snoofle:
    BillWaite:
    Ryan:
    The correct answer IS to look it up.

    If you have to look up how to do an SQL join, then you have no business coding anything.


    Actually, Question 2 really had nothing at all to do with a SQL join. In fact, though the schema for two tables is shown, you can solve the problem using only ONE table....

    For the non-db developers among us, how might one do that?


    The sample output shows they only want Course Number and Instructor, both of which are columns in the Instructors table. No information from the Courses table is needed. But as for how to do it, I don't know; I would have to look it up.

    Actually, the attachment shows they wanted course name and instructor, which definitely requires a join.
    I'm guessing some sort of case-statement as part of the select-clause is the way to go, but that's waaay out of my experience with sql...
  • Zygo 2007-07-30 16:29
    BillWaite:
    snoofle:
    BillWaite:
    Ryan:
    The correct answer IS to look it up.

    If you have to look up how to do an SQL join, then you have no business coding anything.


    Actually, Question 2 really had nothing at all to do with a SQL join. In fact, though the schema for two tables is shown, you can solve the problem using only ONE table....

    For the non-db developers among us, how might one do that?


    The sample output shows they only want Course Number and Instructor, both of which are columns in the Instructors table. No information from the Courses table is needed. But as for how to do it, I don't know; I would have to look it up.



    SELECT CourseNo,
    CASE WHEN cnt <= 2 THEN i1 ELSE 'Comittee' END AS Instructor1,
    CASE WHEN cnt = 2 THEN i2 ELSE NULL END AS Instructor2
    FROM (
    SELECT CourseNo, MIN(Instructor) AS i1, MAX(Instructor) AS i2, COUNT(*) as cnt
    FROM "Course Instructors" GROUP BY CourseNo
    ) AS q ORDER BY CourseNo;


    If there are 43 gazillion instructors teaching a single course, then maybe the COUNT(*) is too slow and should be replaced by a subquery that uses EXISTS and/or whatever extension syntax this particular database uses to implement offsets and limits. But as for how to do it, I don't know; I would have to look it up.

    As far as I know, no SQL book I've ever read contains a trivial answer to this specific question (i.e. some kind of mental process approximating "thought" is required). Then again, no SQL book I've ever read has said that I can ever use COUNT in a WHERE clause either. Maybe I'm just reading the wrong SQL books.
  • SomeCoder 2007-07-30 16:34
    Zygo:
    BillWaite:
    snoofle:
    BillWaite:
    Ryan:
    The correct answer IS to look it up.

    If you have to look up how to do an SQL join, then you have no business coding anything.


    Actually, Question 2 really had nothing at all to do with a SQL join. In fact, though the schema for two tables is shown, you can solve the problem using only ONE table....

    For the non-db developers among us, how might one do that?


    The sample output shows they only want Course Number and Instructor, both of which are columns in the Instructors table. No information from the Courses table is needed. But as for how to do it, I don't know; I would have to look it up.



    SELECT CourseNo,
    CASE WHEN cnt <= 2 THEN i1 ELSE 'Comittee' END AS Instructor1,
    CASE WHEN cnt = 2 THEN i2 ELSE NULL END AS Instructor2
    FROM (
    SELECT CourseNo, MIN(Instructor) AS i1, MAX(Instructor) AS i2, COUNT(*) as cnt
    FROM "Course Instructors" GROUP BY CourseNo
    ) AS q ORDER BY CourseNo;


    If there are 43 gazillion instructors teaching a single course, then maybe the COUNT(*) is too slow and should be replaced by a subquery that uses EXISTS and/or whatever extension syntax this particular database uses to implement offsets and limits. But as for how to do it, I don't know; I would have to look it up.

    As far as I know, no SQL book I've ever read contains a trivial answer to this specific question (i.e. some kind of mental process approximating "thought" is required). Then again, no SQL book I've ever read has said that I can ever use COUNT in a WHERE clause either. Maybe I'm just reading the wrong SQL books.



    Yeah, that looks about right.

    I deal with SQL fairly regularly and I'd have to look something like that up. Granted, I'm no DBA and I don't have to do terribly complicated things but case statements are way beyond "trivial" and wouldn't be something I would expect a regular programmer to know off the top of his head.

    A DBA on the other hand... yes, they probably should be able to write that statement in their sleep.
  • shambo 2007-07-30 16:41
    I received that same transit SQL job posting. I even asked a DBA friend of mine if that was something new. :)
  • pm 2007-07-30 16:42
    the only operation you can do on a hashset that comes close is the boolean contains test. THis does not locate an object (as the guy points out)

    I assume that the question wants you to recreate the original hash code by jiggling around some string and integer values somehow. IS that behaviour 100% portable; do I have to create a custom hashcode overload. Why would I want to do this anyway; its sounds like I acually want a map

    I would certainly interview the guy hw was willing to say precisle what he was thinking and showed that he can find things out.

    I wouldnt apply for the job having seen this test though

    Now if you reallly want to hear of a bad interview / test. I asked a guy to do a coding test in a live interview; he stood up, said ' i dont have thim for this kind of b*llsh*t' and left
  • Strider 2007-07-30 16:47
    snoofle:
    BillWaite:
    snoofle:
    BillWaite:
    Ryan:
    The correct answer IS to look it up.

    If you have to look up how to do an SQL join, then you have no business coding anything.


    Actually, Question 2 really had nothing at all to do with a SQL join. In fact, though the schema for two tables is shown, you can solve the problem using only ONE table....

    For the non-db developers among us, how might one do that?


    The sample output shows they only want Course Number and Instructor, both of which are columns in the Instructors table. No information from the Courses table is needed. But as for how to do it, I don't know; I would have to look it up.

    Actually, the attachment shows they wanted course name and instructor, which definitely requires a join.
    I'm guessing some sort of case-statement as part of the select-clause is the way to go, but that's waaay out of my experience with sql...


    "Create a query which will print the all the courses "

    so...actually, you only need the instructor table because it just asks for courses, didnt ask for course names, and the sample output is courseNo...

    i would probably do something to the effect of

    SELECT DISTINCT COURSENO,
    IF(SUB1.COUTNO > 2) THEN 'Comittee'
    ELSE IF (SUB1.COUNTO < 1) THEN NULL
    ELSE SUB2.INSTRUCTOR AS INSTRUCTOR1
    END
    END
    IF (SUB1.COUNTNO == 2) THEN SUB3.INSTRUCTOR AS INSTRUCTOR2
    END
    FROM
    COURSE_INSTRUCTORS INNER JOIN
    (SELECT COURSENO, COUNT(*) AS COUNTNO FROM COURSE_INSTRUCTORS GROUP BY COURSENO) AS SUB1
    ON COURSE_INSTRUCTORS.COURSENO = SUB1.COURSENO
    INNER JOIN
    (SELECT * FROM COURSE_INSTRUCTORS LIMIT 1) AS SUB2
    ON COURSE_INSTRUCTORS.COURSENO = SUB2.COURSENO
    (SELECT * FROM COURSE_INSTRUCTORS LIMIT 1,1) AS SUB3
    ON COURSE_INSTRUCTORS.COURSENO = SUB1.COURSENO


    Of course, I think I might have just mixed a couple of different SQL languages there, but you get the general idea. the only thing you might have a question about is LIMIT 1, 1 skips the first 1 and gives only 1 more (i.e. the second row)...
    Heck, I'd be suprised if this compiles, but...thats what debugging is for.

  • jan 2007-07-30 16:49
    u wannt to say question 2 is as easy a using a join?

    ud have to use a rather complicated case construct or multiple subqueries, which sucks. im sure the least of you could solve that task "off hand". i couldnt
  • Shinobu 2007-07-30 16:50
    Davis:
    Damn thats a hard image to read!
    a) You're grossly exaggerating.
    b) Turning off ClearType is work and actually makes it look worse on most displays.
  • Jimmy 2007-07-30 16:55
    FredSaw:
    At least he's only going to have to write one complicatedstoredprocedure.


    Watch out! It's one hell of a procedure.

    The Stored ÜberProcedure
  • Zygo 2007-07-30 16:56
    Admittedly my Java-Fu is all grasshopperish, but I don't really get question #3 either.

    AFAICT there's no method on HashSet named contains that accepts an Object and returns an Object from the HashSet. There are a number of methods inherited from various places with similar names to contains (contains, containsKey, containsValue...) which all return bool, and there's a method named get that does take an Object and return a similar Object from the hash table (using Object's hashCode method, presumably).

    If you just want to know if the object is in the HashSet, that should be trivial: just construct an object identical to the one that was inserted, and fire it into contains(). Someone, somewhere, in the implementation must "locate the original Object" in order to determine whether contains() returns true. There's no explicit requirement to do anything else with the object (e.g. return a reference to it), so in theory all the question requires is a check that contains returned true (although it could be written much more clearly).

    Why would you want to do this? Why, to see if some new object is identical to any object inserted before. Duh. Any architect knows that...
  • FredSaw 2007-07-30 16:57
    James:
    Anyway, without the context of what job he was applying for, we don't know if his answers were a WTF or not.
    Quoting the test:
    "Create a query which will...". Not "How would you create"; just "Create".
    "Write a java program that...". Not "How would you write"; just "Write".

    The questions were not hypothetical.
  • Jerim 2007-07-30 17:03
    I like your explanation. I was starting to wonder if the interviewer was just being extremely demanding. But I can see your point. Given that he was sent the questionnaire and had time to complete it properly, he should have researched the answers. However, I would maintain that if you are sitting in an office, face to face with someone; I don't see where his answers should initially sink his chances.
  • Mario 2007-07-30 17:05
    The answer for Q1 should contain a note about the number of parents. You could assume one parent per child, but it may be more than one. Remember, reader, you have 2 parents!
  • Jerim 2007-07-30 17:09
    I am no DB Admin, but it seems that you would have difficulty creating a conditional query. There are three possible combinations, and the query would have to identify which one it is and act accordingly. Not sure if there is a query language that can do IFs. As for the Java program, I don't like it when a person's hands are tied. It wasn't just "write a program" it was "write a program that solves X using method Y." That is too specific, and seems like they wanted a coding monkey that would just type what he is told.
  • Frank 2007-07-30 17:09
    @ 2007-07-30 16:42 • by pm

    #contains() locates an object in the sense that you know whether or not it's in the set. Useful.

    You assume too much. You receive the spec, and if the spec is not specific, you code generically. What if, say, they want a Month class, with a separate instance for different languages? Bad idea, sure, but not inconceivable. And then, a map would be useful. What would be the key? The number of the month is duplicated, the name *may* be. What if more information to be stored is forthcoming?

    Besides, this guy missed an incredibly obvious fact: You do not need the original object, you need to recreate an object that *equates* to the original object. In Java, with HashSets, that means overriding the #equals(Object) method and the #hashCode() method. That's elementary Java knowledge, and any Java programmer should know this. Many don't, and it is the purpose of the test to weed those out.
  • cavemanf16 2007-07-30 17:11
    TheRubyWarlock:
    The REAL WTF is that some idiot actually believes in using technical "tests" to weed out candidates. The correct answer IS to look it up.


    And yet, the "test" weeded out an obviously clueless candidate. Hmmm... interesting how that works.
  • zip 2007-07-30 17:14
    Did anyone here actually read that word document? The questions (espcially #3) are <i>horribly</i> written. If this wasn't because of anonymization (and I don't see why this would need to be anonymized) then I'd say the real WTF is him writing 2 pages of BS when he should've told them to shove it as soon as he saw how badly their standard "test" was written.
  • unklegwar 2007-07-30 17:17
    The funny thing (to me) is that the readability of that first entry is on par with the readability of many TDWTF articles.

    Spelling? For the weak.
    Missing a verb or three? Inconsequential.

    Stones. Glass houses. Etc etc etc.
  • Jon W 2007-07-30 17:20
    Yeah, question 3 really doesn't make sense. What they probably meant to say was "...and tests that the original object is in the set, not using the original object as an argument."
    In that case, it shows that you know you have to override equals() when you override hashCode() (and vice versa). And that you have to override hashCode() when you want your hash to be data dependent.

    Question 2 was NOT trivial -- props to Z for the elegant solution. I totally had to look that up.

    Being lazy enough that you don't get down to writing and testing the answers, though, is not a good indication in a presumptive candidate. I would write "I assume that, as an IT architect, I will mostly spend time going to vendor marketing lunches, but to show I'm rooted in the trenches, here are my solutions" or something like that :-)
  • Zygo 2007-07-30 17:20
    "Create a query which will print the all the courses"

    When reading this I get visions of reams of paper coming out, as the entire course (including all lecture notes, textbooks, answer guides...) comes flying out of one of those high-volume campus-sized laser printers, all because someone wanted "all the courses" printed.

    I also notice the question doesn't specify what happens when zero instructors are teaching a course. Inevitably there will be many attempts to implement answers here. It will be interesting to see how many cope with that case.

    My first one doesn't--guess I need a left join after all:


    SELECT CourseNo,
    CASE WHEN cnt <= 2 THEN i1 ELSE 'Comittee' END AS Instructor1,
    CASE WHEN cnt = 2 THEN i2 ELSE NULL END AS Instructor2
    FROM (
    SELECT CourseNo, MIN(Instructor) AS i1, MAX(Instructor) AS i2, COUNT(*) as cnt
    FROM "Course Instructors" LEFT JOIN "Courses" USING (CourseNo) GROUP BY CourseNo
    ) AS q ORDER BY CourseNo;
  • Zygo 2007-07-30 17:22
    Mario:
    The answer for Q1 should contain a note about the number of parents. You could assume one parent per child, but it may be more than one. Remember, reader, you have 2 parents!


    Then it's not a tree any more. A tree where nodes have multiple parents is called a directed acyclic graph (DAG).
  • Zygo 2007-07-30 17:32
    Zygo:

    FROM "Course Instructors" LEFT JOIN "Courses" USING (CourseNo) GROUP BY CourseNo


    I of course meant

    FROM "Courses" LEFT JOIN "Course Instructors" USING (CourseNo) GROUP BY CourseNo

    although instructors who teach courses that don't exist is yet another interesting case that has no specified outcome in the test question.

    The more the text of the question is analyzed, the more it falls apart. One could literally interpret "print the all the courses and if one instructor ... display ... if two instructors ... print ... if more than two instructors ... display ..." according to strict Boolean logic and end up with two printouts and a pile of text on the screen.
  • Andrew 2007-07-30 17:36
    Anonymoose:
    Seriously, you posted a word document? That's a pretty big WTF right there.


    I would consult OpenOffice to see if can load the file. If that didn't work, I'd remove all non-ASCII characters from the file with Perl and read it.
  • vt_mruhlin 2007-07-30 17:38
    So my DB knowledge is kind of lacking, which hasn't really helped my current job search. For #1 I would create a table that has 3 columns:
    ID - A unique ID for this node
    Parent - The ID for this node's parent
    Data - the actual data

    So if I want to find the children of node 1,
    SELECT Data,ID FROM TreeNodes WHERE Parent=1

    But that seems like it might be a pain to traverse the tree. Lots of searching. There a less WTFy way?
  • Zygo 2007-07-30 17:50
    Andrew:
    Anonymoose:
    Seriously, you posted a word document? That's a pretty big WTF right there.


    I would consult OpenOffice to see if can load the file. If that didn't work, I'd remove all non-ASCII characters from the file with Perl and read it.


    I would do a quick Google search on the phrase "download full questions/response". I would then read through and filter out the search results to determine which are relevant and trustworthy to the problem at hand. I would also consult with my developers/DBA, colleagues, and internal knowledge databases to see if there’s a more specific best-practice solution.
  • Friggerock 2007-07-30 17:55
    Of course the questions on the test are confusing. Duplicate conflicting and ambiguous statements are to be expected in a requirements document :P
  • Zygo 2007-07-30 18:07
    Friggerock:
    Of course the questions on the test are confusing. Duplicate conflicting and ambiguous statements are to be expected in a requirements document :P


    HR droid: "The candidate did not attempt to commit murder after reading the questions."
    PH boss: "Tell him he's hired!"
  • Pap 2007-07-30 18:20
    unklegwar:
    The funny thing (to me) is that the readability of that first entry is on par with the readability of many TDWTF articles.

    Spelling? For the weak.
    Missing a verb or three? Inconsequential.

    Stones. Glass houses. Etc etc etc.


    You know what they say, if it spell checks, ship it!
  • Chris 2007-07-30 18:47

    As it turned out, the Candidate’s experience didn’t much beyond English.


    And speaking of which...!
  • Irrelevant 2007-07-30 19:44
    Davis:
    Can whoever takes these screen shots, please turn off their damn ClearType (a.k.a. MSFuzzyType) settings!

    Damn thats a hard image to read! Just what I need to see when trying to read black text on a white background.. a bunch of rainbow-looks-like-an-anti-aliased-jpeg garbage image.

    I love the daily WTF, but that image is horrible, where are those damn goggles...
    Hm... spontaneous jab at Microsoft, complaints about having to read black text on a white background, general whineyness...

    ...guys, I think we've got a Linux Weenie!
  • rsynnott 2007-07-30 19:50
    Irrelevant:
    Davis:
    Can whoever takes these screen shots, please turn off their damn ClearType (a.k.a. MSFuzzyType) settings!

    Damn thats a hard image to read! Just what I need to see when trying to read black text on a white background.. a bunch of rainbow-looks-like-an-anti-aliased-jpeg garbage image.

    I love the daily WTF, but that image is horrible, where are those damn goggles...
    Hm... spontaneous jab at Microsoft, complaints about having to read black text on a white background, general whineyness...

    ...guys, I think we've got a Linux Weenie!


    Improbable; most of the modern antialiasing schemes for X11 look fuzzier even than the impressively fuzzy ClearType; fuzzy is in.
  • drew 2007-07-30 19:56
    did he get the job?
  • Lee 2007-07-30 19:59
    Hey, I live in Cleveland! Oh wait, I live in the UK one :(
  • OutOfToiletPaper 2007-07-30 21:08
    Sorry guys,
    which way to the nearest supermarket?
  • StickyWidget 2007-07-30 21:14
    ATTENTION ALEX!!!

    OK, I'll admit that Question 3 is a little confusing. It's either a REAL simple question, using the solution proposed in post#147417 by Zygo above, or its a trick question involving object oriented design and implementation. I'm pretty damn sure it's a trick question.

    The problem is that object.equals(..) only returns true if the object EXACTLY equals the object in the HashSet (i.e. a.equals(b) iff a IS b). In other words, they have the same memory address, it's a dumbed down pointer comparison. So, simply passing an object with the same values as the original will not work, they are simply different, and will evaluate as such.

    Since this is an object oriented question, I would override the "equals" method of the object, and replace it with something like:


    ...
    return (this.intMember == someIntParameter &&
    this.stringMember.equals(someStringParameter);
    ..


    This would allow any test for equality throughout the entire application to be properly assessed by ANY operation that required a true/false equality test. Game-Set-Match.

    The real WTF is that it took 63+ Comments by people who are supposed to be SME's to finally point this out. Oh, and this guy is a doofus for not actually solving the problems. My professors in college would have written "You did not solve the problem, you receive no credit, and you should really consider a career in management."
  • Isospace 2007-07-30 21:57
    You also need to define a hashCode method
  • Faux News 2007-07-30 22:00
    Anonymoose:
    Seriously, you posted a word document? That's a pretty big WTF right there.

    Yeah, where the hell's my PDF?
  • Stefan W. 2007-07-30 22:38
    An alternative SQL-approach to q2:

    SELECT course, MIN (inst) as i1, ' ' as co from inst GROUP BY course HAVING COUNT (*)= 1 UNION
    SELECT course, MIN (inst) as i1, MAX (inst) as co from inst GROUP BY course HAVING COUNT (*)= 2 UNION
    SELECT course, 'comitee', '' as co from inst GROUP BY course HAVING COUNT (*)> 2 ORDER BY course;

  • Jeremy Weiskotten 2007-07-30 23:04
    Here's how you solve #3 (with a JUnit test for a "program").

    I'm still amazed at how many Java developers simply don't understand equals/hashCode. Read Effective Java already!


    import java.util.HashSet;
    import java.util.Set;

    import junit.framework.TestCase;

    public class HashSetExampleTest extends TestCase {

    private final class Dude {
    private final int age;
    private final String name;

    public Dude(int age, String name) {
    // TODO: Validate that age is > 0
    // TODO: Validate that name is not null or empty
    this.age = age;
    this.name = name;
    }

    public boolean equals(Object obj) {
    if (!(obj instanceof Dude))
    return false;

    Dude otherDude = (Dude)obj;
    // two dudes are equal if they have the same name and age
    return otherDude.age == this.age &&
    otherDude.name.equals(this.name);
    }

    public int hashCode() {
    int hash = 1;
    hash = hash * 31 + this.age;
    hash = hash * 31 + this.name.hashCode();
    return hash;
    }
    }

    private final Set<Dude> dudes = new HashSet<Dude>();

    @Override
    protected void setUp() throws Exception {
    super.setUp();
    dudes.add(new Dude(15, "Joe"));
    dudes.add(new Dude(99, "Fred"));
    }


    public void testContains() {
    assertTrue(dudes.contains(new Dude(15, "Joe")));
    assertTrue(dudes.contains(new Dude(99, "Fred")));
    }

    public void testDoesNotContain() {
    assertFalse(dudes.contains(new Dude(15, "Fred")));
    assertFalse(dudes.contains(new Dude(99, "Joe")));
    }
    }
  • Casey 2007-07-31 03:10
    I had an interview I was doing on the telephone, where after the second technical question the guy stopped us and said "look, these questions are a bit pointless, why don't you tell me what your project is about, and I'll tell you how to implement it" :S

  • Watson 2007-07-31 03:44
    Honestly, the first time I looked at that email shown there I parsed it as saying that they were on a retarded search...
  • Jon W 2007-07-31 04:17
    Dude, you failed. If you override equals(), you have to also override hashCode(). As I pointed out about 20 comments back, btw. And someone else before me.
  • Alan 2007-07-31 04:21
    I wrote a technical test for a c# developer position at my company. It is a simple paper & pen test we give applicants on thier first interview. It only contains questions that shouldn't need google to answer.

    One candidate had a CV which really impressed us, and had everything we were looking for. They scored 1 out of 9 on thier test. For example:

    Q9: Write a C# function that returns true if the input is 0 or greater than 5.

    Applicants answer:

    int a;
    if(a = 0 or >5)
    {
    return(true);
    }
    else
    {
    return(false);
    }


  • Jerome 2007-07-31 04:26
    Alex:
    As it turned out, the Candidate’s experience didn’t much beyond English.


    On the other hand, Alex's experience didn't even that far.
  • vr602 2007-07-31 05:02
    vt_mruhlin:
    So my DB knowledge is kind of lacking, which hasn't really helped my current job search. For #1 I would create a table that has 3 columns:
    ID - A unique ID for this node
    Parent - The ID for this node's parent
    Data - the actual data

    So if I want to find the children of node 1,
    SELECT Data,ID FROM TreeNodes WHERE Parent=1

    But that seems like it might be a pain to traverse the tree. Lots of searching. There a less WTFy way?


    This is the 'normal' way of doing things, and generally acceptable. A less intuitive but more efficient method is to allocate 'left' and 'right' numbers to each node in the tree, starting at the top node, and working round in a circle (check the link and you'll see what I mean). This then makes your queries truly trivial, e.g. to find all children of a node, or all leaf nodes. However, it does involve renumbering some items when you add a new node.

    There's a better explanation out there somewhere, but I can't find a better link than this one; I'm a database expert, not a Google expert.

    http://www.sitepoint.com/article/hierarchical-data-database/2
  • Thief^ 2007-07-31 06:06
    Shinobu:
    Davis:
    Damn thats a hard image to read!
    a) You're grossly exaggerating.
    b) Turning off ClearType is work and actually makes it look worse on most displays.


    Cleartype has to be set up for the kind of monitor you use (RGB or BGR TFT), if an image is captured with one cleartype mode and displayed on the opposite kind of monitor it is INCREDIBLY hard to focus on.

    Someone with a CRT monitor should never enable cleartype (use standard font smoothing instead), as it relies on the way TFTs arrange the colours in their pixels. It is theoretically possible to make a version of cleartype for CRTs, but it hasn't yet been done.
  • anon 2007-07-31 07:07
    Sharkie:
    With the general quality of coders in the employment pool, I'd be absolutely thrilled to find one that would actually perform web searches to locate solutions, as well as work with internal resources towards the best solution.


    Agree. But they aren't looking for a coder, they're looking for an architect.
    An architect is someone who's been around the block, and actually knows stuff- not just a code monkey who decides he's been doing it for a while and deserves a better title. Or worse, a code monkey who's not very good at it, and thinks he must be good at something, and "architecting" is it. (I think our applicant is the second type.)
    OK, I take that back. Most "architects" are just code monkeys who want a better title. Hence, this site exists.
  • Random832 2007-07-31 09:08
    Someone with a CRT monitor should never enable cleartype (use standard font smoothing instead),


    I would, but some idiot decided it should be disabled for normal font sizes with no option to enable it. "standard font smoothing" is disabled between 7 and 13 points, i.e. between 9 and 18 pixels, on windows. Other systems exhibit similar behavior. (Actually, I think it's per-font, since Consolas is smoothed at all sizes, the sizes I listed above were for Arial)

    Cleartype also uses different (better) hinting rules than standard font smoothing. It would be nice if there was a "cleartype gray" (i.e. enable the nicer hinting and smoothing at all sizes, without any subpixel wizardry) setting. Since there's not, cleartype still looks better on CRTs than 'standard', even with the colors.
  • anon 2007-07-31 09:21
    Mario:
    The answer for Q1 should contain a note about the number of parents. You could assume one parent per child, but it may be more than one. Remember, reader, you have 2 parents!


    No one is asking about your family tree.
    In computer science, a tree structure is a directed acyclic graph with indegree 0 or 1.

  • dkf 2007-07-31 09:39
    Thief^:
    It is theoretically possible to make a version of cleartype for CRTs, but it hasn't yet been done.
    It's much more difficult to do, since CRTs tend to distribute their color cells in two dimensions, whereas LCDs put them in a line (so only 1-D error propagation is needed in that case). Given that CRTs are basically on the way out, the effort required to make a cleartype-alike for them is a waste.
  • Corey 2007-07-31 09:45
    zip:
    Did anyone here actually read that word document? The questions (espcially #3) are <i>horribly</i> written. If this wasn't because of anonymization (and I don't see why this would need to be anonymized) then I'd say the real WTF is him writing 2 pages of BS when he should've told them to shove it as soon as he saw how badly their standard "test" was written.


    I dunno... if you weed out all the jobs that have clueless or annyoing HR, I imagine you'll soon get most of your nutrition by raiding discarded pizza boxes for cheese.
  • Edward Royce 2007-07-31 10:05
    Hmmmmm.

    I keep thinking I'll take the time out to get into Java again.

    Is there a decent GUI toolset for Java out there or does it still all suck?

    Captcha "bathe". Uhhh. Darn it! How does it know??

    :)
  • Look at me! I'm on the internets! 2007-07-31 10:08
    StickyWidget:


    The real WTF is that it took 63+ Comments by people who are supposed to be SME's to finally point this out.


    What are you snarking at? Of course you have to override equals. This goes without saying, and is standard practice when creating classes.

    Besides, your code is wrong. You're not overriding equals, you're overloading it.

    The signature for equals is

    public boolean equals(Object other)

    not

    public boolean equals(int someIntParameter, String someStringParameter)


    the proper code would be

    public boolean equals(Object other)
    {
    // wrong type, not equal (could throw exception instead)
    if (! (other instanceof ThisClass)) return false;

    // cast to appropriate type.
    ThisClass _other = (ThisClass)other;


    return (this.intField == _other.intField) && this.stringField.equals(_other.stringField);
    }

    You might be able to eliminate the casting if you use generics, but I'd have to test it out first.

  • Michael 2007-07-31 10:22
    Zygo:


    SELECT CourseNo,
    CASE WHEN cnt <= 2 THEN i1 ELSE 'Comittee' END AS Instructor1,
    CASE WHEN cnt = 2 THEN i2 ELSE NULL END AS Instructor2
    FROM (
    SELECT CourseNo, MIN(Instructor) AS i1, MAX(Instructor) AS i2, COUNT(*) as cnt
    FROM "Course Instructors" GROUP BY CourseNo
    ) AS q ORDER BY CourseNo;


    If there are 43 gazillion instructors teaching a single course, then maybe the COUNT(*) is too slow and should be replaced by a subquery that uses EXISTS and/or whatever extension syntax this particular database uses to implement offsets and limits. But as for how to do it, I don't know; I would have to look it up.


    This should work for MySQL:
    SELECT CourseNo, 
    
    IF(COUNT(Instructor) <= 2, MIN(Instructor), 'Comittee') AS Instructor1,
    IF(COUNT(Instructor) = 2, MAX(Instructor), NULL) AS Instructor2
    FROM Course_Instructors
    GROUP BY CourseNo ORDER BY CourseNo

    Assuming that the Instructor field would never be a non-NULL empty string.
  • Michael 2007-07-31 10:28
    Edward Royce:
    I keep thinking I'll take the time out to get into Java again.

    Is there a decent GUI toolset for Java out there or does it still all suck?
    That depends, by "decent" do you mean small and simple, or powerful and flexible?

    I've been using Swing for years, and it has always been decent, and recently has become much better in terms of native look and feel. Two new specs expected in Java 7 (Application framework and Bean Binding) will further simplify things for developers.
  • Edward Royce 2007-07-31 10:59
    Hmmm.

    Mostly powerful and flexible.

    Last time I did anything with Java, loooooong ago, it was a hassle trying to do UI in AWT and Swing. Has it matured since then?

    Thanks in advance for any info. Right now I'm mostly shifted to C#/ASP.NET but I've been looking at JBoss and really like what I see so I was thinking about hedging my options and making sure I proficient in a non-Microsoft dev package.
  • Rich 2007-07-31 11:07
    People, CASE statements are basic SQL and if you don't know how to use them, you're probably not really using SQL, you're just reading and writing data.

    Rich
  • Rich 2007-07-31 11:10
    vt_mruhlin:

    But that seems like it might be a pain to traverse the tree. Lots of searching. There a less WTFy way?


    No. There are a few cheaty ways and shortcuts but they tend to be more WTFey. With SQL, it really helps if you can limit the depth of the tree.

    Rich
  • bobday 2007-07-31 11:14
    Rich:
    People, CASE statements are basic SQL and if you don't know how to use them, you're probably not really using SQL, you're just reading and writing data.

    Rich

    I don't know about you, but that's what I'm using my database for. I'm not writing SQL for the pure circle-jerkery of it.
  • Rich 2007-07-31 11:20
    bobday:
    Rich:
    People, CASE statements are basic SQL and if you don't know how to use them, you're probably not really using SQL, you're just reading and writing data.

    Rich

    I don't know about you, but that's what I'm using my database for. I'm not writing SQL for the pure circle-jerkery of it.


    Personally, I like to make the most of the relational aspects and the ability of the query optimizers to pre-process certain types of data more efficiently than can be done on the front end code.

    There is nothing wrong in using a database just to read and write data but if that's all you're doing with it, you're not really using SQL.

    Rich
  • Aaron 2007-07-31 11:20
    I can understand why a lot of people don't see how the Architect candidate's answer would be considered so bad. I don't mean this as a knock against anyone but you do have to have a good amount of systems design experience to get it. Allow me to spell it out. This person:

    a) Treated certain complex concepts with no agreed-upon best practices - such as trees in an RDBMS - as trivial code-monkey tasks that a few minutes with Google could solve.

    b) Wasted more time, effort, and words explaining how he'd solve the problems and/or why he didn't need to solve them, than he would have spent actually solving them (assuming he knew what he was doing).

    c) Apparently didn't know SQL. This is completely OK for a programmer, but it's a big no-no for an architect. SQL is ubiquitous, it exists in almost every environment and is a critical part of any business system. DBAs may help to design individual tables, optimize indexes, set up maintenance plans, that sort of thing - but they are not responsible for designing the entire data model top-to-bottom. That is an architect's job.

    d) Criticized the last question and threw his hands up in the air instead of either making reasonable assumptions or asking for clarification. Yes, I know the question was worded badly. Guess what - so are most requirements and functional specs. Resolving the ambiguities and inconsistencies in a fuzzy spec are primarily the job of an architect. They probably didn't intentionally word the question poorly, but even still, this person's reaction reveals terrible business instincts.

    Bottom line: judging by the answers, I can only assume that he's spent the past "8.5+ years" actively avoiding any real work or learning. On the job, he probably gets things done - eventually - but maybe not as well as someone else would, and certainly not without a whole lot of attitude. Pass.
  • Aaron 2007-07-31 11:30
    Rich:
    No. There are a few cheaty ways and shortcuts but they tend to be more WTFey. With SQL, it really helps if you can limit the depth of the tree.

    String sets are reliable and fast, although if you consider triggers to be WTFey (I don't) then I guess the implementation is WTFey. And they do involve a certain depth limit, but the limit is arbitrary and set by the design; one of our databases supports 50 nesting levels (never seen more than 10 used) but you could design a mapping to support hundreds if necessary. Just avoid the recursive trigger and use an iterative one instead.

    SQL Server 2005 also gives you CTEs with recursive queries, which is a far more elegant solution, although of course it's going to be platform-specific.

    Those are certainly not the only ways, just the most well known... most of the ideas aren't cheating or WTFey either, they're covered in off-the-shelf books on data structures and algorithms. They aren't as simple and pretty as the generic parent-child join, but no production system is ever as simple as it's freshman academic equivalent.
  • Anonymous 2007-07-31 11:34
    Davis:
    Can whoever takes these screen shots, please turn off their damn ClearType (a.k.a. MSFuzzyType) settings!

    You and your CRT screen can go to hell!
  • Nelle 2007-07-31 12:30
    Zygo:
    Admittedly my Java-Fu is all grasshopperish, but I don't really get question #3 either.

    AFAICT there's no method on HashSet named contains that accepts an Object and returns an Object from the HashSet. There are a number of methods inherited from various places with similar names to contains (contains, containsKey, containsValue...) which all return bool, and there's a method named get that does take an Object and return a similar Object from the hash table (using Object's hashCode method, presumably).

    If you just want to know if the object is in the HashSet, that should be trivial: just construct an object identical to the one that was inserted, and fire it into contains(). Someone, somewhere, in the implementation must "locate the original Object" in order to determine whether contains() returns true.
    [...]


    I believe the goal was for the applicants to write a custom equals( Object o ) method for the custom object that was to be stored in the hashmap ...

    But I have to agree with the guy, no "contains" method ever returns an Object ...
  • FredSaw 2007-07-31 13:56
    Aaron:
    c) Apparently didn't know SQL. This is completely OK for a programmer
    Since when? I've worked with SQL pretty much daily ever since I started getting paid to write code. Maybe, if you're writing video games...
  • Enric Naval 2007-07-31 14:33
    Zygo:
    "Create a query which will print the all the courses"

    When reading this I get visions of reams of paper coming out, as the entire course (including all lecture notes, textbooks, answer guides...) comes flying out of one of those high-volume campus-sized laser printers, all because someone wanted "all the courses" printed.

    I also notice the question doesn't specify what happens when zero instructors are teaching a course. Inevitably there will be many attempts to implement answers here. It will be interesting to see how many cope with that case.

    My first one doesn't--guess I need a left join after all:


    SELECT CourseNo,
    CASE WHEN cnt <= 2 THEN i1 ELSE 'Comittee' END AS Instructor1,
    CASE WHEN cnt = 2 THEN i2 ELSE NULL END AS Instructor2
    FROM (
    SELECT CourseNo, MIN(Instructor) AS i1, MAX(Instructor) AS i2, COUNT(*) as cnt
    FROM "Course Instructors" LEFT JOIN "Courses" USING (CourseNo) GROUP BY CourseNo
    ) AS q ORDER BY CourseNo;



    You are the first one that gets the whole question right :)

    The other person that also answered made a similar query, but he didn't notice that the question asked for *all* courses to be displayed, and most probably got misled by the fact there the example table had no course with no instructors on it.

    The actual question lacked a word or two (probably lost while being reworded), but I think it's still quite clear.

    "Create a query *which will print the all the courses* and if one instructor is present display their name [their name == the instructor's name]"
  • Enric Naval 2007-07-31 14:53
    StickyWidget:
    ATTENTION ALEX!!!

    OK, I'll admit that Question 3 is a little confusing. It's either a REAL simple question, using the solution proposed in post#147417 by Zygo above, or its a trick question involving object oriented design and implementation. I'm pretty damn sure it's a trick question.

    The problem is that object.equals(..) only returns true if the object EXACTLY equals the object in the HashSet (i.e. a.equals(b) iff a IS b). In other words, they have the same memory address, it's a dumbed down pointer comparison. So, simply passing an object with the same values as the original will not work, they are simply different, and will evaluate as such.

    Since this is an object oriented question, I would override the "equals" method of the object, and replace it with something like:


    ...
    return (this.intMember == someIntParameter &&
    this.stringMember.equals(someStringParameter);
    ..


    This would allow any test for equality throughout the entire application to be properly assessed by ANY operation that required a true/false equality test. Game-Set-Match.

    The real WTF is that it took 63+ Comments by people who are supposed to be SME's to finally point this out. Oh, and this guy is a doofus for not actually solving the problems. My professors in college would have written "You did not solve the problem, you receive no credit, and you should really consider a career in management."

    IsoSpace:

    You also need to define a hashCode method



    Yeah, the HashSet onject will internally create a hashcode of the object passed by parameter, and then it will compare this hashcode to the hashcodes of all objects on the set.

    Hell, that's the *whole point* of using a HashWhatever instead of a List: not having to use the equals() method on all objects on the list.

    And you are right about contains() returning false if it's not the same onject on the same memory location. That's why the "correct" answer is overloading the equals() function so it will return true if the objects are identical, even if they are not on the same memory location :P

    Addendum (2007-07-31 15:00):

    P.D.: damn, and, of course, it would be nice to remember to overload HashCode() too, but the HashCode contract does not require it ^^

    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#hashCode()

    "It is *not* required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables."

    Addendum (2007-07-31 15:03):
    That damned 5 minutes edit limit makes me make mistakes -.-

    You *do* need to overload HashCode too, specially on the circumstances describe by this question.....
  • Jasper Mantooth 2007-07-31 15:48
    Kind of off topic but:

    Why do people constantly bitch about the quality of this site? It takes less effort to hit ctrl-w than it does to click 'Add Comment' and spray your verbal diarrhea. That annoys me more than the 'First!' and 'Captcha' posts...

    PS:
    captcha: alarm -- wake up guyz! har har har! lolz!1
  • aardmoose 2007-07-31 15:51

    The headhunting part of the article reminds me of a dice posting I saw a few years back. They were recruiting for a hardware position, and one of the requirements was familiarity with "scuzzy controllers."
  • akatherder 2007-07-31 15:55
    Oh boy! I can't wait to hire this architect to create high level designs and have no f'ing clue what any of it means!

    Do you want an architect who can BS and give uninformed design decisions... or do you want someone who can demonstrate knowledge of the underlying components he is drawing on the whiteboard?

    My favorite part is his comment about "Hey if you want me to solve this problem I'll just consult my internal knowledge database." No you won't, or you would have already done it.
  • bobday 2007-07-31 16:24
    Rich:

    Personally, I like to make the most of the relational aspects and the ability of the query optimizers to pre-process certain types of data more efficiently than can be done on the front end code.

    There is nothing wrong in using a database just to read and write data but if that's all you're doing with it, you're not really using SQL.

    Rich

    Alright, since you actually made a serious reply, I'll clarify a bit:

    I think I use the relational aspects of SQL, since I have as many left outer joins as the next guy, but I've never found much use for the case statement.

    I don't have any 1-or-2-to-1 relationships (what a headache), so I typically just use the extra query required to get all the data in a many-to-one relationship. Also, I can't do too much fancy processing in database queries since it has a tendency to interfere with localization.
  • gwenhwyfaer 2007-07-31 19:02
    rycamor:
    What does our IT Architect consider low-level?

    At a guess, anything remotely concerned with "implementation". He sounds like the kind of person who believes that people who actually get their hands dirty with real code can't possibly expand their focus out to see the big picture - but are nonetheless always the ones to blame when the design turns out to be a big pile of manure.

    In fact, he sounds rather like this guy...
  • anon 2007-07-31 19:04
    Now I know how to get free coding done ;)
  • gwenhwyfaer 2007-07-31 19:08
    James:
    Not sure I'd count this guy out so fast. Remember, Laziness is a Virtue.

    Generosity is a virtue too, but if someone gives away so much that he can no longer afford to eat, one has to question his ability to look after himself.
  • gwenhwyfaer 2007-07-31 19:14
    Strilanc:
    There's nothing wrong with looking up answers. But he didn't do that, he just said he would look them up. If you're so good at searching, why don't you do a search and give me the answer?

    In fairness, he might have decided that he was going to be totally honest, rather than pretending to know an answer he'd had to look up. And in a face to face setting, his answers would be exactly that.

    The other possibility, of course, is that he decided to write his answer according to his opinion of the questioners. In which case, he has just had very much the last laugh...
  • gwenhwyfaer 2007-07-31 19:28
    OutOfToiletPaper:
    Sorry guys,
    which way to the nearest supermarket?

    Here it is.
  • gwenhwyfaer 2007-07-31 19:40
    anon:
    No one is asking about your family tree.

    I grew up in Norfolk. People don't have family trees there. They have family sticks.
  • Jones 2007-08-01 02:11
    What the WTF? I would rank the answer for first question pretty good, second is admittedly a bit lazy, and third question doesn't make much sense. So, so compared to average responses I would expect for this kind of quiz, I would not say those to be WTF responses. Instead - Word documenent - hey come on!
  • Ren 2007-08-01 05:24
    The questions #2 and #3 are ambiguous enough to make the questionnaire itself a WTF. #2's <i>text</I> says "...print all the courses" and "print 'committee' if more than two". Then the 'suggested output' goes on to print a dynamically extended table. "Confusing? Our best systems designer wrote these questions himself!" Would you take the job? I wouldn't.

    Your objective in #2 is to "create a query which will print out...". With cases. The traditional way for non-wizards would be to make a generalized query, then use another language (say, PHP or Java) to actually sort and print out. And how the hell can you make a SQL (okay, we don't *know* it's SQL) query that "prints out" anything, anyway? In my experience SQL queries just return the data to whatever application that wants it.

    To answer #2 I'd just make a script in a random language (they seem to like Java so pick that). If they complain, just ask THEM to make "a query" that prints out anything. On the spot. If they manage to do that, you'll have at least learned something. If not, you'll get to watch your interviewer squirm. No wait, their usual answer would be "I don't work with that" or "I don't actually write code".

    Moving on to #3. You have to "locate the original object via the contains method on the HashSet". Okay, contains(Object o) as defined in HashSet returns true if o is in the hash. And you're not allowed to use the original object as an argument. The only function you're allowed to use is contain() so just make a new object (coincidentally containing the same information), use that to get 'true'. Bingo, you've found that o is in the hash. Sure, it's retarded, but so is the question.

    That said, I also agree with the view that the candidate should have approached the problem more in the sense of "There are many possible answers, here's one:" instead of "There are many possible answers." In any case, he most certainly deserves an interview. He's honest in admitting that he doesn't have enough experience to create a cased query that (apparently) uses ERQs to print out stuff and he can actually spot inconsistencies in design even when he's not familiar with the methods. How are any of those bad qualities in an interviewee?

    All in all, the original WTF article was totally unfair to the guy. He did his best, was honest and provided the most important answer "If I don't know it, I can look it up". I seriously don't see how he can be qualified as "clueless".
  • Ren 2007-08-01 05:31
    Rethinking #3, let me back up a bit. Yeah, the point *would* be to have some sort of identifier in the object, so that it returns true when a certain *type* of object is passed. It's a tricky question and easily reveals if the candidate has actual experience in either HashSets or general information flow.

    It still doesn't excuse the horror that is #2.
  • FredSaw 2007-08-01 10:21
    gwenhwyfaer:
    In fairness, he might have decided that he was going to be totally honest, rather than pretending to know an answer he'd had to look up. And in a face to face setting, his answers would be exactly that.
    In a face to face setting, he wouldn't have his computer, Google, and several hours/days to do the research and provide an answer. In this situation, he did have those things. They asked for product, not an assurance that product could conceivably be delivered if the deliveryman deemed it important enough to warrant his time and effort.

    gwenhwyfaer:
    The other possibility, of course, is that he decided to write his answer according to his opinion of the questioners. In which case, he has just had very much the last laugh...
    Only if he didn't need or particularly want this job, in which case we're left wondering, "Why even bother to apply, then?"
  • Jeremy Weiskotten 2007-08-01 11:31
    Granted that question #3 could be worded a bit better (such as "determine whether an object is in HashSet without using the same instance that was added to the HashSet") to indicate that perhaps equals (as well as hashCode) should be overridden...

    But how do you excuse the following gem?

    "To actually “locate” (i.e. get the reference pointer) to the object in the HashSet instance, you would need to get its iterator and then iterating through the Iteration."

    WTF???
  • nightkhaos 2007-08-01 13:39
    Eclipse is quite good, but I am not sure if there is a Windows port for it. If only I did more Java coding I would be able to give you more than "it works well for me" and actually tell you some of the useful features. :)
  • gwenhwyfaer 2007-08-01 14:06
    FredSaw:
    In a face to face setting, he wouldn't have his computer, Google, and several hours/days to do the research and provide an answer...

    *sigh* Once again, I'm reminded that if you decide to imply something in a forum, at least one of its members will go on to state it explicitly in terms which make it clear that they think you too stupid to have figured it out yourself...

    It's just not worth trying to have half a conversation online, I swear.
  • StickyWidget 2007-08-01 15:10
    nightkhaos:
    Eclipse is quite good, but I am not sure if there is a Windows port for it. If only I did more Java coding I would be able to give you more than "it works well for me" and actually tell you some of the useful features. :)


    There is a windows port for Eclipse, and it is the best free Java IDE I've ever used. My preference though, when I can afford it, is IntelliJ.

    And yes, I should have overridden hashcode() too. But in my defense, I would never USE a hashSet for storing a simple string and int. Using the equals(..) method would be quick, simple, and would demonstrate the level of familiarity with OOP that a interviewer is trying to ascertain(I hope).

    Also, "override" is the proper terminology. As the intention is to extend Object() to create a String&Int() object, the "contains(Object .. )" method will allow the passing of the String&Int object natively without having to create a special "contains(String&Int ..)". If I had to create a special contains(..), then it would be overloading.

    Besides, contains() is a part of the hashSet class, overriding it would require extending and modifying hashSet, which I think would be against the intention of the question. But to each his own.

    Overloading - multiple methods of the same name, but different input and/or output declarations
    Override - in a new class where an existing class is extended, substitutes the existing method with a new method, while preserving the same input and output declarations.

    Mmmm. Waffles...
  • Mario 2007-08-01 15:14
    anon:
    Mario:
    The answer for Q1 should contain a note about the number of parents. You could assume one parent per child, but it may be more than one. Remember, reader, you have 2 parents!


    No one is asking about your family tree.
    In computer science, a tree structure is a directed acyclic graph with indegree 0 or 1.

    Yes, very good, but who says the writer of the question knows about the difference. Is it theoretically possible (ok, except for the word 'tree' -sheesh) for there to be more than 1 parent? Yes. If you are so incredibly smart, you could at least think of that option, and write a little note that you did not consider that option because it is not a 'tree' but a 'Dyslectic Asymptotic Grape'.

    All I was saying is here's a question about children and parents. Think before you blindly answer the question with the example answer from 'Programming Microsoft Access for Idiots' and consider the possibilities this situation could create. And think further than the length of your nose. What if the question is correct, but the client later finds out 'you don't understand, more than one parent is possible'. What good is your grape then?

    Conclusion: code monkeys like grapes.
  • FredSaw 2007-08-01 15:57
    gwenhwyfaer:
    *sigh* Once again, I'm reminded that if you decide to imply something in a forum, at least one of its members will go on to state it explicitly in terms which make it clear that they think you too stupid to have figured it out yourself...
    I'm not sure what's set you off, but your post certainly was not implying what I stated. Your implication was simply that it was acceptable for him to answer as he did because he would have to do so in person. One likes to give the benefit of the doubt, but that "last laugh" part raised questions about how much thought went into your post.

    gwenhwyfaer:
    It's just not worth trying to have half a conversation online, I swear.
    If this is all it takes to get you in a state, then you're right that you should probably give up trying.
  • Lee Burch 2007-08-01 17:43
    I am actually the Lee Burch that originially submitted the crazy answers to the questions I got. Actually the post made on WTF was heavily edited the original is much longer and in my optinion far funnier.

    http://leeburch.is-a-chef.com/wtf/wtf.doc

  • FredSaw 2007-08-01 17:53
    Lee Burch:
    I am actually the Lee Burch that originially submitted the crazy answers ...and in my optinion far funnier.
    Interesting. At what point in the interview process did you give up on getting hired and opt for comedy?
  • Lee Burch 2007-08-01 18:09
    Just to be clear I wrote the questions *not* the answers.

    We do the written questions first to weed out folks like him. So I never spoke to the guy. People may feel this is not generous but I have seen dozens if not hundreds of these, at a certain point you can tell with fairly high certainty if someone is a waste of time or not.

    There have been those that have said an IT architect does not need to demonstrate such skills on a daily basis, and I would say they are sometimes right (although I as an architect will often need to explain in detail the finer technical points with more junior resources). However at my company we belive IT architects much still be able to function at a basic level in their technology of choice, after all this was not a closed book test he had 24 hours and all the web resources in the world with with to solve these simple problems.

    How would you feel if you went to the doctor with a problem and upon examing you he stated that how to fix what was wrong was in a book and left it at that.

  • Ren 2007-08-01 19:09
    Lee Burch:
    Just to be clear I wrote the questions *not* the answers.


    Okay, I'd like to see you write a database query that prints stuff out.

    Lee Burch:
    We do the written questions first to weed out folks like him. So I never spoke to the guy. People may feel this is not generous but I have seen dozens if not hundreds of these, at a certain point you can tell with fairly high certainty if someone is a waste of time or not.


    While I agree that the applicant discussed is not *exactly* prime material, I could (and will, if someone wants to) make a serious case that this while exact applicant may not have fulfilled the weird requirements that this test might have had, that he *at least* deserves an interview for at least pointing out the problems. If not, I claim that your evaluation criteria are unfair. Please see my previous post for details.

    Lee Burch:
    There have been those that have said an IT architect does not need to demonstrate such skills on a daily basis, and I would say they are sometimes right (although I as an architect will often need to explain in detail the finer technical points with more junior resources). However at my company we belive IT architects much still be able to function at a basic level in their technology of choice, after all this was not a closed book test he had 24 hours and all the web resources in the world with with to solve these simple problems.


    Yes, but that's not really the problem. The problem is that you or someone directly under you sent the problem to TheDailyWTF, without addressing the horrible inconsistencies and ambiguities in the original questionnaire. No matter how big and high and mighty you are, we all started from that unenviable position of trying to apply.

    You decided to ridicule someone who made an honest effort. Honestly, I don't like that. You *burned* a fellow geek who was trying to get a job, who was 100% honest. Okay, he didn't give an actual response. So what? You still burned him.

    Lee Burch:
    How would you feel if you went to the doctor with a problem and upon examing you he stated that how to fix what was wrong was in a book and left it at that.


    How would you feel if you were the doctor, and someone came to you saying that he had *these exact symptoms* and he required *this particular treatment* while both assumptions were completely false? You're again being unfair to your applicant.
  • Lee Burch 2007-08-01 20:16
    Your the guy who originally submitted those answers aren't you! Kidding! (maybe)

    If you happen to be the sort of fellow that reads "create a query which will print the all the courses" and can't get out of it that the task is to write a SQL query and instead gets caught up in arguing the semantics that the query you create does not print anything but instead it is the tool that executes the query that does the printing then I also thing you are not the sort of fellow I would like to put in front of a client. If instead you *provide an answer* and make a note at the end of it that technically it is the tool which displays the result of a query that does the printing that might be a little better approach.

    I will mention this because I tend to think you might not be too familiar with the recruiting process, it is a game of numbers. With tens of thousands of posted resumes, thousands with relevant skills, you need a way to narrow down the field. If you happen to not like to answer simple questions or perhaps if you like to argue semantics than try and meet the expectations of the interviewers then likely you are not the right man for the job.

    Also, His name was removed so I am not sure I see how anybody got burned here. Anyway you are on WTF, did you really expect the posts would all praise the glory of the programmers? Have you read any of the other posts here?
  • FredSaw 2007-08-01 20:17
    Ren... let it go. You're embarrassing yourself.
  • Ren 2007-08-01 20:43
    Lee Burch:
    If you happen to be the sort of fellow that reads "create a query which will print the all the courses" and can't get out of it that the task is to write a SQL query and instead gets caught up in arguing the semantics that the query you create does not print anything but instead it is the tool that executes the query that does the printing then I also thing you are not the sort of fellow I would like to put in front of a client.

    I will mention this because I tend to think you might not be too familiar with the recruiting process, it is a game of numbers. With tens of thousands of posted resumes, thousands with relevant skills, you need a way to narrow down the field. If you happen to not like to answer simple questions or perhaps if you like to argue semantics than try and meet the expectations of the interviewers then likely you are not the right man for the job.

    Also, His name was removed so I am not sure I see how anybody got burned here. Anyway you are on WTF, did you really expect the posts would all praise the glory of the programmers? Have you read any of the other posts here?


    Well, as I said in my first post, I agree that he should have provided at least one answer. I was mostly annoyed by the amount of posts ridiculing the applicant, and I lashed out. I apologize, you weren't a part of it and I shouldn't have lashed out.

    However, you should be the first to agree that the questions themselves are ambiguous. Sure, you're looking for the people who can see through the fog, but... okay, I've never tried to weed out the few people in the several hundred emails I get, I guess I overreacted. I guess seeing through the fog is enough.

    You're also right about the name being withheld. If he reads this article, he might get slightly embarrassed, but that'll probably encourage him to write better resumés in the future, and that'll be better for everyone. Meh, no one loses.

    But I still maintain that he did try to answer the questions (okay, the long generalization about work applications was a bit thick, I'll agree) and that he provided a reasonable thought progress for someone with little experience in the matters.

    Also, if you read my posts, you'll probably find that while I argued the semantics, I offered to create varied examples. While I didn't write them out, I wasn't applying for the job and was mostly following the feel of previous posts. If you'd like, I'd be happy to paste in two java classes that fulfill #3, but I still maintain that #2 is better answered with a mediocre query within context (say, PHP or Java) than one brilliant query.
  • Ren 2007-08-01 20:48
    FredSaw:
    Ren... let it go. You're embarrassing yourself.


    I don't like people ganging up on someone who's just trying to get a job. I maintain that he was honest, if not competent. I also belive I put out two points: The questions were ambiguous but he still *should* have given a proper response to the questions. When applying for a job, the applicant is always wrong. Do you think that's right? Or fair?

    If you think that standing up for the one who made a fool of himself, but was being totally honest and at least *trying* is embarrassing, I feel sorry for you.
  • FredSaw 2007-08-01 21:14
    Ren:
    I don't like people ganging up on someone who's just trying to get a job.
    I give up. Who's ganging up on who? The interview is over; the dude is no longer competing for the job. We're just having a good laugh at his naivete in having blown his chance. Although the major thrust of the thread is "Look at what this fool did", the underlying sentiment of both this thread and the whole website is, "Look and learn... take notes. Here is what NOT to do!" In that sense, then, consider it a free lesson contributed by one who hires, and who did not hire in this case. "Want to get hired? Don't do this." There's nothing ambiguous about it.
    Ren:
    I maintain that he was honest, if not competent.
    I'll say it one more time: they wanted product, not the promise that product could conceivably be delivered if he deemed it necessary. He didn't deliver product; he delivered a promise. Ahhhnk! Ahhhnk! Ahhhnk! (Red lights start flashing) Honesty has no place here. Either you deliver, or you don't. If you can answer the question, don't talk about how you can do it... do it.
    Ren:
    I also belive I put out two points: The questions were ambiguous but he still *should* have given a proper response to the questions.
    That's what I just said.
    Ren:
    When applying for a job, the applicant is always wrong. Do you think that's right? Or fair?
    I have no idea what you're talking about, but when my company does an interview, everyone comes in on equal ground. We know what we're looking for, and the applicant either will or will not meet those needs. Those who don't will not be hired; those who do will be hired. How much more clearly do you need it explained to you?
    Ren:
    If you think that standing up for the one who made a fool of himself, but was being totally honest and at least *trying* is embarrassing, I feel sorry for you.
    Hang in there, little one. A few years down the road you'll begin to understand.
  • GSquared 2007-08-01 22:55
    On the query (question 2), I came up with:

    select CourseNo,
    case
    when (select count(*)
    from dbo.courseinstructors c3
    where courseno = c1.courseno) < 3 then Instructor
    else 'Committee'
    end as Instructor1,
    case
    when (select count(*)
    from dbo.courseinstructors c4
    where courseno = c1.courseno) = 2 then (select max(instructor)
    from dbo.courseinstructors c5
    where courseno = c1.courseno
    and not instructor = c1.instructor)
    else null
    end as Instructor2
    from dbo.courseinstructors c1
    where instructor =
    (select min(instructor)
    from dbo.courseinstructors c2
    where courseno = c1.courseno)

    I tested it, and it gives the desired results. Execution plan is a mess, but the test table I created only had 6 rows in it, and I didn't bother with indexes, primary keys, etc. But the sample table structure was pretty bad for that kind of thing anyway (it's got serious normalization issues unless each instructor only deals with one class, for one thing).
  • Simmo 2007-08-01 23:18
    ThePants999:
    I'm not impressed with this "worst response he's ever seen". The article did not summarize the document at all well, and although the architect in question probably should have known more than he did, I thought it was a good response from someone in his position.


    God help us - are these people for real?

    Talk about completely missing the point. I think there are plenty more such 'candidates' out there, by the look of this.

    I really hope I never have to apply for a job where ThePants999 et al are the interviewers.
  • Simmo 2007-08-02 00:02
    Jeremy Weiskotten:


    public boolean equals(Object obj) {
    if (!(obj instanceof Dude))
    return false;
    ...



    And another comment had this too.

    Problem with this is that if you try to store a derived class (one that extends Dude) in the HashSet, this will return false, even though you may want to return true if the rest of the equals code is true.
  • FredSaw 2007-08-02 00:02
    Simmo:
    God help us - are these people for real?
    Have you observed the activity of the Bush Administration over the past seven years?

    Addendum (2007-08-02 00:21):
    Impeach Bush
    Impeach Cheney


    Addendum (2007-08-02 00:23):
    Can't edit? Darn... Well, try this one.

    http://impeachcheney.org/
  • Jeremy Weiskotten 2007-08-02 08:59
    Simmo:
    Jeremy Weiskotten:


    public boolean equals(Object obj) {
    if (!(obj instanceof Dude))
    return false;
    ...



    And another comment had this too.

    Problem with this is that if you try to store a derived class (one that extends Dude) in the HashSet, this will return false, even though you may want to return true if the rest of the equals code is true.


    That's not true. The "instanceof" check will return true for any subclass of Dude, because the subclass "is-a" Dude. Proof: Any Java object is an instanceof Object.

    You may be confusing this with:


    if (!obj.getClass().equals(Dude.class))
    return false;


    This would return false for subclasses of Dude, because the instance would be of a different class. Sometimes that is what you want. In this particular case it's moot because I intentionally made the class "final" to preserve its immutability -- you can't extend Dude.
  • anon 2007-08-02 16:21
    Mario:
    The answer for Q1 should contain a note about the number of parents. You could assume one parent per child, but it may be more than one. Remember, reader, you have 2 parents!


    Except the question was for a TREE
  • Vladimir 2007-08-03 09:54
    Hey. There are two big idiots. First one is a person who created those stupid questions. And second one is a person who didn't told to first one to kiss his ***.

    I would never work with a company like that. Guy who is searching for Architecht is totally insane.
  • Alexander 2007-08-05 22:05
    Hey Valdimir, you looking for a job? We have been looking for someone who combines your good attitude and superb language skills for months!

  • Earl Purple 2007-08-07 19:57
    Tree in relational database? How about:

    PrimaryKey Stuff Parent
    1 null
    2 1
    3 1
    4 2
    5 2

    where Stuff represents data about the record and Parent is the unique id of the parent node with a null value if this is the root.
  • Steven Joseph Adams 2007-09-03 18:13
    penis penis penis penis penis penis penis nerd geek penis fatfuck geek penis
  • Anonymous 2007-10-05 04:56
    To the people saying "word document, wtf?".. I think that is the point.
  • code4life 2007-10-17 10:47
    This should work (I hope...):

    select
    c.courseno,
    [instructor1]=
    case (select count(*) from courseinstructors where courseno=c.courseno)
    when 0 then null
    when 1 then (select instructor from courseinstructors where courseno=c.courseno)
    when 2 then (select top 1 instructor from courseinstructors where courseno=c.courseno order by instructor)
    else ‘committee’
    end.
    [instructor2]=
    when 0 then null
    when 1 then null
    when 2 then (select top 1 instructor from courseinstructors where courseno=c.courseno order by instructor desc)
    else null
    end
    from course c order by c.courseno
  • Ilya 2008-04-29 18:55
    I wish I could guess to answer the same to those students who have interviewed me the last time. The problem is that having 15+ years of programming experience I have never designed a tree. Believe me or not, never! Especially a balanced binary one, which I was asked to design in C# during this interview. All the time I'm dealing with sending documents from BizTalk to MOSS, handling transactions, tracing SOAP calls etc. There are no trees on my lawn. Surprise eh?
  • TraJ 2008-07-09 15:02
    Loving the Transit SQL post from the recruiter!! Sometimes recruiters just don't know anything about technology. I once was trying to explain to a recruiter that I had good knowledge of Analysis Services 2000 and 2005. He was like, yeah, but do you know SSAS?! I'm like it's the same friggin thing, don't you wonder what all those acronyms mean?!
  • ???????? 2008-07-10 03:42
    When u sign in on MSN wot happens if it keeps not responding i get so annoyed with it can u help me i dunno wot to do!!!
  • Capt. Obvious 2008-09-25 18:52
    [quote user=You Get What You Ask For"]Damn thats a hard image to read! Just what I need to see when trying to read black text on a white background.. a bunch of rainbow-looks-like-an-anti-aliased-jpeg garbage image.[quote]Why don't you just buy an LCD monitor?
  • raistd 2009-01-09 06:04
    It reminds me of one applicant I interviewed.
    This person was unique in such a way that he answered ALL my questions with a SINGLE sentence.

    "I don't know the answer right now, but if I was in front of a PC I can Google the answer in 5 minutes"
  • sfsad 2009-01-21 23:53
  • wm 2009-07-06 05:31
  • Nasty Nick 2014-08-22 08:13
    ????????:
    When u sign in on MSN wot happens if it keeps not responding i get so annoyed with it can u help me i dunno wot to do!!!
    Stop using computers, you stupid cunt.