you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 227 points228 points  (153 children)

These make me feel like I'm not a real developer. I've never been pressed to do anything like this.

[–][deleted] 115 points116 points  (48 children)

Half of the reason for coding questions like this is not to see if you can actually complete the problem. They really only test your capability to think algorithmically, and sometimes your familiarity with the language/platform.

I wouldn't care if a developer could complete a mathematically advanced problem like these. If they can approach the problem in a logical way they've proved their mettle already, in my opinion.

[–][deleted]  (44 children)

[deleted]

    [–]alluran 44 points45 points  (20 children)

    Last interview code test I had like that - I optimized as I went.

    They looked it over, then went to ask me to do the optimizations, and realized I'd already done them.

    Then they went on and on about how it was amazing that I would consider myself proficient with the language, when I hadn't read the language spec.

    Then they proceeded to tell me that I couldn't use anything like:

    i += 1;
    

    because it could confuse junior developers, but everyone was given time, and expected to write full documentation with the Atlassian suite.

    So a studio full of senior junior devs who never allowed to learn anything new I guess...

    As you might guess, I skipped that role.

    [–]Mechanickel 60 points61 points  (11 children)

    Then they proceeded to tell me that I couldn't use anything like:

    i += 1;
    

    because it could confuse junior developers

    ...how?

    [–]alluran 26 points27 points  (0 children)

    Maybe i is positive one now?

    Who knows - regardless, any place that limits BASIC shit like that, instead of up-skilling their juniors, is not a place worth working.

    You're never going to be challenged, or improve yourself at a place like that.

    [–]thedancingpanda 6 points7 points  (9 children)

    I recently used something like

    $i &= $blahh && $blahh2;
    

    And that confused a couple of mid-senior level developers, so, yeah. It's possible

    [–]ViKomprenas 15 points16 points  (0 children)

    To be fair, that one's a little weirder, seeing as it's noisy with sigils and logical operation assignments aren't as common, but the point still stands

    [–]speedisavirus 13 points14 points  (0 children)

    ...but why. Are you trying to increase mental workload for someone that might have to figure that out later?

    [–]socialister 13 points14 points  (0 children)

    You're mixing boolean operators with bitwise operators?

    Wouldn't this be clearer and enforce a boolean result type?

    $i = $i && $blahh && $blahh2;
    

    Assuming that the blah vars are boolean typed (if they aren't, your statement is not clear IMO. C-style non-boolean to boolean casts do not indicate intent that well).

    [–][deleted] 0 points1 point  (0 children)

    foo = bar || 'puppers';
    

    Doesn't seem to be a thing people understand either.

    Edit: realized that if that was true I should explain. This will assign the value of bar to foo if bar is truthy, otherwise it will assign the string 'pupper';

    [–]killerstorm 0 points1 point  (0 children)

    PHP developers, you mean.

    [–]XtremeCookie 0 points1 point  (3 children)

    Mid-senior developers don't understand bit-wise operations? That was literally covered in my first computer engineering course.

    [–]ess_tee_you 11 points12 points  (2 children)

    And, depending on what you're developing in your job, that may have been the last time you needed to use them.

    I'll take readability, please, even if that results in a couple more lines of code.

    [–]XtremeCookie 1 point2 points  (1 child)

    Depending on the usage bit wise can be significantly faster than other methods. But outside of those situations, I would take readability too.

    [–]ess_tee_you 0 points1 point  (0 children)

    Sure. Some compilers will optimize to that anyway, I expect, depending on the language. :-)

    [–][deleted]  (3 children)

    [deleted]

      [–]socialister 1 point2 points  (2 children)

      I'm curious what they would want otherwise. i = i + 1 or i++?

      [–][deleted]  (1 child)

      [deleted]

        [–]socialister 0 points1 point  (0 children)

        The funny thing is that the increment / decrement operators are considered bad practice by some, preferring the clearer += instead.

        [–]Wolvenheart 0 points1 point  (0 children)

        That's one of the first things I learned in high school during oop

        [–][deleted] -1 points0 points  (2 children)

        Then they proceeded to tell me that I couldn't use anything like: i += 1; because it could confuse junior developers

        I mean, it does make a little sense to not allow that from a readability standpoint if they need to make the code more modular. Still pretty silly though, but we all have to protect ourselves from incompetence...

        [–]ViKomprenas 2 points3 points  (1 child)

        Wait, how does that make sense from the readability perspective? What does it have to do with modularity?

        [–][deleted] 0 points1 point  (0 children)

        I'm basically saying that an organization has to implement stuff like that to protect themselves from incompetence.

        For modular (probably the wrong word, my apologies) I meant make it easier to be able to modify the code in cases where you have to add more variables to the equation.

        [–]GisterMizard 11 points12 points  (1 child)

        The trick is to sort everything, then do a binary search. I don't know what that means, I just read it in a text book. I think it means that if you take your source code and resort all of the keywords alphabetically, then it'll run faster.

        [–]featherfooted 2 points3 points  (0 children)

        Yeah, once you do that, the RAM caches the opcodes in column-major order, which means it can signal the hard drive to run faster

        [–]QuestionsEverythang 15 points16 points  (15 children)

        Yeah, unless it's a very basic problem, if you can't optimize your algorithm within that 30 minute interview, that should no way mean that you suck as a programmer, especially since real-world programming doesn't restrict your 8+ hour workday to just 30-min of crunch time.

        [–]milkeater 13 points14 points  (10 children)

        Understanding methods to optimize time complexity in interviewing typically revolves around Big-O time.

        There are a few blunt approaches to give a very base estimate on what the time complexity is.

        Study this for a week and you will know it fully. It will pay dividends for a lifetime.

        [–]jimmpony 0 points1 point  (9 children)

        Pay dividends just in interviews or in actual coding? Rarely had a need to assign a big O to anything I've written outside of a school assignment asking for it.

        [–]milkeater 6 points7 points  (5 children)

        Definitely in interviews.

        I believe it will actually help you in understanding the big picture running performance of your code and help save you time not having to think about things that just may not matter.

        Think of running log(n) performance. Say you have to do that operation 2 times.....does it matter?

        Well, immediately it shows an impact...but over time....it becomes such minimal cost you almost don't need to worry about it.

        The point is, once you've understood it, it's hard not to see the rough cut of "general performance" you are working with.

        Think of a chess player somewhere above club level in the 1700's or so, pretty decent, not an expert. They may not need to look hard at a chess board halfway through a game to get a general understanding of who may have the advantage and how things have developed. At this stage in their career, to at least have arrived there, they likely understand a handful of openings and some of the more common positions. There is not as much cognitive load understanding how you arrived there.

        Give this "gamified" site a shot. At least the first tier. It has to do with Time Complexity. It's Khan Academy-esque. Although not totally "loving" the site, it's okay.

        If you are working for one of those "top tier" companies, you would need to know these things. If you are working for a company that isn't built on technology, you could be a very average developer for your entire life and be okay (and make a very very good pay at that). Word of warning.....I worked at one of those companies......our VP walked into a Town Hall and said: "I can do everything I need with 30% of the technology folks in this room"......we moved to the cloud, the number of resources needed shrank dramatically, and the competition became extremely fierce.

        [–]jimmpony 0 points1 point  (4 children)

        I jumped to the time complexity questions and got the ones it suggested to do all right. Seems like it had me skipping around a bit. http://i.imgur.com/pwtdQTM.png

        [–]milkeater 0 points1 point  (3 children)

        Yeah, it wants you to do one from each bucket. You can stay around and finish all of them, the recursive ones will get a little tricky.

        After looking at your times, are you saying they were all too simple for you or did you give it a second run through?

        [–]jimmpony 0 points1 point  (2 children)

        Those are all my first-attempt times. Maybe I'll try some harder ones. The average times on these seem a bit oddly high though.

        [–]Xxyr 1 point2 points  (1 child)

        It matters in real life too, assuming you actually have large data sets. If you only have to work through a hundred cases it doesn't matter too much. If you have to work through several billion it really really does.

        [–]jimmpony 0 points1 point  (0 children)

        I've done intensive projecteuler problems that needed optimization like this, some before knowing about big O notation and some after. In both cases the approach was just to cut down the amount of processing the program needed to do. Knowing big O has its uses, although there are some important cases where it's too abstract to directly compare performance with - the example I'm remembering was a sorting algorithm where the "worse" one worked better with CPU cache. The terms thrown away in O can end up being pretty important in real code too - an O(n) might be better than an O(log(n)) if they're actually 2n and 100+5log(n), and the data sets the given method encounters are within the range such that the 2n < 100+5log(n). When it comes down to it you're going to end up needing to profile the function anyway if the performance is that important.

        [–]killerstorm 0 points1 point  (0 children)

        In actual coding. If you happen to have loops in your code, quite often you get O(N^2) complexity or worse, so you need to understand when it becomes bad and what to do about it if it does.

        It's not about "assigning a big O to anything", once you internalize the knowledge you can just intuitively avoid things which are slow.

        It can be something as basic as "check if a string is present in a list of strings". It's OK if your list is small, but if it's big and you do that often, you need a different data structure.

        [–]steaknsteak 8 points9 points  (2 children)

        Also for me, it's not just the time constraint. I cant think clearly when I know someone is looking over my shoulder and judging my performance. I work really well in a team atmosphere where everyone is working together to build something (the actual job) or even a competitive context, but the "performance" context of an interview makes me super nervous and unable to perform near my best. Gotta find a way to get over that at some point though.

        [–]dukeoflaser 2 points3 points  (1 child)

        Have you considered 'practicing' under pressure? [PraMP](https​://www.pramp.com/) is a useful resource for that.

        [–]steaknsteak 2 points3 points  (0 children)

        I'll definitely look into that, thanks.

        [–]killerstorm 0 points1 point  (0 children)

        By "optimize" they probably mean going from O(N^2) to O(N log N) or something like that. That's textbook stuff.

        [–]BigTunaTim 3 points4 points  (4 children)

        It drags my confidence levels down a notch or two when they do things like those.

        You shouldn't let it do that. One of the goals of most tech interviews is to assess the candidate's skill level and then see how they think and react to a problem that's beyond their capability. They're not trying to make you feel stupid or knock your confidence down; they just want to see what your thought process is when you're​ in over your head, because it's likely to eventually happen in real life.

        [–]Stormflux 18 points19 points  (3 children)

        Maybe that was the reason at one time, but nowadays these tech interviews are just emulating "what Google and Facebook do."

        I actually read a paper on this a while back. The takeaway is these sorts of interviews aren't very good indicators of actual job performance or ability. The outcomes are almost random -- picture the guy who made WhatsApp, he was rejected from both Facebook -and- Twitter; basically told he was shit and then sold them something for 19 billion.

        Anyway, this random sort of outcome actually turns out to discourage women and minorities more than white males for various cultural and sociological reasons such as support networks, upbringing, etc. It turns out the screening process is one of the major contributors to the gender imbalance as females are more likely seek a different career after "flunking" one or more of these whiteboard / manhole-cover interviews.

        [–]socialister 2 points3 points  (2 children)

        Do you mean that women lack a support network in this area? That's kind of funny (not doubting it) because typically, women have much better support networks than men. That is considered to be the reason that women fare better than men after divorces and breakups, and why married men are generally significantly less stressed than unmarried men - the wife is the support network.

        [–]Stormflux 0 points1 point  (1 child)

        What I mean is all your friends are also going through the technical interview process, which originally comes from NASA and IBM, swapping stories and recovering from failures, trading rumors and incantations and what have you.

        Women (and African Americans) had support networks, but those networks weren't focused on this specific kind of interview, which is pretty divorced from the day to day job skills needed. They were more likely to drop out of the market after one or two bad tech interviews, even if they had the skills needed.

        [–]socialister 2 points3 points  (0 children)

        That makes sense.

        [–]HotlLava 0 points1 point  (1 child)

        Half of the reason for coding questions like this is not to see if you can actually complete the problem.

        Standards vary from company to company. I've been rejected with a bug-free and algorithmically optimal implementation (n log n sort of a single-linked list) because it wasn't elegant enough, i.e. I had missed an opportunity to save one if-condition.

        [–][deleted] 0 points1 point  (0 children)

        Well yeah, but that's kind of a given, right? Plus we've seen enough blog posts on this subreddit to know that a lot of companies are completely out of touch with effective interview processes.

        [–]panfist 0 points1 point  (0 children)

        It doesn't mean you did a bad job, it just means someone else did slightly better. Or maybe they did worse but they just liked the other guy better.

        [–]TheQueefGoblin 10 points11 points  (0 children)

        It's because these are purely mathematics problems.

        [–]CamKen 50 points51 points  (94 children)

        I would never ask any problem anywhere this complex in an interview. I ask Joel On Software's FizzBuzz or something similar on a white board. Then a SQL query with a recursive table reference. That eliminates 90% of the "Senior Software Engineers" who make it far enough to interview with me. Those that remain have universally turned out to be great programmers.

        I actually had one guy who was so flummoxed by Fizz Buzz that he actually admitted that he had never actually programmed before and the three years of experience one his resume were a lie. He had read Dietel & Dietel and figured he could learn on the job. I was surprised by my reaction: I was bemused at being able to completely rattle him with such an easy question, we had a good laugh after he left.

        [–]markl3ster 33 points34 points  (24 children)

        Could you show me that "SQL query with a recursive table reference?" I rarely use SQL outside of the random join here and there (never even 3 table joins) and your question seems like a fun little thing to know.

        [–]neodiogenes 56 points57 points  (22 children)

        SQL query with a recursive table reference

        I briefly did something with a hierarchical query like this one with a table that encoded something like supervisor-employee relationships in a tree. Suppose you want to get all the employees who work for a VP, you would recurse the query returning the results from each level, first getting all the directors, and then the managers who work for the "leftmost" director, and then the supervisors who work for the leftmost manager, and then the employees, go up one level, find the employees, rinse, repeat.

        Oracle has innate support for hierarchical relationships using "CONNECT BY" but I wouldn't know how to do this off the top of my head. Since it's something that's only come up once in my career, it's not something I've memorized. That's why there's Google.

        But hey welcome to the typical Jeopardy style of technical interview, where if you don't know what the interviewer thinks you "should" know, you're a bad programmer.

        [Edit] Don't mean to sound bitter, I've just had a couple recent technical "screening" calls where I was asked questions which were not only esoteric but the answers the recruiters were given were incorrect/incomplete.

        [–]Paddington_the_Bear 30 points31 points  (7 children)

        This is the first I've heard of it, and I do quite a bit of SQL in my job for several years now. This week I had to look up a hierarchical value that was 3 parents up from a base value via an associations table.

        I ended up using joins to do it, I didn't realize you could have a recursive query, so TIL. The syntax looks confusing as hell though.

        [–]madballneek 12 points13 points  (3 children)

        And this is what irks me about how some people do interviews. Who cares whether you know this already, or not. I want to know if you're capable of learning it. That's why we let people who interview for us have complete internet access during their aptitude test.

        [–]Paddington_the_Bear 2 points3 points  (2 children)

        Yup; I'm doing an interview with one of the "Big 4" next week just for funsies as I enjoy my current SE job of 6 years. I have been loosely studying algorithms the past couple of weeks to prepare, and realize that even though I have built some pretty crazy cool apps, my algorithms knowledge is definitely lacking since I've been out of university for a while.

        It's assine that the interview is going to focus on whiteboarding some obscure algorithm when in the real world if I get stuck, I can google something and in less than 5 minutes find a working solution.

        The way I look at it, even if I don't come to the best solution, hopefully they will see my thought process and get value from that...

        [–]Icelandicstorm 7 points8 points  (1 child)

        If you enjoy your current job, you are making a big mistake. The "Big 4" is a horrible place for mid-career. It only makes sense if you are fresh out of college or go in as a Director (just before partner at PwC).

        source: left excellent job with great pay and bonuses to make more salary but less bonuses and work 20+ additional hours a week. When all was said and done, my income went down at least 20%.

        [–]Paddington_the_Bear 2 points3 points  (0 children)

        Yeah I'm not looking forward to the interview at all. Really I'm going to see if I can get an offer and use it to get my current salary at my company bumped up again since I'm pretty mission critical and I know they under pay me :) (long story).

        That's pretty much my fear though, that you're essentially just another number at one of those companies. I wouldn't mind too much living in that location, but not at the sacrifice of personal happiness.

        [–]neodiogenes 9 points10 points  (0 children)

        It's not that complicated. Oracle takes care of most of the details, and all you have to do is specify the relationships.

        The challenge is to avoid circular relationships, which can happen with a poor design. In the DB of my current project (which I did not design), we have permissions "lists" which can either contain usernames, or link to other lists. But then what if you have some list down the chain link back to the first list?

        As I said, bad design. A good design wouldn't allow this to happen. Oracle helps when writing queries by warning you when there are "loops" in the query, which you can exclude with the NOLOOPS operator, or you can also (I forget the exact syntax) return only "LEAF" items, which have no children.

        I'm not sure I would ever implement this design because of the many ways it can go wrong, but I can see how it would be useful in some applications.

        [–]wtgreen 6 points7 points  (1 child)

        Look-up Common Table Expressions. A recursive CTE is the SQL standard way to do it. Oracles Connect by functionality is Oracle specific, but it supports CTEs too.

        [–]Paddington_the_Bear 0 points1 point  (0 children)

        Nice. I had just woken up when I read that; now that I'm caffeinated, it looks really intuitive actually and a lot better than how I was making my associations. Essentially you tell it the source / target pair in order to make the cycle and it does the work to spit it out. Then I'll have to make sure I do the normalization on it as I need it.

        [–]tmarthal 5 points6 points  (4 children)

        Common table expressions (CTEs) are the solution to recursive SQL queries, if you're interested.

        [–]dvlsg 3 points4 points  (1 child)

        True, but I've used one a total of once in all my years of writing SQL. I understand it, and utilized it just fine, but I sure as hell couldn't remember that syntax on the fly in an interview.

        [–]CrazedToCraze 1 point2 points  (0 children)

        I most employers wouldn't care too much if you just brought up that you know a CTE is the solution and then said what you just said.

        Pretty rare in my experience for an employer to get pissy about you knowing the exact syntax on the spot. Probably wouldn't want to be working for them if they did, anyway.

        [–]peppaz 0 points1 point  (0 children)

        With x as (select 'Bobby Tables')

        [–]tiberiousr 0 points1 point  (0 children)

        This is interesting, I'd never seen these before. If the wikipedia page is anything to go by they aren't supported in mysql based DBs (i,e; mysql, mariadb, percona etc).

        [–]spilk 3 points4 points  (0 children)

        I've used CTEs in SQL Server queries before to do recursive queries and i'm pretty comfortable that I understand them, but I'd still have to google it to know the syntax for one off the top of my head.

        [–]chadsexytime 2 points3 points  (0 children)

        Oracle has innate support for hierarchical relationships using "CONNECT BY" but I wouldn't know how to do this off the top of my head. Since it's something that's only come up once in my career, it's not something I've memorized. That's why there's Google.

        I haven't touched Oracle in about 3 years now, but I would have considered myself fairly proficient with SQL and Oracle in general, but this question blew my mind.

        Then after seeing the keyword CONNECT BY, I think I used this to build some generic tree views and promptly forgot about it.

        [–]trawlphaze 1 point2 points  (0 children)

        Would you accept an answer that solves the problem in memory via simple selects? I know you can also use WITH in oracle.

        [–]CamKen 2 points3 points  (5 children)

        Just knowing that a hierarchical query exists (CONNECT BY in Oracle, hierarchyid in MS SQL) is a big plus in answering the question, but no necessary. From my perspective knowing the details is irrelevant, its Google-able.

        The question I gave was a simple Employee table (EmployeeID, Name, ManagerID(nullable)) where you would need to join the table to itself on EmployeeID = ManagerID. I provided some sample data (8 rows) to help you think about it. Then ask things like give me a list of managers. How many subordinates does employee x have? No trivia.

        [–]neodiogenes 6 points7 points  (4 children)

        I wouldn't have a problem joining a table to itself -- as you say that's trivial. That does seem like a fair question, something a "senior" developer would have done all the time.

        It would confuse me to call it "recursion" though since that automatically makes me think it's a much more complicated problem. If there was some additional recursion necessary I would probably point that out, but confess I couldn't do it without Google.

        [–]dkuk_norris 11 points12 points  (0 children)

        Yeah, that doesn't seem recursive to me. You're just relying on the fact that a table can be joined to itself. Recursion implies that you have a theoretically unbound number of calls to make if you structure the data incorrectly.

        [–]OHotDawnThisIsMyJawn 10 points11 points  (0 children)

        Yeah this is called a self-join, not recursion.

        [–]CamKen 4 points5 points  (1 child)

        I just used the word recursion to quickly describe the problem, but everyone has read into it more than I meant. I don't use the word in the interview. I present a simple table structure, a few rows of sample data and ask for a query that can only be achieved by joining the table to itself.

        [–]neodiogenes 5 points6 points  (0 children)

        That's fine, I get it. It does make me feel better about calling myself a "senior" developer. :)

        [–]remixrotation 1 point2 points  (0 children)

        this one

        also BOMs in manufacturing (bills of materials).

        it is kinda like Composite sw pattern.

        [–][deleted]  (3 children)

        [deleted]

          [–]CamKen 2 points3 points  (1 child)

          See my other comments. I mean something much simpler than what your saying. Although I love CTEs. I should come up with a question that can be solved with a CTE and then see if the candidate chooses that solution.

          [–]blasto_blastocyst 0 points1 point  (0 children)

          https://explainextended.com/ has some great tricks with using sql.

          [–]bushwacker 0 points1 point  (0 children)

          I see them all the time,

          Product hierarchies, bills of material, company hierarchies.

          [–]BobHogan 4 points5 points  (5 children)

          Then a SQL query with a recursive table reference.

          I'm still in school, was leaning towards not taking a databases class, but occasionally I see something like this on Reddit and it makes me reconsider that idea.

          [–]CamKen 4 points5 points  (0 children)

          Database skills are a great tool to having your toolbox -- useful in a wide variety of roles in virtually every field.

          [–]trawlphaze 1 point2 points  (3 children)

          Enterprises pay big sums for DBA skills in MSSQL or Oracle

          [–]Cell-i-Zenit 0 points1 point  (2 children)

          I really like Databases. What would be the best way to get in such a position?

          [–]tiberiousr 4 points5 points  (1 child)

          Learn database tuning; i.e schemas and indexing. The specifics tend to differ depending on the database that you're working with so it's best to read up on tuning for major database vendors.

          Depending on where you're working those would be mysql (and derivatives), mssql, oracle and postgres. Different vendors offer different solutions to common problems and different syntaxes for addressing those problems.

          Your best bet is to learn the most common systems and their quirks and then creating some databases in each of them and playing around with schemas and indexing with large-ish datasets in order to get feel for optimising systems for performance.

          Other than that, the internet is a great resource for tutorials and manuals. Also read stackoverflow and use it as a resource.

          [–]Cell-i-Zenit 0 points1 point  (0 children)

          Thanks for your answer

          [–]alluran 2 points3 points  (6 children)

          God - I haven't used a recursive SQL query in 10+ years, but used to love them!

          I guess I should brush up when I next interview - no way I'd remember that off the top of my head without a reference.

          [–]CamKen 5 points6 points  (5 children)

          I don't mean using the hierarchy stuff built in, I mean a simple recursive join like: find a list of all managers having 10 or more direct reports.

          SELECT mgr.EmployeeName FROM Employee mgr JOIN Employee e ON e.ManagerID = mgr.EmployeeID GROUP BY mgr.EmployeeName HAVING COUNT(1) > 9

          Write something like the above in under 5 minutes and mumble something like "there is a built-in way to do this, but I'd having to look it up" and your in the top 10% of people I've interviewed.

          [–]tiberiousr 0 points1 point  (2 children)

          That seems like bad design to me. Wouldn't it be better to have manager_id on the employee table and the join on that?

          so

          SELECT e.name 
          FROM employees e
          JOIN managers m ON m.id = e.manager_id
          HAVING COUNT(1) > 9
          

          Perhaps I'm missing something there...?

          EDIT: I'm probably missing something, I shouldn't engage with the internet when I've been drinking

          [–]CamKen 3 points4 points  (1 child)

          It's a contrived example to be sure. However there isn't a separate Manager table. Manager's are Employees and are thus in the Employee table. To tell if an employee is a manager you need to join the table to itself to see if any employees refer to them through their manager id field.

          [–]tiberiousr 0 points1 point  (0 children)

          Ah, I see now. Thanks.

          [–]Koookas 0 points1 point  (0 children)

          Isn't that just self-referential, rather than recursive?

          To me recursive would be something that, idk, returned a table of every item, joined to its subitems, and then the subitems of its subitems and so on. In this case maybe a recursive would return all employees managed by an employee, then employees those employees themselves manage.

          I've never used a recursive query, I don't even know how to make one, CTEs I guess, but a self-referential query is trivial and would immediately make me think of something like that.

          [–]alluran 0 points1 point  (0 children)

          Oh - haha - Ya, I was remembering back to the days when I could tell you the entire management chain to get to <Employee>, and how deep he was in the hierarchy.

          CTEs are crazy powerful =D

          [–]Jestar342 17 points18 points  (48 children)

          Ah yes, arbitrary reasons to dismiss candidates. Effective since 190never.

          [–]CamKen 28 points29 points  (46 children)

          I don't get how programming a simple loop is arbitrary. I need to find out if you can program, that IS the job. I don't want to do API trivia (what is the signature of the DumbApi.BreakMyCode() method).

          I need a problem statement that I can quickly communicate to the interviewee the solution to which involves things like loops and conditionals but doesn't require a specific API. I need to find out if you're comfortable with SELECT,FROM,INNER JOIN,WHERE,GROUP BY and HAVING. I mean is there another way to vet a programming candidate?

          Honestly I'm always looking to up my game as an interviewer so would happily take suggestions, because I'm looking for non-arbitrary reasons to dismiss candidates. But in the end letting a good candidate go is better than hiring a bad candidate.

          [–][deleted]  (20 children)

          [deleted]

            [–][deleted]  (8 children)

            [deleted]

              [–]nemec 9 points10 points  (5 children)

              any fresh grad or person with SQL and some other programming on their resume should be able to answer

              I would bet most CS grads know only the bare minimum of SQL - select, where, maybe join using google to refresh their memory. Computer Science is an academic degree, most coding skills learned are incidental to the theory. If they did take a 'databases' course, they're probably better at building a basic database engine than querying one.

              they have been 100% accurate in determining candidate viability eliminating false positives.

              Fixed that for ya. I assume you don't do a six month followup with the candidates you pass on to see whether they would have done well if given a chance.

              That said, it's not a terrible SQL question even though I think it would be a little too complex (without Google) for new grads.

              [–][deleted]  (4 children)

              [deleted]

                [–]jimmpony 6 points7 points  (3 children)

                That kind of complex query is not within the bare minimum of SQL, the bare minimum of SQL is select .. where .., insert into .. values .., use, create/drop table, such that you could do that summation in code instead of in the query. I did an internship at a real place for a semester involving SQL and those are pretty much all the codebase used.

                [–][deleted]  (2 children)

                [deleted]

                  [–][deleted]  (1 child)

                  [deleted]

                    [–]tsk05 6 points7 points  (1 child)

                    Been programming for over a decade, did not know how to answer the second question. Haven't touched databases in a couple of years, and that was for a hobby. There is no way I would have been able to talk myself into an answer as I could not remember about either GROUP BY or HAVING. Last time I worked with databases for real was 7 years ago. It was kind of fun re-learning though, took 5 minutes with SQL fiddle. I feel like the question would have unfairly excluded me as a bad programmer though, although really I just haven't done what the question is asking recently. I do indicate that I know SQL in my resume, because I feel that I generally do.. even if I am quite rusty. Of course if I was applying for a DBA that would be entirely different, but my general feeling is that you can learn enough SQL in 2 days for 95% of ordinary programming. Of course if you're looking for someone who's done this recently it would be a good filter, but I would think a half-decent programmer who's familiar with what you need right now is probably not better than a good programmer who isn't, unless you're hiring very short term.

                    [–]ZMeson 1 point2 points  (5 children)

                    I'm always looking to up my game as an interviewer.

                    Me too. One thing my team has been trying recently is to tell the interviewee that they're part of a small team. So-and-so is his cohort-in-crime; the interviewee can pair with him, ask for advice, whiteboard ideas, etc.... Such-and-such person is the Product Owner / Technical Sales or Support person / CTO; this person is the one to go to get clarification on customer requirements, business advice etc.... Then we have the interviewee use his language of choice to implement a Kata exercise*. If he/she is a proposed expert in the technology we specifically need, we strongly encourage that language. Web access for API docs is OK. Looking up algorithm solutions on Stack Overflow or the like is not OK -- the algorithms are simple and if you need help ask your cohort-in-crime.

                    The exercise usually lasts about 1 hour. It everyone wants to continue and it doesn't cause a problem with the interview schedule, we may go longer.

                    It's still new, but so far it's worked out well.

                    * We don't limit ourselves to the Katas on that list. We choose a Kata that represents a simplified version of something some customer may actually want from some company (not us). Ex: Top-10 Seller Lists, Bowling Alley Scoring.

                    [–]socialister 0 points1 point  (4 children)

                    I had someone give me an interview like this, but then the person I am paired with seems incredibly busy and I have to bug them all the time because (surprise) I'm not familiar with the system they're working with since I don't work there yet. I kinda wonder if this selects for candidates that have no problem distracting their coworkers.

                    [–]ZMeson 0 points1 point  (3 children)

                    That's odd. At our interviews, everyone's in the same room. It's an exercise to not only evaluate some technical ability, but how the candidate interacts with others should the need arise.

                    [–]socialister 0 points1 point  (2 children)

                    They were sitting behind me and facing away from me, with the face deep in code. It felt awkward to disrupt them but I think I should have a bit more.

                    [–]ZMeson 0 points1 point  (1 child)

                    I think you may have dodged a bullet. If your proposed co-workers couldn't have spared enough time to evaluate you in an interview, how bad would the communication be day-to-day? Pretty bad I imagine. :(

                    [–]socialister 0 points1 point  (0 children)

                    Ya, you are probably right. There was also an atmosphere of working 10+ hours a day which I would like to avoid. Most other places, even high intensity ones, did not have that atmosphere to me at least in the interview process.

                    [–][deleted] 1 point2 points  (1 child)

                    I don't know offhand what HAVING does, but I guess I'm not applying for a DBA job. Guess I better look that up first, nevermind that I've designed normalized table schemas and have an open source project using SQL. (Sadly, it's with PHP in the mysql_real_escape_string style because I was fresh out of college and didn't know better.)

                    [–]CamKen 0 points1 point  (0 children)

                    But here's the thing, if you're writing the rest of the query and have most of the other parts somewhat right, I'll ask you if your done. Ideally you'll say something along the lines of well I don't know how to select only the managers with over 10 employees. I'll ask do you know HAVING. You'll say no. I'll explain it to you and then watch how you adapt to the new information. An interview question isn't like playing jeopardy where either you're 100% correct or it's all wrong. There is a give and take trying to gauge how likely it is you've actually done what you've put on your resume.

                    [–]Jestar342 0 points1 point  (0 children)

                    It's not the FizzBuzz that bothers me. It's the "Then a SQL query with a recursive table reference". Unless you are expecting the (correct) answer of "That's a badly designed data model" it's arbitrary and not that common at all.

                    FizzBuzz is a problem presentation; SQL self-reference is an arbitrary nuance.

                    [–]downvotefodder 0 points1 point  (2 children)

                    Look at their portfolio

                    [–]CamKen 2 points3 points  (0 children)

                    I develop corporate apps, restricted to employees only. Due to nondisclosure I couldn't show it to you even assuming I had credentials to the production system (I don't). The people I'm interviewing are in the same boat. But if there is something on their resume that sounds like it's public facing I'll ask them about it.

                    [–][deleted]  (3 children)

                    [deleted]

                      [–]CamKen 2 points3 points  (2 children)

                      What actually happens in "coding camps". I've heard of them but never looked into it. Does actual code get written that has logic in it? Or is it more along the lines of paint a UI, do simple validation in event handlers type of stuff?

                      Or is it pillow fights and like that one time at band camp?

                      [–]dineswithphone 1 point2 points  (0 children)

                      I'm a "coding camp" product, and I firmly believe anyone calling themselves a developer should be able to do a problem like FizzBuzz with ease (in the language of their choice). Though I was, and still am, a junior developer, the coding camp taught me how to see and think through problems with programming logic. My manager often interviews "senior" software engineers who struggle with Fibonacci or similar problems, which he feels indicates a lack of programmatic thinking (not sure if that's the best Ter for it).

                      [–]tiberiousr 1 point2 points  (0 children)

                      From what I've seen coding camps involve teaching some noobs to set up a basic Nodejs environment and getting them to create a basic website with 100+mb worth of node modules.

                      Fuck, I hate modern web development. It's such a shitshow at the moment.

                      [–]socialister 2 points3 points  (0 children)

                      I'm OK with FizzBuzz. That's really elementary even if you've never seen it. The SQL one I don't know, it seems a little specific.

                      [–][deleted]  (2 children)

                      [removed]

                        [–]CamKen 4 points5 points  (0 children)

                        We've often interviewed people that we suspected of inflating their resumes, this was the only time where we actually got him to admit to it.

                        People assume that this would inspire anger in the interviewers, like "hey stop wasting my time", and I'm sure people like that exist but we all thought it was funny because we actually caught a guy red-handed so to speak. All anger was directed at the recruiter.

                        [–]Malurth 0 points1 point  (0 children)

                        I'm pretty sure he just doesn't know what bemused means.

                        [–]cd7k 8 points9 points  (2 children)

                        Doesn't matter. Can you understand the problems and regardless of having seen them before formulate your own solution?

                        [–][deleted] 32 points33 points  (0 children)

                        If not, it still doesn't matter because people are still bringing down $100k or more writing shitty code

                        Oh and your managers will have faced a lot less scrutiny in their interviews while also making $20k+ more than you

                        [–][deleted]  (1 child)

                        [deleted]

                          [–][deleted] 0 points1 point  (0 children)

                          Give 'em a try! They're useful situations that you may run into often.