We are an online university of the 21st century. We want to use learners' engagement data from their learning activities to give recommendations about which courses to take next. For this purpose, we built a service and small dashboard around it for our product managers to look at.
This project uses the following technologies:
- TypeScript: For type-safe JavaScript development
- NextJS: A React framework for building full-stack web applications
- MongoDB: A NoSQL database for storing and retrieving data efficiently
These technologies were chosen for their scalability, performance, and developer-friendly features, which align well with our goal of creating a modern, data-driven education platform.
Simple TypeScript NextJS-based service containing a dashboard (app/page.tsx) to show data related to the service and 4 main endpoints (app/api/*):
GET /recommend/[userId]
- This endpoint creates and returns one recommendation based on userId and previously taken course types (use a simple heuristic).GET /recommendations
- This endpoint returns all the recommendations ever given.GET /engagements
- This endpoint returns all the engagements ever captured.GET /engage/[userId]/[courseId]
- This endpoint records one engagement.
Additional endpoints for debugging purposes:
GET /courses
- Show all coursesGET /users
- Show all usersGET /seed-data
- Populate db with seed data
- Fork this repo and clone it locally, run
npm i
to install the packages (Node 20+). - Set up a MongoDB Atlas account here and create a free M0 cluster. Copy connection string for the cluster.
- Create a
.env.local
file in the root directory with your MongoDB connection string (see.env.example
for the format). - Run
npm run dev
to start the development server. - Invoke the
http://localhost:3000/seed-data
endpoint to populate your Cloud MongoDB with initial data. - Open
http://localhost:3000/
to see the dashboard
-
User Engagement Table Improvement:
- In the dashboard (app/page.tsx), the User Engagement table currently contains User Id and Course Id as the first two columns.
- Modify it to show user name and course title in the table instead of ids.
-
Recommendation Engine Effectiveness:
- The
/recommend
endpoint contains a very simple heuristic about what to recommend. - Implement logic to calculate a metric for effectiveness of our recommendations.
- Show this metric in the dashboard.
- The
-
Course Performance Analysis:
- Implement logic to determine our best and worst courses.
- Show the top 3 and bottom 3 courses in the dashboard.
-
Production Readiness:
- What needs to be done to make this service production ready?
- Implement and/or document what you deem necessary. Consider aspects such as:
- Error handling
- Logging
- Performance optimization
- Security measures
- Code organization
-
(Optional) Deployment:
- Deploy your solution to Vercel.
- Add the deployment link to your README file.
- Share the forked private repository containing your implemented solution with @ishmidt-tou and @siddique-tou.
- Ensure the code can be run locally (given that the MongoDB connection string is provided).
- Include any of your notes, considerations, or things you wanted to do but didn't have time for in the README file.
- If you deployed it with Vercel, include the deployment link
We want to see and understand:
- Your ability to quickly understand a new codebase, adjust things, and create new functionality within the given code structure.
- Your proficiency in working with data, transforming business needs into data-driven solutions.
- Your coding skills, including code quality, documentation, and testing practices.
- Your understanding of system design and architecture principles.
- Your problem-solving approach and creativity in addressing the tasks.
We expect this assignment to take approximately 2-4 hours to complete. However, feel free to spend more time if you wish to add extra features or polish your solution. Please complete the assignment within one week of receiving it.
[Add your notes, considerations, or things you wanted to do but didn't have time for here]