Skip to content

hiremav/ruby-fullstack-coding-challenge-bry

Repository files navigation

Senior Full-Stack Ruby Engineer Coding Challenge

Thank you for applying for the Senior Full-Stack Ruby Engineer role at Mav!

This document outlines the coding challenge that we would like you to complete. We look forward to seeing what you create!

Instructions

This repo contains a freshly initialized Rails application with PostgreSQL, Redis, and Sidekiq. See the Development Setup section below for how to use it.

Your goal is to implement a simple chat interface similar to ChatGPT, that allows a user to chat with an LLM.

When a user types a message, a background job should call the OpenAI API to generate a response. The UI should automatically update (without a page reload) to show the response when it’s ready. Users should be able to continue chatting in this way. Reloading the page should not reset the conversation.

Develop your solution in this repository. Once ready, open a PR against the main branch.

Requirements

  • Use an LLM via the OpenAI API

    You will be provided with an OpenAI API key to use. Please be responsible with it.

  • Implement background processing with Sidekiq

    Messages should enqueue a Sidekiq job that calls the OpenAI API and updates the chat with the generated response.

  • Live UI update (no page reload)

    Use Hotwire (Turbo Streams) so the view updates automatically when the background job completes.

  • Show your work

    Keep in mind that we'd like to see multiple commits rather than one. This allows us to see how you approach the problem. Please commit your work as you go, however messy it may be.

  • Include documentation

    Include handwritten (not generated by AI) documentation in your PR or a separate file. Please cover:

    • A summary of your solution – How it works end-to-end. Key models/controllers/jobs, error handling, testing approach, any tradeoffs/limitations, etc.
    • Testing instructions - How to manually and/or programmatically test your solution.
    • Coding assistance used - We expect and encourage you to use any development tools to aid you, including AI coding assistance. Please tell us about what tools helped you with your solution and how you used them.
    • Any other notes - Anything else that you think we should know about your solution.

Evaluation criteria

This challenge is intended to be an open-ended way to showcase your skills. Ultimately, we want to see thoughtfulness, creativity, and attention to detail.

That said, we will roughly evaluate your solution based on the following:

  • Code quality – Readability, organization, and maintainability of your Rails, Sidekiq, and Hotwire code.
  • Communication quality – Clarity and completeness of your summary and documentation.
  • Functionality – Creating a message enqueues a job, the response is generated via OpenAI, and the UI updates live when ready. We will not judge UI design.

Time constraints

This challenge is intended to cover 1–3 hours. We understand that your time may be limited and we do not expect or ask you to go beyond that.

If time constraints prevent you from finishing everything you planned, please submit what you have so far and make sure to include notes, comments, or documentation describing how you would improve your solution with more time.

There is no hard deadline on submitting your solution, but please communicate with us about when we can expect it.

How to contact us

If you have any questions about the coding challenge or need to contact us for any reason, email [email protected].

Development Setup

The repository includes a Docker-based development environment that bundles Rails, PostgreSQL, Redis, and Sidekiq. You only need Docker and Docker Compose installed locally.

First-time setup

docker compose build
docker compose run --rm web ./bin/rails db:prepare

Running the stack

docker compose up

The Rails server will be available at http://localhost:3000. Sidekiq will start in a separate container and watch the default queue.

Running Rails commands

Prefix commands with docker compose run --rm web, for example:

docker compose run --rm web ./bin/rails db:migrate
docker compose run --rm web ./bin/rails test

Stopping and cleaning up

docker compose down
docker compose down --volumes  # remove Postgres and Redis data

Happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published