This repository is intentionally scaffolded for a pairing interview.
The setup works out of the box, but tests are currently failing by design.
Candidates should get all tests to pass.
- Backend: Django + SQLite
- Frontend: Vanilla JavaScript + Vitest
Task order for this round:
Frontend test 1: Implement
arrayToObjectinfrontend/src/01-array-to-object.js.- Convert an array of objects into an object keyed by
id. - Preserve all non-
idproperties in each value. - Use
nullwhen an item only hasidand no additional properties. - Handle empty arrays.
- Convert an array of objects into an object keyed by
Backend test 1: Implement
xml_file_countinbackend/interview_app/models.pyand related workflow logic.- Add
xml_file_counttoUser. - Count only associated
Filerecords withfile_type="xml". - Keep the field updated when
Filerecords are created, updated, or deleted. - Ensure tests in
backend/interview_app/test_01_xml_file_counter.pypass.
- Add
Frontend test 2: Implement
createDebouncedSearchinfrontend/src/02-debounced-search.js.- Input should initialize from
searchValue. - Input should update when
searchValuechanges. - Search should be debounced and call
onSearchwith latest input. - Show a loading indicator while async search is in progress.
- Support lifecycle-like behavior via returned
updateanddestroymethods.
- Input should initialize from
Run backend tests:
cd backend
python -m pip install -r requirements.txt
python manage.py testRun frontend tests:
cd frontend
npm install
npm testBackend API server:
cd backend
python manage.py runserverFrontend app:
cd frontend
npm start