Skip to content

Code Challenge - Backend Engineer Agaesh#212

Open
agaesh wants to merge 26 commits into99techteam:mainfrom
agaesh:feat/problem1-summations-agaesh-backend-engineer
Open

Code Challenge - Backend Engineer Agaesh#212
agaesh wants to merge 26 commits into99techteam:mainfrom
agaesh:feat/problem1-summations-agaesh-backend-engineer

Conversation

@agaesh
Copy link

@agaesh agaesh commented Feb 11, 2026

Problem 4

  • Implemented sum_to_n_a (for loop), sum_to_n_b (Array.reduce), and sum_to_n_c (recursion)
  • Exported all summation functions from summation_solution.js
  • Added /problem4 endpoint in index.js to return results from all three methods
  • Verified server responds with JSON output for summation results

Problem 5

  • Added Problem 5 CRUDE server
  • Added Test Cases from problem 5

- Implemented sum_to_n_a (for loop), sum_to_n_b (Array.reduce), and sum_to_n_c (recursion)
- Exported all summation functions from summation_solution.js
- Added /problem1 endpoint in index.js to return results from all three methods
- Verified server responds with JSON output for summation results
@agaesh
Copy link
Author

agaesh commented Feb 11, 2026

Completed Summation Problems1 Code Challenge

@agaesh agaesh changed the title feat(problem1): complete summation solutions and integrate endpoint feat(problem4): complete summation solutions and integrate endpoint Feb 11, 2026
@agaesh agaesh changed the title feat(problem4): complete summation solutions and integrate endpoint Code Challenge - Backend Engineer Agaesh Feb 11, 2026
agaes added 24 commits February 12, 2026 12:03
…r database, express-router for handling user routing and nodemon in dev dependency to start the program in cmb USING npm run dev
- Added CrudUser.js with full create, read, update, delete routes with filter capabilities in GET method
- Integrated db.js for SQLite database connection
- Updated index.js to mount routes at /problem5/users
1. Implemented scoreboard showing top 10 user scores.
2. Added live update via WebSocket broadcast.
3. User action increases score via API call.
4. API updates DB and dispatches leaderboard update.
5. Security/authorization not yet implemented.

Files committed:
- Client.js → listens on port 3000 for real-time leaderboard updates
- src/problem/QuizAndAns.js → added quiz questions, options, and answers to drive score increments
- src/problem/Architecture.js → defines Problem6 routes:
    • /problem6/leaderboard
    • /problem6/submit-quiz

Packages used:
- ws (WebSocket server/client)
- better-sqlite3 (database)
…quiz submission

- Added JWT-based middleware to authorize requests
- Only authenticated users can submit quiz answers
- Secret key stored securely using dotenv
- Prevents unauthorized access and mitigates malware-style attacks
- Introduced per-user and per-IP rate limiting to quiz submission routes in Architecture.js
- Strengthened protection against abuse and spam by enforcing submission quotas
- Removed outdated `express-limit` dependency
- Added and configured `express-rate-limit` as the modern, secure replacement
- Added auditLogger to record events into a file
- Introduced getClientIp helper to normalize IPv4 addresses for logs
- Integrated logging into quiz submission route for attempts, success, and errors
- Applied logging in authorization middleware to capture access attempts and failures
- Strengthened Problem 6 against potential misuse and suspicious activity
- Implemented QuizValidator.js using Joi to enforce strict schema validation
- Ensures answers array contains valid questionId (integer) and answer (string) in QuizValidator
- Integrated validation into submit-quiz route before processing logic
- Strengthened input sanitization as a security measure for Problem 6
Updated the readme.md for security enhancements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant