Code Challenge - Backend Engineer Agaesh#212
Open
agaesh wants to merge 26 commits into99techteam:mainfrom
Open
Code Challenge - Backend Engineer Agaesh#212agaesh wants to merge 26 commits into99techteam:mainfrom
agaesh wants to merge 26 commits into99techteam:mainfrom
Conversation
- 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
Author
|
Completed Summation Problems1 Code Challenge |
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
…t act as new layer of security
- 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.
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.
Problem 4
Problem 5