Git Product home page Git Product logo

platform-interview's Introduction

Form3 Platform Interview

Platform engineers at Form3 build highly available distributed systems using infrastructure as code. Our take home test is designed to evaluate real world activities that are involved with this role. We recognise that this may not be as mentally challenging and may take longer to implement than some algorithmic tests that are often seen in interview exercises. Our approach however helps ensure that you will be working with a team of engineers with the necessary practical skills for the role (as well as a diverse range of technical wizardry).

๐Ÿงช Sample application

The sample application consists of four services:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚             โ”‚     โ”‚              โ”‚    โ”‚              โ”‚    โ”‚              โ”‚
โ”‚   payment   โ”‚     โ”‚   account    โ”‚    โ”‚   gateway    โ”‚    โ”‚   frontend   โ”‚
โ”‚             โ”‚     โ”‚              โ”‚    โ”‚              โ”‚    โ”‚              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚                โ”‚                   โ”‚
          โ”‚                โ”‚                   โ”‚
          โ”‚                โ–ผ                   โ”‚
          โ”‚         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
          โ”‚         โ”‚              โ”‚           โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚    vault     โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚              โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Three of those services connect to vault to retrieve database credentials. The frontend container serves a static file.

The project structure is as follows:

.
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ form3.crt
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ run.sh
โ”œโ”€โ”€ Vagrantfile
โ”œโ”€โ”€ services
โ”‚   โ”œโ”€โ”€ account
โ”‚   โ”œโ”€โ”€ gateway
โ”‚   โ””โ”€โ”€ payment
โ””โ”€โ”€ tf
    โ””โ”€โ”€ main.tf
  1. Refactoring the Terraform code found in the tf directory is the primary focus of this test.
  2. Vagrantfile, run.sh and docker-compose.yml are used to bootstrap this sample application; refactoring these files is not part of the test, but these files may be modified if your solution requires it.
  3. form3.crt is used to ease sandboxed running of the submission by Form3 staff and can be ignored.
  4. The services code is used to simulate a microservices architecture that connects to vault to retrieve database credentials. The code and method of connecting to vault can be ignored for the purposes of this test.

Using an M1 Mac?

If you are using an M1 Mac then you need to install some additional tools:

๐Ÿ‘Ÿ Running the sample application

  • Make sure you have installed the vagrant prerequisites
  • In a terminal execute vagrant up
  • Once the vagrant image has started you should see a successful terraform apply:
default: vault_audit.audit_dev: Creation complete after 0s [id=file]
    default: vault_generic_endpoint.account_production: Creation complete after 0s [id=auth/userpass/users/account-production]
    default: vault_generic_secret.gateway_development: Creation complete after 0s [id=secret/development/gateway]
    default: vault_generic_endpoint.gateway_production: Creation complete after 0s [id=auth/userpass/users/gateway-production]
    default: vault_generic_endpoint.payment_production: Creation complete after 0s [id=auth/userpass/users/payment-production]
    default: vault_generic_endpoint.gateway_development: Creation complete after 0s [id=auth/userpass/users/gateway-development]
    default: vault_generic_endpoint.account_development: Creation complete after 0s [id=auth/userpass/users/account-development]
    default: vault_generic_endpoint.payment_development: Creation complete after 1s [id=auth/userpass/users/payment-development]
    default: 
    default: Apply complete! Resources: 30 added, 0 changed, 0 destroyed.
    default: 
    default: ~

Verify the services are running

  • vagrant ssh
  • docker ps should show all containers running:
CONTAINER ID   IMAGE                                COMMAND                  CREATED          STATUS          PORTS                                       NAMES
6662939321b3   nginx:latest                         "/docker-entrypoint.โ€ฆ"   3 seconds ago    Up 2 seconds    0.0.0.0:4080->80/tcp                        frontend_development
b7e1a54799b0   nginx:1.22.0-alpine                  "/docker-entrypoint.โ€ฆ"   5 seconds ago    Up 4 seconds    0.0.0.0:4081->80/tcp                        frontend_production
4a636fcd2380   form3tech-oss/platformtest-payment   "/go/bin/payment"        16 seconds ago   Up 9 seconds                                                payment_development
3f609757e28e   form3tech-oss/platformtest-account   "/go/bin/account"        16 seconds ago   Up 12 seconds                                               account_production
cc7f27197275   form3tech-oss/platformtest-account   "/go/bin/account"        16 seconds ago   Up 10 seconds                                               account_development
caffcaf61970   form3tech-oss/platformtest-payment   "/go/bin/payment"        16 seconds ago   Up 8 seconds                                                payment_production
c4b7132104ff   form3tech-oss/platformtest-gateway   "/go/bin/gateway"        16 seconds ago   Up 13 seconds                                               gateway_development
2766640654f3   form3tech-oss/platformtest-gateway   "/go/bin/gateway"        16 seconds ago   Up 11 seconds                                               gateway_production
96e629f21d56   vault:1.8.3                          "docker-entrypoint.sโ€ฆ"   2 minutes ago    Up 2 minutes    0.0.0.0:8301->8200/tcp, :::8301->8200/tcp   vagrant-vault-production-1
a7c0b089b10c   vault:1.8.3                          "docker-entrypoint.sโ€ฆ"   2 minutes ago    Up 2 minutes    0.0.0.0:8201->8200/tcp, :::8201->8200/tcp   vagrant-vault-development-1

โš™๏ธ Task

Imagine the following scenario, your company is growing quickly ๐Ÿš€ and increasing the number services being deployed and configured. It's been noticed that the code in tf/main.tf is not very easy to maintain ๐Ÿ˜ข.

We would like you to complete the following tasks:

  • Improve the Terraform code to make it easier to add/update/remove services
  • Add a new environment called staging that runs each microservice
  • Add a README detailing:
    • Your design decisions, if you are new to Terraform let us know
    • How your code would fit into a CI/CD pipeline
    • Anything beyond the scope of this task that you would consider when running this code in a real production environment

๐Ÿ“ Candidate instructions

  1. Create a private GitHub repository containing the content of this repository
  2. Complete the Task ๐ŸŽ‰
  3. Invite @form3tech-interviewer-1 to your private repo
  4. Let us know you've completed the exercise using the link provided at the bottom of the email from our recruitment team

Submission Guidance

Shoulds

  • Use only plain Terraform in your solution, i.e. anything supported by the Terraform CLI installed by the run.sh script, but not external tooling or libraries that wrap or extend Terraform, such as Terragrunt or tfenv
  • Only modify files in the tf/ directory, run.sh, and docker-compose.yml
  • Keep the current versions of the services running in development and production environments
  • Structure your code in a way that will segregate environments
  • ๐Ÿšจ All environments (including staging) should be created when you run vagrant up and the apps should print service started and the secret data in their logs ๐Ÿšจ
  • Structure your code in a way that allows engineers to run different versions of services in different environments

Should Nots

  • Do not use external tools that extend Terraform, such as Terragrunt.

platform-interview's People

Contributors

andrew-bulford-form3 avatar ewilde-form3 avatar jeeves-form3 avatar kevholditch-f3 avatar mcarmier-form3 avatar mionskowski-form3 avatar nicholas-form3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.