Welcome to the Wise Frontend Engineer coding assessment. This is a 45-minute coding challenge designed to evaluate your skills in state management, performance optimization, and Next.js 15+ architectural patterns.
You will be working with a Depot Manager dashboard that displays a list of distribution depots. Your task is to implement the core functionality that makes this application fully functional.
The following has been prepared for you:
- ✅ API route (
src/app/api/depots/route.ts) - Returns mock depot data with a 500ms delay - ✅ Zustand store (
src/store/useDepot.ts) - State management setup with persist middleware - ✅ UI Components - All visual components are built and styled:
DepotCard- Displays depot information with capacity progress barSearchBar- Search input fieldSearchHistory- Recent search terms as clickable pills
- ✅ Dashboard page (
src/app/depots/page.tsx) - Complete UI layout
You need to implement three core features:
Wire up the fetchDepots function in the Zustand store to:
- Set
isLoadingbefore/after fetching to display a loading state - Call the
/api/depotsendpoint - Update the
depotsstate with the response - Handle any errors appropriately
Location: src/store/useDepot.ts - fetchDepots function
Trigger: Call this function in useEffect on the depots page
Connect the search input to the store:
- Update the search term state as the user types
- Filter the depots list based on the search term (search by name or location)
- When a user performs a search (e.g. presses Enter or clicks 'Search'), add the term searched to
recentSearchesusingaddRecentSearch
Location: src/app/depots/page.tsx - Search functionality and filtering logic
Complete the addRecentSearch function in the store:
- Add new search terms to
recentSearches - Avoid duplicates (if a term already exists, move it to the front)
- Limit the history to a reasonable number (e.g. 5 recent searches)
- Ensure clicking a search history pill updates the search input and filters the list
Location: src/store/useDepot.ts - addRecentSearch function
- Navigate to
/depotsto see the dashboard - Review the code structure and understand what's already implemented
- Look for
// TODOcomments in the code - these mark where you need to add functionality - Implement the three tasks above
- Test your implementation thoroughly
- Next.js 15+ - App Router
- React 19 - Server and Client Components
- Zustand 5 - State management with persist middleware
- TypeScript - Full type safety
- Tailwind CSS - Styling (dark mode supported)
You have 45 minutes to complete this assessment. During the assessment, you may use the interviewer as a Product Owner to clarify requirements or ask questions. For the solution, you should focus on:
- Getting the core functionality working
- Handling the hydration issue
- Writing clean, maintainable code
- Considering performance and edge cases
Good luck!