Skip to content
A gem for job interview type problems
Find file
New pull request
Latest commit d66ed33 @canweriotnow canweriotnow Merge pull request #21 from zetsubo/master
updating deprecated 'source :rubygems'

Job Interview

Build Status Dependency Status Code Climate Coverage Status Gem Version


Let's face it. Programmer job interviews can be annoying. And sometimes the questions require you to actually think. With Job Interview, most programming interview questions can be answered in 3 lines of Ruby.

You can view the slides from our RailsConf 2012 lightning talk about job_interview here.


require 'job_interview'
@answer =

# FizzBuzz
 => [1, 2, "Fizz", 4, "Buzz"]

# Fibonacci numbers (default: recursive strategy)
 => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]

# Fibonacci numbers (iterative strategy)
@answer.fib(10, :iterative)
 => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]

# Fibonacci numbers (using matrices)
@answer.fib(10, :matrix)
 => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]

# Quine
 => "@answer.quine"

# The first n primes
 => [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]

# Hello, World!
 => "Hello, World!"

# Knapsack problem
@answer.knapsack([[4, 3], [1, 2], [6, 4]], 7)
 => 6

Now, job_interview will help you answer non-technical interview questions as well! Simply call the appropriate method, and a randomly constructed answer will pop out.

include JobInterview::Questions

Q. Where do you see yourself in five years?


 => "I'd like to have made someone else rich with my re-contextualized non-volatile open architecture."

Q. Why are you leaving your current position?


 => "I'm seeking to optimize extensible applications."

Q. Why are manhole covers round?


 => "Because Reuleaux Triangles are hard to manufacture."

Q. What is you greatest weakness?


 => "I always fail so rarely so I make too much money."

Q. Why do you want to work here?


 => "Your company has revolutionized seamless next generation interface."

Q. Does P = NP?


 => "I doubt it, but it would make life easier for traveling salesmen."

Q. Please tell us, in a few words, about what interests you?


 => "I have a special interest in modular mobile startup platforms."


Q. Why would you even do this?

A. We wanted to hack on something trivial and silly at BohConf 2012. Also, most job interviews are dumb, and we felt the need to point this out.

Q. Do you expect this of be of any use to anyone, ever?

A. No.

Q. So what's next?

A. The Ruby implementation of job_interview is pretty decent at this point, we think. But maybe you're not applying for a Ruby job. So a Clojure implementation seems likely, possibly to be followed by JavaScript.

How do I get it?

At RubyGems, of course


Micah Gates

Jason Lewis

Contributions by:


Joel Parker Henderson

The authors would also like to thank:


Really? You have that much time on your hands? Awesome!

Two guidelines, though:

  • Please include a test for any patches you submit. Job interviews are Serious Business, and we need to make sure the code is correct.
  • We're not that into adding more questions to JobInterview::Questions. So please don't target that module unless you're certain your patch is SUPER funny.


Copyright (C) 2012 Micah Gates and Jason Lewis

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

Something went wrong with that request. Please try again.