👋🏽 Hello there! Congratulations on being shortlisted for an internship opportunity at NxtJob. This document outlines your task, which should be ideally submitted within 5 days.
To advance in this opportunity, complete the following tasks and submit a PR (Pull Request) to this repository.
Firstly, clone this repository or download it as a zip file. Inside the repository, you'll find a folder named intern_challenge
. Make a copy of this folder and rename it to your full name, using snake_case for spaces (for instance, john_doe). Inside this folder, you will find two 'answers.txt'
files located in the 'technical'
and 'non_technical'
subfolders. Edit these files with your responses.
The coding task should be executed within a subfolder named 'coding_tasks'
. Start by initializing your backend project here.
- Explain, in your own words, the importance of data consistency in real-time applications.
- How do you handle concurrency issues in a multi-user environment?
- Describe a scenario where you had to optimize database queries for better performance.
- Discuss the trade-offs between using WebSockets and HTTP/2 for real-time communication.
- How do you stay updated on backend development topics and remain active in the community? (Forums/Discord/Slack/Meetups/Twitter/Blogs)
- What are your most-used IDE and keyboard shortcuts when coding?
- How do you approach the design and implementation of a scalable backend system? Feel free to attach code snippets for better explanation.
Your task is to build the backend of a simplified real-time collaborative document editor, similar to Google Docs. This application will handle user authentication, document management, real-time collaboration, version control, and permissions.
- Initialize your project in the
coding_tasks
folder. Your code will reside inyour_full_name/coding_tasks folder
. - Design your database schema using Prisma/Drizzle ORM and set up your database on MySQL.
- Implement the backend features listed below, ensuring to follow best practices for security, scalability, and performance.
- Commit your code regularly with clear, and descriptive commit messages :)
Backend: Hono for the serverless API, MySQL Database with Prisma/Drizzle ORM, Cloudflare Workers for serverless functions, and WebSockets for real-time updates.
- User Authentication: Implement secure user registration and login. Use Clerk.dev for this.
- Document Creation: Allow users to create, edit, and delete documents.
- Real-time Collaboration: Enable multiple users to collaborate on the same document in real-time using WebSockets.
- Version Control: Implement a basic version control system that tracks changes made to documents.
- Permissions Management: Allow users to share documents with others, setting permissions (view, edit) for each collaborator.
- Change Notifications: Send notifications to users when a document they have access to is edited.