Tuesday, February 15, 2011

Google Interview Question: "Explain a database in three sentences to your eight-year-old nephew."

[Reposted from my non-SQL blog.  Apologies to the handful of readers who follow both.]

From this list of Google interview questions, I found the question: "Explain a database in three sentences to your eight year old nephew."  Here's my attempts.

Attempt 1: Trying to Capture Third Normal Form
  1. On a sheet of notebook paper, make a list of all your video game systems, and number them 1 through whatever.
  2. On another sheet of paper, make a list of all your video games, also numbered 1 through whatever.
  3. For each video game, find the game system that it goes with on the first list, and write the number from the first list next to the game on the second list.
Attempt 2: Eight-year-olds Are Still Kinda Into Santa
  1. Santa has a list of every kid in the world, which includes the kid's name, address, age, and naughty/nice score.
  2. Santa has another list of every toy in the world-- how much it costs, what color it is, how much it weighs (for the sleigh).
  3. Santa has a special "many-to-many" list with just the kid-number and toy-number, to keep track of which kids want which toys, so it's really easy to figure out things like how many of each toy he needs to buy.
Attempt 3: They Learn This Stuff in the Womb, I Swear
  1. You know how you implemented MongoDB for the social networking site you wrote last year, after the metadata structure got sufficiently gnarly for a simple key/value store, and users were demanding the ability to search on any attribute?
  2. Well, when I was a kid, we had these things called Relational Database Management Systems, which were really good at enforcing relational integrity (which was important because the computers still depended on algorithms instead of magic like they do today) but you had to know a thing or two about relational data design, and the RDMS got kind of slow when everyone on the planet started uploading holographic 3D videos of what they had for lunch every day.
  3. Now go get your Uncle S  a beer.

1 comment:

  1. Here is mine.