Giter VIP home page Giter VIP logo

jingle-punks-developer-test's Introduction

Jingle Punks Developer Exam

We're really excited that you've made it this far in the process!
The resources you'll find in this repo will help you answer the following questions:

HAML

Over 86% of our markup is haml so it'll be important to get up to speed with haml as soon as possible. I've added rendered markup from our contact page.

  • Convert ./haml/contact.html into ./haml/contact.html.haml

ANSWER:

  • haml/contact.html.haml

SQL

We're a MySQL shop so this test is MySQL centric. The './sql/setup.sql' file contains 'creates' and 'inserts' that only work for MySQL databases.
Also, though questions (1) & (2) are standard SQL questions, question (3) must be answered for MySQL databases.

** If you're a Postgres user, you'll have to perform your own translations to get the schema into your local db. **

Based on the schema & data ...

  1. Find the users who are either a 'writer' or an 'editor' (You can only use the keyword 'SELECT' once):

REQUIRED OUTPUT COLUMNS:

  • user id,
  • first name,
  • last name,
  • role name,
  • state

ANSWER:

  • writersandeditors.sql
  1. Find the count of all users WITHOUT addresses that are 'writers' and have '9' in their 'first_name' (You can only use the keyword 'SELECT' once):

REQUIRED OUTPUT COLUMNS:

  • 'homeless writers'

ANSWER:

  • homelesswriters.sql
  1. Add indexes that would make the query in question 2 run faster.

ANSWER:

  • indexes.sql

RAILS

The models in this folder correspond to the database we created in the SQL section. Please perform the following tasks and add your work to the ./rails folder:

  1. Create 2 Named Scopes that, when chained, can return all 'admins' that live in a specific state. Here are some example result sets the scopes should be able to get:
  • Scope1: All of the 'writers'
  • Scope2: Everyone that lives in 'FL'
  • Scope1 + Scope1: All of the 'editors' that live in 'MA'

ANSWER:

  • rails/user.rb
  1. Add validation on the Address model.
  • We should only create an Address record if the zip code contains 5 numbers.

ANSWER:

  • rails/address.rb
  1. Write 2 UNIT tests to confrim that your validation in Question(2) works. Those test should...
  • Confirm that VALID records PASS validation and CAN be created.
  • Confirm that INVALID records FAIL validation CANNOT be created.

ANSWER:

  • rails/test/unit/address_test.rb
  1. The relationship between Users and Roles is pretty limited.
  • Update the relationship in 'user.rb' & 'role.rb' to allow a single user to have multiple roles.
  • Create any new files you'll need.

ANSWER:

  • rails/role_user.rb
  • rails/role.rb
  • rails/user.rb
  • rails/db/migrate/create_role_users.rb
  1. Write a data migration script (in Ruby or SQL) that updates the existing records in the database to use the new code you created in Question (4).

ANSWER:

  • rails/db/migrate/create_role_users.rb
  • rails/lib/tasks/populateRoleUsers.rake

BONUS RUBY QUESTION

You don't have to answer this one, but if you wanted to, it'd be cool :)

Create a ruby deamon that monitors a domain (ex: www.google.com) in ./ruby . It should...

  • Ping every 5 seconds.
  • If the script doesn't get the response it expects, it should email '[email protected]'.
  • For Bonus Bonus Points: Report the isssue via growl using the 'ruby-growl' gem instead of sending an email.

ANSWER:

  • ruby/daemon.rb

jingle-punks-developer-test's People

Contributors

abelmartin avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.