Full-stack Developer Quiz

This quiz tests your ability to:

Your Information

Question 1: Front end

Question 1.1

Go to jsfiddle.net, and paste in the markup given below into the HTML area.

<div class="grader">GRADER</div>
<div class="panda">panda</div>

Now enter just enough CSS (no HTML or JS!) to make the output look exactly like the following:

Hit 'Save' in the JSFiddle toolbar, which will redirect you to a unique URL for your work. Paste in that URL below.

Question 1.2

Make sure this checkbox is checked (yes, it's somewhere here).

Question 2: Command line tools

Download this PDF and, using the command line, generate PNG thumbnails that are each exactly 200px wide. Your solution should not be more than one line. Paste in your command below.

Question 3: Rails experience

Have you worked with Ruby on Rails before?

Question 4: Rails

Consider the following two models:

# == Schema Information
# Table name: users
#  id                     :integer          not null, primary key
#  email                  :string(255)
#  login_count            :integer
#  created_at             :datetime         not null
#  updated_at             :datetime         not null
class User < ActiveRecord::Base
    has_many :assignments
    validates :email, presence: true

# == Schema Information
# Table name: assignments
#  id                     :integer          not null, primary key
#  user_id                :integer          not null
#  title                  :string(255)      not null, default("")
#  created_at             :datetime         not null
#  updated_at             :datetime         not null
class Assignment < ActiveRecord::Base
    belongs_to :user

For the rest of the questions, assume you are in the Rails console.

Question 4.1

You are about to run this code:

user = User.create!

Question 4.2

You are about to run this code:

assignment = Assignment.create!

Question 4.3

Write one line of code to return the number of users with a 'berkeley.edu' email address.

Question 4.4

The following code should get the set of assignment titles (no duplicates) that belong to users who have logged in more than ten times. Using the dropdown below, describe how well the code performs this task.

Assignment.select { |a| a.user.login_count > 10 }.map { |a| a.title }.uniq

Suggest a fix or improvement.

Question 4: Debugging

Here is a Python function to compute a histogram of data, with equal-sized bins. Unfortunately, it doesn't work correctly, as you'll see in the stdout section when you run the code. The output of the broken version is shown below.

> data = [-3.2, 0, 1, 1.5, 1.6, 1.9, 5, 6, 9, 1, 4, 5, 8, 9, 5, 6.7, 9]
> print("Correct result:\t" + str([1, 6, 4, 6]))
> print("Your result:\t" + str(histogram(data, num_bins=4)))

Correct result: [1, 6, 4, 6]
Your result:  [7, 12, 17, 17]

Your task is to make minimal changes to make it work correctly, and paste in the unique URL that is generated when you "Run" the code.

Question 5: Your projects

Tell us about something you've built that you're proud of. If you can, please include a link (to a demo, pictures, code, etc.).