Complete the assessment in 3 days or otherwise stipulated. Do read the following details carefully and thoroughly for the requirements. If you have any queries on the assessment you may ask your interviewer for the contact. If you need time extension do request from your interviewer.
Create a React/Svelte frontend in Typescript and NodeJS web backend in Typescript/Javascript with the following functionalities.
-
Upload a CSV file with appropriate feedback to the user on the upload progress. Data needs to be stored in a database.
-
List the data uploaded with pagination.
-
Search data from the uploaded file. The web application should be responsive while listing of data and searching of data.
-
Proper handling and checks for the data uploaded.
-
Real-time collaboration. The application must support two browser sessions simultaneously editing/searching the same dataset. When one user uploads a new CSV that overlaps with existing records (matching by a unique identifier in the data), the application must:
- Detect duplicate/conflicting records
- Display a real-time diff UI (without page refresh) showing what changed between the old and new data
- [Optional] User can be allowed to choose to which version of the data to keep. Tha updates should also be reflected in real-time(within 3 seconds).
In your submission, must include the following:
-
Use this csv file as the sample
-
Include unit tests with complete test cases including edge cases.
-
Provide a git repository for us to assess your submission.
-
Provide a docker compose file to run the necessary components for your application.
-
Provide a readme in the git repository on how to setup and run the project.
- You will be expected to run and demo your application running the docker compose file during the interview.
- During the demo, two browser tabs/windows should be opened and you will be required to perform the conflicting uploads simultaneously. You must explain every design decision in their conflict resolution strategy.
Requires Docker and Docker Compose v2.
docker compose up --buildOpen http://localhost:8080. Postgres is exposed on localhost:5432 for debugging.
The web container serves the built React app via Nginx and proxies /api and /socket.io to the api service.
Stop and remove containers:
docker compose down-
Start PostgreSQL 16+ and create a database (or use the
dbservice only:docker compose up db). -
Backend:
cd backend npm install export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/csvcollab" export CORS_ORIGIN="http://localhost:5173" npm run dev
-
Frontend (new terminal):
cd frontend npm install npm run devOpen http://localhost:5173. Vite proxies
/apiand WebSocket traffic to the backend on port 3001.
Use the provided data.csv. The business unique key is the CSV column id (distinct from the Postgres surrogate key).
| Method | Path | Description |
|---|---|---|
GET |
/api/health |
Liveness |
POST |
/api/upload |
multipart/form-data field file (CSV) |
GET |
/api/records?page=&limit=&q= |
Paginated listing and ILIKE search |
GET |
/api/conflicts |
Open conflict queue |
POST |
/api/conflicts/resolve |
JSON { batchId, recordId, choice: "keep_old" | "keep_new" } |
Clients join room collab on connect. Events:
collab:conflicts— new overlapping rows detected after an upload (diff payload +batchId).collab:records_updated— inserts or post-resolve refresh signal.collab:resolved— a conflict was resolved.
The UI refetches /api/records and /api/conflicts on these events so a second browser tab updates without a full page reload.
- Rows are validated with Zod (required fields, basic email shape, no empty
body). - Duplicate
idvalues inside one upload are rejected. - New
idvalues are inserted immediately. - Existing
idvalues with identical field content are counted as skipped unchanged. - Existing
idvalues with any differing field become a pending conflict: stored inpending_conflicts, broadcast over Socket.IO, and shown as a per-field diff. Users may keep stored or keep incoming;keep_newbumpsversiononrecordsso collaborators can see data changed.
cd backend && npm testCovers diff detection and validation edge cases (invalid email, empty body, duplicate ids in file).