7 ms·
At a past job we had a really fun interview question. What we did was laid out a concrete problem, and asked the interviewee to lay out a schema. Since we kno
by btilly 14y ago
At a past job we had a really fun interview question. What we did was laid out a concrete problem, and asked the interviewee to lay out a schema. Since we know the problem well, for virtually any schema we'd be able to invent reasonable requirements that would force them to change their schema. At the end we'd verify a basic knowledge of SQL itself by asking them to answer a couple of basic questions.
(The actual problem we had them tackle was reports to use in making picks in a fantasy sports game. But it could be anything simple to explain, fairly straightforward to solve.)
The reason why the question worked so well is that this was, in fact, pretty much how we build CRUD applications. We'd decide the schema, and once the schema was known, the CRUD application was fairly obvious and straightforward. And a large part of the programming model would be immediately provided by your ORM once you had done so.
- Q6T46nT668w6i3m 14y agoI like it. Would you mind sharing a “concrete problem” and subsequent “reasonable requirements?"
- btilly 14y agoConcrete problem, reporting system to help our boss make fantasy baseball (or other random sport) choices. Your responsibility will be the schema and reports, I'll be responsible for getting data into your schema. Reasonable requirements that often require changes to an initial schema: - What happens if I'm trying to update data but I only get partial data, how am I supposed to fix that? (A surprising fraction of people denormalize data too early.) - Can a player play two different positions? - Can a player transfer teams from one season to another? - Can a player transfer teams in a season. - Can a player change names? (If we threw this one at you, then you probably had a very good schema!) And then reasonable questions to test their SQL would be things like: - Who played in game X? - How many home runs did person Foo have? - How many home runs did team Bar have? - Sort all players by their hitting average.
- grncdr 14y agoFor an idea of how hairy this problem can get when you attack it "for real", take a look at http://sportsdb.org/sd http://sportsdb.org/sd (click the schema diagram on the right).
- 3pt14159 14y agoThis is amazing. A real, first class example of program complexity in a seemingly non-complex domain.
- bricestacey 14y agoI would hardly call this is "a seemingly non-complex domain". This database schema supports gambling and fantasy for 7 different sports.
- bjourne 14y agoThose questions may be good for grilling candidates, but it is not how one would sketch up a fantasy game irl. The right answer to all those questions are YAGNI and KISS. :) But those answers aren't valid so the questions seem to be rigged against the candidate as in "come up with a schema similar to the one I would have designed - not more complex than that and not more simple". I've seen way to many situations in which developers or other persons tried to design a complete schema in which every thinkable and unthinkable instance where covered. Which leads to an incredible amount of work implementing the application that is to use that schema. The more complex the schema, the more complex everything around it has to be which exponentially increases the amount of bugs. Designing applications "schema first" is a disastrous technique which will trigger the architecture astronauts in every developer. With your set of interview questions, you could very well miss a really skilled programmer because he or she understands that keeping stuff simple is hugely more important than not having denormalized data in the database.
- btilly 14y agoThose questions may be good for grilling candidates, but it is not how one would sketch up a fantasy game irl. Data point. This problem was suggested because one of the developers wrote that exact application as a weekend project, and that was exactly how he designed it - schema first. He noticed that it was both simple and interesting, and therefore was a possible fit for interviews. The right answer to all those questions are YAGNI and KISS. :) Believe me, I'm aware of that. Our favorite interviewees had answers with both of those characteristics. However a major source of real life complications is when YAGNI turns into, "oops, we did need it". And we were actively looking for how people handle that transition, so we asked the questions anyways. Interestingly, the right brand of KISS made that easy. But that is a different topic... But those answers aren't valid so the questions seem to be rigged against the candidate as in "come up with a schema similar to the one I would have designed - not more complex than that and not more simple". ALL interview questions are "rigged against the candidate". You know them, you know how they work, the candidate hopefully does not. The goal is not for the candidate to get the "right" answer - it is to see them exercise their skills. This is doubly true of open-ended design questions, which this definitely is. I've seen way to many situations in which developers or other persons tried to design a complete schema in which every thinkable and unthinkable instance where covered. Which leads to an incredible amount of work implementing the application that is to use that schema. The more complex the schema, the more complex everything around it has to be which exponentially increases the amount of bugs. Absolutely. One goal of this question was to identify and reject that kind of developer. I think we did a pretty good job at it. Designing applications "schema first" is a disastrous technique which will trigger the architecture astronauts in every developer. You apparently know only incompetent developers. My experience is the exact opposite. Competent developers will come up with simple schemas that solve the requested problem in a straightforward way. Furthermore when you're given a complicated spec for something you're supposed to build, the act of trying to lay out a schema for that spec is an excellent way to smoke out inconsistencies and hidden assumptions about how the application is supposed to work. Taking these back to the product manager lets you clarify things before you start writing code. Once that is sorted out, you have your data store designed, your front end in the spec, and a pretty reasonable idea how every layer between is likely to work. Finishing off a basic CRUD application from there is fairly routine. With your set of interview questions, you could very well miss a really skilled programmer because he or she understands that keeping stuff simple is hugely more important than not having denormalized data in the database. ANY set of interview questions is going to miss some really good programmers. For that specific team, the ones missed would generally have not been a fit in how that organization worked.
- RowanH 14y agoA long standing interview question I've used is "draw us an ERD for this domain" (orders/customer/products). It's what at first is a seemingly simple question to start drilling into understanding of systems "so if I was going to do X, what would you change in your ERD?" "how about if scenario Z was going to happen, would you change anything?" Strange how every now and then you get a "system architect" that can't answer that one.
- meaty 14y agoThat's usually because the architects don't give a shit about the storage model and recognise that the external interface/contract is far more important and that can be mapped to whatever schema supports the model. That's their domain. All they see is: "how can we ensure that this whole thing still works when someone does scenario X". The schema is almost 100% irrelevant to us and we have nearly 2000 tables in our system. We have two hibernate implementations which put that all behind a testable interface: something SQL can't give you on it's own.
- pdwetz 14y agoI don't envy your 2000 tables. Or hibernate, but if you have something that works for your team (and is testable) I'm not about to complain. As an architect, I will say that I do care about the storage model, but I'm obviously coming from a different place.
- mattmanser 14y agoThere's no difference between this and designing the classes first. Designing the classes first in an explicitly typed language actually works a lot better than designing a schema in a DB as you're not constrained by relational requirements and it's easier to change imo. Make a change to your classes and you can usually just right-click refactor, try and make a change to your SQL schema and it won't accept it at all until you unhook all the dependant tables. Basically, I don't really get what point you're trying to make. You never know your domain well enough to make a decent schema unless you've already written the program once before. Which is a pointless thought exercise where you get to point at flaws in someone else's nascent design. Like it sounds like you do in an interview, which is great for seeing their thought processes, but don't fool yourself that it's because of that design method. In other words, the reason it worked so well is because you had already built it once, nothing at all to do with your choice of schema first. In the end do what works for you, but schema first vs classes first is a trivial and pointless argument as both work fine.
- codewright 14y agoNot all of us use a language that has classes or where it's considered good taste to use classes to structure everything.
- ryeguy 14y agoUsing classes early on is just a technique to structure the data of your application. Even in a language without classes, you still have a way of representing your data that you could use. In C you would use structs, in a functional language you'd use a Type or whatever. You're mostly looking at a way to say "this entity belongs to this entity" and "this entity has many of this entity". That kind of thing. Classes or not, you still have a programming-level way of representing that. Even for languages that don't idiomatically have you use classes for everything, this is still where you would use them. If your language has classes, you should probably be using them for your entities and domain models. The place where you would use discretion by picking between classes or loose functions (like in python, php) is not the area you'd be sketching out in place of a database schema.
- jzwinck 14y agoSince your coworker liked that problem domain I'm sure you thought it was fun. But what about candidates? Ever have one like the poster in this same thread who doesn't like sports? What about female candidates? Would you agree there are likely to be gender and ethnicity biases in an interview question that discusses American sports? This of course assumes the actual job is not about sports.
- hugh4life 14y ago"What about female candidates? Would you agree there are likely to be gender and ethnicity biases in an interview question that discusses American sports?" Don't you agree there are gender and ethnicity biases in posing these questions?
- yummyfajitas 14y agoProgramming is about learning enough about a problem domain to model it with code. My last job involved women's fashion, which I (and my unfashionable male coworkers) don't give a crap about. My current job involves delivering local news to middle aged female suburbanites, which I (and most of my brooklyn hipster colleagues) are similarly uninterested in. My lack of interest in school closings in long island doesn't prevent me from making postgres reject articles without a title. If a developer can't ask questions and figure out enough about football to model the data reasonably well, he/she is a solid NO HIRE. (I'm also curious what you mean by "gender and ethnicity biases". Are hispanics/women incapable of understanding sports or something?)
- brazzy 14y ago> Are hispanics/women incapable of understanding sports or something? No, but many of them will lack prior knowledge about American Football and will have to work on understanding it at the same time as they work on understanding the application requirements. That means: given the same amount of intelligence and design skills, they'll take longer and probably appear less smart than someone who has that prior knowledge. It's exactly the kind of thing that creates cultural biases in IQ tests and makes them invalid: http://www.wilderdom.com/personality/intelligenceCulturalBias.html http://www.wilderdom.com/personality/intelligenceCulturalBia...
- thwarted 14y agoWe'd decide the schema, and once the schema was known, the CRUD application was fairly obvious and straightforward. "Show me your flowcharts [code], and conceal your tables [schema], and I shall continue to be mystified; show me your tables [schema] and I won't usually need your flowcharts [code]: they'll be obvious." ~ Fred Brooks