-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
671 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Test tasks from the real job interviews | ||
|
||
This folder is used to store test tasks from the real job interviews. The tasks are stored in the `test-tasks` folder. Each task is stored in a separate folder with the name of the company that provided the task. Inside the company folder, there is a `README.md` file with the task description. | ||
|
||
The real job interviews prepare students and junior specialists for the real job interviews. The tasks are designed to test the knowledge and skills of the candidates. The tasks are usually taken from the job position interviews and the company's technology stack. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Site Reliability Engineer - Basic API Hosting Task | ||
|
||
## Part 1 – The Web Service | ||
|
||
Write a web service in any language that takes in a JSON payload, does | ||
some basic validation against an expected message format and content, | ||
and then puts that payload into a queue of your choice or a file. | ||
|
||
Example valid payload: | ||
|
||
```json | ||
{ | ||
"ts": "1530228282", | ||
"sender": "curler-user", | ||
"message": { | ||
"foo": "bar", | ||
"hash": "bash" | ||
}, | ||
"sent-from-ip": "1.2.3.4" | ||
} | ||
``` | ||
|
||
Validation rules: | ||
● “ts” must be present and a valid Unix timestamp | ||
● “sender” must be present and a string | ||
● “message” must be present, a JSON object, and have at least one | ||
field set | ||
● If present, “sent-from-ip” must be a valid IPv4 address | ||
● All fields not listed in the example above are invalid, and | ||
should result in the message being rejected. | ||
|
||
## Part 2 – Terraform | ||
|
||
Deploy this application to your favourite cloud provider using Terraform. | ||
|
||
## Part 3 – NewRelic | ||
|
||
Implement NewRelic monitoring for this application using Terraform. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Senior DevOps Engineer - NotBad Header based API | ||
|
||
Look at the following tasks and estimate how much time you will spend on them. | ||
|
||
## Preconditions | ||
|
||
### Technical & Knowledge | ||
|
||
You need at least: | ||
|
||
- Experience with AWS stack | ||
- Experience with CI/CD | ||
- Experience with Bash scripts | ||
- Experience in at least one programming language (Java, Python, PHP, Perl, etc.) | ||
- A text editor of your choice | ||
|
||
## The tasks | ||
|
||
1. We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this. | ||
|
||
2. Look into keycloak folder. What can be improved? | ||
3. Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad". | ||
Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them. | ||
Hint: https://aws.amazon.com/free/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.env |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# alpeso-test | ||
|
||
alpeso-test | ||
|
||
## How-to use | ||
|
||
Simple run `./keycloack.sh test test1` where test = keycloak user id and test1 = keycloak client secret. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
CLIENTID=$1 | ||
CLIENTSECRET=$2 | ||
|
||
TOKEN=$(curl -k -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic $(echo -n ${CLIENTID}:${CLIENTSECRET} | base64 )" --data "grant_type=client_credentials" "http://mydomain.com/auth/realms/myrealm/protocol/openid-connect/token" -s | jq -r .access_token) | ||
|
||
echo $TOKEN |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## Software Engineer - Game Task | ||
|
||
### Tools and technologies used: | ||
|
||
1. Go | ||
2. PostgreSQL | ||
3. Docker | ||
4. Makefile | ||
5. Postman | ||
|
||
All database tables are in `migrations` folder. To run them, use `make` command. | ||
|
||
1. `make migrate-up` - to run up migrations | ||
2. `make migrate-down` - to run down migrations | ||
3. `make migrate-force` - to force run migrations if you have some errors like `error: Dirty database version -1. Fix and force version.` | ||
|
||
### Tables: | ||
|
||
1. `users` - contains users data | ||
2. `transaction` - contains transactions data | ||
|
||
### Endpoints to test: | ||
|
||
1. `GET /users` - to get all users | ||
2. `GET /users/{user_id}` - to get user by id, check his balance | ||
3. `GET /transactions/{user_id}` - to get all transactions by user id (check if user has any transactions) | ||
4. `POST /process-record/{user_id}` - to process record by user id | ||
|
||
Process record request body example: | ||
|
||
``` | ||
{ | ||
"amount": 10, | ||
"transaction_id": "64338a05-81e5-426b-b01e-927e447c9e33", | ||
"state": "win" | ||
} | ||
``` | ||
|
||
Transaction id is unique, so you can't process the same transaction twice, provide UUID v4 format. | ||
State can be `win` or `lose`. | ||
Amount is a number should be positive but to have a negative balance you should provide a `lose` state. | ||
|
||
### Required header for all endpoints: | ||
|
||
1. `Source-Type: game` - available values: `game`, `server`, `payment` | ||
|
||
Postman collection is in `postman` folder to test endpoints. | ||
|
||
## To run the app locally: | ||
|
||
1. Create `.env` file in root folder and add all required variables from `.env.example` file | ||
2. To run migrations you should have migrate tool installed. You can install it with `brew install golang-migrate` (https://github.com/golang-migrate/migrate/tree/master/cmd/migrate) | ||
3. To run any `make` command you should have `make` tool installed. You can install it with `sudo apt install make` command (https://linuxhint.com/install-make-ubuntu/) | ||
4. Run `make migrate-up` command to run migrations and create all tables with test user (user_id: `63e83104-b9a7-4fec-929e-9d08cae3f9b9`) | ||
5. Run `make run` command to run application | ||
6. Take a look at `postman` folder to take collection for testing all endpoints | ||
|
||
Test user with id `63e83104-b9a7-4fec-929e-9d08cae3f9b9` will be created automatically when you run migrations. | ||
This user has 50 amount of his balance for testing. | ||
|
||
## To run application in docker container: | ||
|
||
1. Create `.env` file in root folder and add all required variables from `.env.example` file | ||
2. To run docker container you should have `docker` and `docker-compose` tools installed (Tested on `Docker version 26.1.3, build b72abbb` and `Docker Compose version v2.27.1`) | ||
3. `docker-compose up` - to run application in docker container | ||
4. `docker-compose down` - to stop application in docker container |
This file contains 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
This file contains 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
Oops, something went wrong.