[FE] Code challenge - Nguyen Ha Duy#266
Open
duyngha wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Solutions for code challenge problems 1–3.
sum_to_n(n)implementationsWalletPageProblem 1 —
sum_to_nThree distinct implementations of
sum_to_n(n)insrc/problem1/index.js:sum_to_n_aforloopsum_to_n_bn*(n+1)/2sum_to_n_cRun:
See
src/problem1/README.mdfor tradeoffs.Problem 2 — Currency Swap Form
A polished, Swap UI in
src/problem2/.Stack: Vite + React 19 + TypeScript + Tailwind CSS v4, with shadcn/ui.
Features:
Run:
cd src/problem2 npm install npm run devProblem 3 — WalletPage Refactor
Code review and refactor of the provided snippet, in
src/problem3/.README.md documents 14 issues grouped by severity:
WalletPage.tsx is a clean reference refactor: priority lookup map hoisted out of the component, two memos split by dependency (filter/sort uses only balances; format/USD uses prices), stable keys on currency, no any, no dead code.
This folder is intentionally not a runnable app — imports reference assumed host-app symbols (@mui/material, hooks, WalletRow). See the README for full details.