Skip to content

Comments

~4 hours code#1

Merged
grillermo merged 30 commits intomasterfrom
under-4-hours-code
Jan 12, 2026
Merged

~4 hours code#1
grillermo merged 30 commits intomasterfrom
under-4-hours-code

Conversation

@grillermo
Copy link
Owner

@grillermo grillermo commented Dec 17, 2021

Requirements covered:

  • User sign up/sign in
  • A member can be created using their name and a personal website address.
  • When a member is created, all the heading (h1-h3) values are pulled in from the website to that members profile.
  • The website url is shortened (e.g. using http://goo.gl).
  • After the member has been added, I can define their friendships with other existing members on the members/view
  • The interface should list all members with their name, short url and the number of friends.
  • Viewing an actual member should display the name, website URL, shortening, website headings, and links to their friends' pages.
  • Now, looking at member's profile, you can find experts in the application who write about a certain topic and are not already friends of the member.

Missing requirements

I added this requirement in another PR:

  • The results should show the path of introduction from Alan to the expert e.g. Alan wants to get introduced to someone who writes about 'Dog breeding'. Claudia's website has a heading tag "Dog breeding in Ukraine". Bart knows Alan and Claudia. An example search result would be Alan -> Bart -> Claudia ("Dog breeding in Ukraine").

Technical decisions

  • I decided to use a memory_store cache and not redis or memcache to make it easier for the reviewer to run the code and not add another major dependency.
  • Also i went with sucker punch and not Sidekiq to avoid adding the broker dependency(again, Redis)

Reviewer Setup

  1. Clone the candidate's branch

  2. Execute the following:

     bin/bundle
     bin/rails db:drop
     bin/setup
     bin/rspec
    
  3. Make a copy of the rubric and fill it in

  4. Ensure that the requests specs are the same or improved

  5. Add a short summary to the Rubric and share it in our engineering-coding-projects Slack channel

    I also converted the application from an API only to a regular rails app, assuming that a backend challenge would also be ok without the heavy frontend work needed to use an API.
    The command was
    rails new backend-challenge
    That overrides the existing files and adds the missing ones to have a regular frontend + backend rails app.
nicer alternative to erb
Substitute default rails welcome page
We are already testing the behavior on the members controller spec but still...
Devise already tests the authenticate_member! method we are using so we don't need to test it again
It will handle the authentication

The code is the result of running
rails generate devise:install
rails generate devise Member
Our .rspec file already requires the spec_helper on every spec file so move all the test config there to avoid having to require it on every file individually
It provides a classless styles, so good defaults with minimal changes to the markup
I went with sucker punch and not Sidekiq to avoid adding the broker dependency(again, Redis) and to allow easy testing for the reviewer
It will be used to store the member headings
We will be accessing urls so we need a way to record the results to have a completely offline test suite
This job will pull the headings for a member to be called after the member creation
We need to override the Devise controller to be able to access the newly created member
Part of the requirements, i used my own personal url shortner chiq.me
@grillermo grillermo changed the title Under 4 hours code ~4 hours code Dec 17, 2021
@grillermo grillermo mentioned this pull request Dec 19, 2021
@grillermo grillermo merged commit 1424701 into master Jan 12, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant