Skip to content

Instantly share code, notes, and snippets.

@matoakley
Last active November 10, 2021 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matoakley/cf11ef4733ac24814ba61db5cd0b43b0 to your computer and use it in GitHub Desktop.
Save matoakley/cf11ef4733ac24814ba61db5cd0b43b0 to your computer and use it in GitHub Desktop.

Ruby Technical Evaluation

Code quality is very important to us. We're sending you this challenge so that we can evaluate your coding skills with Ruby.

What we expect from your code

  • Object-oriented
  • Clean code
  • Consistent style
  • Extensibility
  • Maintainability
  • Testability

The challenge

  • Write code to parse data represented in different formats and normalize to the following format:

    <first name> <city name> <birth date M/D/YYYY>

  • Write at least 2 specs, but no more than 5 - we don't expect 100% coverage

Instructions

  • Use the test framework you're most familiar with
  • Use anything you need from Ruby standard library
  • Don't use any gem to accomplish the solution (except test framework)
  • Don't worry about invalid input data

Template code

# File: app.rb

# WRITE YOUR CLASSES HERE

class PeopleController
  def self.normalize(request_params)
    # TODO
  end
end

PeopleController.normalize({
  comma: [ # Fields: first name, city name, birth date
    'Mckayla, Atlanta, 5/29/1986',
    'Elliot, New York City, 4/3/1947',
  ],
  dollar: [ # Fields: city abbreviation, birth date, last name, first name
    'LA $ 10-4-1974 $ Nolan $ Rhiannon',
    'NYC $ 12-1-1962 $ Bruen $ Rigoberto',
  ],
})

# Expected return (order of entries doesn't matter):
# [
#   'Mckayla Atlanta 5/29/1986',
#   'Elliot New York City 4/3/1947',
#   'Rhiannon Los Angeles 10/4/1974',
#   'Rigoberto New York City 12/1/1962',
# ]


# WRITE YOUR SPECS HERE

Deliverable

One file app.rb hosted in GitHub Gist. Please make the gist secret.

Don't worry about sending Gemfile[.lock]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment