This repository contains my solutions for the 99Tech code challenges 1–3.
- File:
src/problem1/index.js - Description: Implements three methods to sum numbers from 1 to
n:- Loop-based (
sum_to_n_a) - Recursive (
sum_to_n_b) - Array reduce (
sum_to_n_c)
- Loop-based (
- Notes: It is assumed that only positive integers are accepted as input. Thus, input validation rejects zero or negative integers.
-
Folder:
src/problem2/ -
Description: A React + Vite project that implements a currency swap form.
- Uses
shadcn/uicomponents andtailwindcss. - Fully responsive for mobile and desktop.
- Includes a swap confirmation dialog with loading and success toast.
- Includes a simple toggle button for switching light/dark mode.
- Uses
-
How to run:
cd src/problem2 npm install npm run dev
- File:
src/problem3/index.tsx - Description: Refactored version of the provided messy React code.:
- Contains in-line comments for specific fixes.
- explanation.txt summarises all issues identified and solutions applied.
- Notes:
- Standalone TypeScript file, assumes existence of useWalletBalances and usePrices hooks, as well as WalletRow component.
- I created a minimal React project for Problem 3 to easily debug and visually verify the refactored component, even though the solution itself is a standalone TypeScript file.