Skip to content

nguyenvinh1711/ShinyBoxInteractiveInc-test4-exam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Take‑Home Assessment

Welcome, candidate! This project contains intentional issues that mimic real‑world scenarios. Your task is to refactor, optimize, and fix these problems.

Objectives

🔧 Backend (Node.js)

  1. Refactor blocking I/O

    • src/routes/items.js uses fs.readFileSync. Replace with non‑blocking async operations.
  2. Performance

    • GET /api/stats recalculates stats on every request. Cache results, watch file changes, or introduce a smarter strategy.
  3. Testing

    • Added unit tests (Jest) for items routes (happy path + error cases).

💻 Frontend (React)

  1. Memory Leak

    • Items.js leaks memory if the component unmounts before fetch completes. Fix it.
  2. Pagination & Search

    • Implement paginated list with server‑side search (q param). Contribute to both client and server.
  3. Performance

    • The list can grow large. Integrate virtualization (e.g., react-window) to keep UI smooth.
  4. UI/UX Polish

    • Feel free to enhance styling, accessibility, and add loading/skeleton states.

📦 What We Expect

  • Idiomatic, clean code with comments where necessary.
  • Solid error handling and edge‑case consideration.
  • Tests that pass via npm test in both frontend and backend.
  • A brief SOLUTION.md describing your approach and trade‑offs.

Quick Start

node version: 18.XX

nvm install 18
nvm use 18

# Terminal 1
cd backend
npm install
npm start

# Terminal 2
cd frontend
npm install
npm start

The frontend proxies /api requests to http://localhost:3001.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •