README

Hi,

Based on your application for the position of Ruby On Rails developer [Internship leading to a full-time job], we have selected your profile. As the first round of an interview, we are assigning you a task, based on which we will evaluate your profile for further technical rounds.

Below are the details of the task you need to develop,

Task:

  1. Backend:

Create a Rails application with routes for: - Creating posts: POST /posts - Creating comments: POST /posts/:post_id/comments - Getting all posts: GET /posts - Getting a specific post: GET /posts/:post_id - Implement a database model for posts and comments. Implement logic to: - Validate user input for posts and comments. - Store posts and comments in the database. - Calculate and update the total comment count for each post. - Retrieve posts with their associated comments and comment count. - Implement error handling and proper responses for different scenarios.

  1. Frontend:

    • Create a simple HTML form for creating posts.
    • Submitting the form to create a post.
    • Displaying existing posts with their titles, content, and comment count.
    • Providing a way to add comments to each post.
    • Updating the comment count dynamically.
  2. Bonus Features:

    • Implement user authentication and authorization to restrict access to creating posts and comments[ Devise Gem ].
    • Add pagination to display a limited number of posts on each page.

The interviewer will evaluate your understanding of the problem, your coding skills, and your ability to design and implement a well-structured and maintainable solution. They will likely ask questions about your design choices, technology stack, and how you handled specific challenges. Be prepared to explain your code, discuss potential improvements, and answer questions about your development process.

NOTE:

  • There's no need to complete the task 100%, but please do your best to address it.

  • Please try to upload your task to a GitLab repository and share the link with us. Alternatively, you can zip the project folder and send it to us.

Solution Video

Soution Video