Rails Developer for a Large Startup: My Vision of an Ideal Candidate

Posted by Alexey Kovyrin under Databases, Development, General, Links

Few days ago we were chatting in our corporate Campfire room and one of the guys asked me what do I think about Rails developers hiring process, what questions I’d ask a candidate, etc… This question started really long and interesting discussion and I’d like to share my thoughts on this question in this post.

So, first of all I would like to explain what kind of interviews I really hate :-) Ever since I was thinking of myself as of a developer (many years ago) and was going to “software developer position” interviews I really hated questions like “What is the name and possible values of the third parameter of the function some_freakin_weird_func() from some_weird.h” or “How to declare a virtual destructor and when it could be useful?”… All my life I had pretty practical thinking and never bothered to learn APIs or some really deep language concepts that are useful in 1% of the development time in really weird edge case situations. I always thought that a Real Engineer should know where to find an answer and should be able to find a way to implement something without knowing all possible ways to do it – engineering mind should be flexible!

So, if I’d interview a developer for our company, I’d never ask them this weird kind of theoretical questions because honestly speaking web development is not a rocket science and in most of the cases you don’t need to have a CS Master degree to be a good developer.

So, let’s get closer to our discussion in Scribd. During this discussion we were talking about our standard hiring practices, about questions we used to ask our candidates and such. As the result I decided to write a set of questions I’d really like an ideal candidate to be able to answer. Many of them are not rails specific, but rather high-load and high-scale specific. Let me share some of those questions here.

  1. You have a generic web application (does not matter if it is rails or not) with a set of layers and parties involved in each request:

    • Database
    • Application
    • Internet
    • User

    What security problems could occur on each level and what action should developer take to prevent those problems from happening? For example take a login action in your application and explain possible problems.

  2. You have a table with 100 millions of records, you need to make some changes in each records and it is obvious that you won’t be able to do that using some SQL queries, so you need to do in some application-level code (one time use script). Your database is MySQL.

    • Where would you put the code in the application: model, module with a bunch of methods, migration, some dedicated script?
    • How would you process all those records: Model.find(:all).each {}, a loop with different offsets and a limit, a loop walking through primary key values with some step, something else?
    • What would you choose for this task and why: Model.find or Model.find_by_sql? What is the major difference between those two? When would you definitely use find_by_sql?
    • What would you use: update_attribute, attribute assignments + saves, Model.connection.execute or something else to update the table? When and why would you use each of those?
  3. You have a rails action that accepts uploads and then transfers them to a pretty slow storage (S3, some slow nfs, something else). If you have a lots of uploads, pretty soon many of your mongrels (if not all) will be used for uploads and your application would become unusable. What options do you see to solve this problem?
  4. You have a huge table in mysql, you need to select a few randomly selected records (and this is not a one-time action, it’ll be used pretty often, like on the home page), how’d you do that?
  5. You have a document model with the following fields: id, user_id, title, body, created_at, views_count, download_count. There are 10000000 documents. You need to implement a download counters on your site so when one downloads a document, you’d increase the download_counter field. How would you implement counter management?
  6. How’d you write an SQL query to find all users in a system that have no docs (standard User has_many docs relationship)?
  7. Caching:

    • What kinds of caching techniques do you know?
    • What caching options does Rails provide, when would you use those?
    • What caching options does HTTP protocol provide?
    • You have a pretty popular action on your site which uses some heavy SQL query which should be cached. But the problem is that sometimes when the cache expires and too many users hit the action, all those SQL queries will start hammering the database trying to refresh your caches… That causes huge problems. How’d you try to solve the problem?

As you can see, these questions aren’t asking you about REST or new cool Rails buzzwords (ActiveResource, named_scope, etc, etc) because IMHO – you can learn those in a week of skimming through any rails-related mailing list. My questions are aimed at the most often happening problems in high-traffic startups where not all common practices could be used and you need to think before writing some code that’d be executed millions of times per day.

So, if you’ve read the questions and you think you know (or is able to find in Google/books/etc) answers and you think you know Rails I think you should contact us because we’re hiring. At this moment we need a few really great Ruby-developers that are not afraid of working on high-load web applications and who isn’t just a buzzword junkies, but a developers that could use their tools effectively.

For more information and more formal position information, please check out our jobs page or just email me with any questions related to these positions.

P. S. If you’re really good, we could work with you remotely w/o relocation to San Francisco (we have some team members in Canada and Ukraine now).


Related posts:

  1. Вышла Новая Версия Oracle SQL Developer (бывший проект Raptor)
  2. Fwd: Scorching hot Startup Needs Scalability Sorcerer and Optimization Freak
  3. Advanced Squid Caching for Rails Applications: Preface
  4. Loops plugin for rails and merb released
  5. FastSessions Rails Plugin Released

3 Responses to this entry