Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/problem4/node_modules/
src/problem5/node_modules/

78 changes: 75 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,82 @@
# 99Tech Code Challenge #1 #
# 99Tech Code Challenge #1

Note that if you fork this repository, your responses may be publicly linked to this repo.
Please submit your application along with the solutions attached or linked.
Please submit your application along with the solutions attached or linked.

It is important that you minimally attempt the problems, even if you do not arrive at a working solution.

## Submission ##
## Submission

You can either provide a link to an online repository, attach the solution in your application, or whichever method you prefer.
We're cool as long as we can view your solution without any pain.

# Code Challenge

## Requirements

- Node.js >= 18
- npm

## Running the Solutions

Clone the repository:

```bash
git clone <your-repository-link>
cd code-challenge
```

---

## Problem 4: Three Ways to Sum to N

This problem demonstrates different approaches to calculate the sum from 1 to N.

```bash
cd src/problem4
npm install
npm run dev
```

---

## Problem 5: A Crude Server

A simple backend server implementing CRUD APIs.

```bash
cd src/problem5
npm install
npm run dev
```

Server will start at `http://localhost:3000`

---

## Problem 6: Architecture

This section contains system design diagrams.

```bash
cd src/problem6/docs
```

Open the following files:

- `architecture.png` - High-level system architecture
- `sequence.png` - Request flow / sequence diagram

Additional notes are located at:

```bash
cd src/problem6
```

---

## Notes

- Each problem is independent and can be run separately.
- There are no shared dependencies between problems.
- Ensure the correct Node.js version before running.
50 changes: 50 additions & 0 deletions src/problem4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Sum to N

## Assumptions

### Assume A

- Supports negative input
- Example:

```
sum_to_n(-5) = -5 + -4 + -3 + -2 + -1 = -15
```

---

### Assume B

- Only supports non-negative input
- Throws error if `n < 0`

---

## Run

Install dependencies:

```
npm install
```

Run program:

```
npm run start
```

---

## Usage

- Enter an integer when prompted
- Enter `q` to quit

Example:

```
Enter n: 5
Enter n: -5
Enter n: q
```
Loading