This is Reperio Health's GoLang backend assessment

reperio-backend-assessment

This is Reperio Health's GoLang backend assessment.

Notes from Candidate (Andrew Burt)

Prerequisite

  • install + setup golang 1.17
  • install sqlite3
  • install ide with linting tools for golang

Environment Variables

  • PORT
  • ENVIRONMENT

To Run

PORT=3000 ENVIRONMENT=tory go run main.go

To Build

go build -o $GOPATH/bin/reperio-backend-assessment main.go

Objectives

  • There is a bug hidden that deals with formatting of string being sent to the weather api, please find and fix
  • Add a v2 route for current-weather that implements saving to the database
  • There is a bug with the query builder please find and fix
  • Sort the forecast data by coldest or hottest day using a query param
  • Implement a cast somewhere from interface{} to an actual type
  • Add a piece of middleware that checks if the current location has a record in the database and saves true or false in the request context (bonus)

Notes on Completion of Objectives

  1. Fixed. Ordering and types were off. (packages/weather.go)

  2. I added a v2 route that implements saving to the database. That said, after fixing the bugs relating to the db query, the code in the v1 route which saved to the database started to work, so I wasn't sure whether to also remove this from the v1 route. I decided to leave it, so now both the v1 route saves to the database, and the v2 route, which I created and implemented, also saves to the database. (functions/v2/weather.go, handlers/v2/currentWeather.go, routes/currentWeather.go, routes/versions.go)

  3. Fixed. Condition and types were off. (database/query.go)

  4. Added a query param to the forecast route "sort", which has options "asc" and "desc" (ascending and descending), which implements sort and orders by the forecast:forecastday:day:avgtemp_c json fields of each returned day's forecast in ascending or descending order. (handlers/v1/forecast.go)

  5. Added 2 open interface to type casts. One is fully integrated into the code (functions/v2/weather.go). The other is sort of arbitrary, since it didn't result in something that was useable by the following step, but demonstrates another way to cast to type: (packages/weather.go).

  6. (Bonus Objective) This is unfinished. I stubbed the middleware (middleware/common.go, routes/versions.go), and mostly implemented the database query wrapper (I think I successfully implemented Query in types/database.go, but the select query wrapper in database/query.go is not quite right), but didn't complete troubleshooting the actual db query, or saving to the context.

  7. Additionally: Possible issue: The forecast route only returns 1-3 days of data from the forecast api "days" parameter. 4+ day requests only return 3. Possible external API limitation?

Owner
Andrew David Burt
Software engineer, math/cs student, traveler, trail runner, baker, reader, humanist, skeptic, mountain lover, dancer, dork.
Andrew David Burt
Similar Resources

Experimentation for backend on GCP's App Engine

gcp-app-engine-go Experimentation for backend on GCP's App Engine Archived. App Engine project with multiples services and CI/CD setup: default (hello

Jan 15, 2022

Grafana DB2 Data Source Backend Plugin

Grafana DB2 Data Source Backend Plugin This template is a starting point for building Grafana Data Source Backend Plugins What is Grafana Data Source

Dec 13, 2021

Backend Project using Go with Dgraph Database and Chi as HTTP Service

Drawflow-Requests For init DGraph Database docker run --rm -it -p 8080:8080 -v ~/dgraph:/dgraph dgraph/standalone:v20.03.0 docker run --rm -it -p 8080

Dec 11, 2021

Leapfrog backend Go Lambdas

Leapfrog backend Go Lambdas

leapfrog - APIs DEVELOPED IN LAMBDAS ## Environment Details 1.Branch Name : Dev

Jan 5, 2022

Provider-generic-workflows - A generic provider which uses argo workflows to define the backend actions.

provider-generic-workflows provider-generic-workflows is a generic provider which uses argo workflows for managing the external resource. This will re

Jan 1, 2022

This is an assignment for Intern-Software Engineer, Backend Go from LINE MAN Wongnai. It is create with Go and GIN framework

COVID-19-API-Assignment Create by Chayaphon Bunyakan, Email: [email protected] Run the API by typing the following command go run main.go Run t

Jan 9, 2022

Spotify Backend Developer Intern Challenge 2022 (Go, Gin, SQLite3)

Shopify Backend Developer Intern Challenge - Summer 2022 This is an API for managing inventory items. The API is written in Go and uses Gin and sqlite

Jan 19, 2022

Grafana Data Source Backend Plugin Template

Grafana Data Source Backend Plugin Template This template is a starting point for building Grafana Data Source Backend Plugins What is Grafana Data So

Jan 16, 2022

First Go project. Backend hiring test for Array engineering.

BACKEND TEST 1 Submitted by: Mitchell Sullivan Intro This is basically my first-ever project in Go. As such, it's quite simple and bears little resemb

Jan 19, 2022
Savoir - A tool to perform tasks during internal security assessment

Savoir Savoir is a tool to perform tasks during internal security assessment. Th

Nov 9, 2022
Taina backend Backend service With Golang

taina-backend Backend service Getting Started Essential steps to get your backend service deployed A helloworld example has been shipped with the temp

Nov 17, 2021
Go-backend-test - Creating backend stuff & openid connect authentication stuff in golang

Go Backend Coding Practice This is my practice repo to learn about creating back

Feb 5, 2022
Oct 7, 2022
Acropolis Backend is the Go backend for Acropolis - the central management system for Full Stack at Brown
Acropolis Backend is the Go backend for Acropolis - the central management system for Full Stack at Brown

Acropolis Backend Acropolis Backend is the Go backend for Acropolis — the centra

Dec 25, 2021
Amazeful web backend server for golang

Amazeful-Backend The all new Amazeful-Backend written in GoLang using Chi. To re

Jan 10, 2022
Grafana Tempo is a high volume, minimal dependency distributed tracing backend.
Grafana Tempo is a high volume, minimal dependency distributed tracing backend.

Grafana Tempo is an open source, easy-to-use and high-scale distributed tracing backend. Tempo is cost-efficient, requiring only object storage to ope

Jan 8, 2023
StaticBackend is a simple backend server API handling user mgmt, database, storage and real-time component
StaticBackend is a simple backend server API handling user mgmt, database, storage and real-time component

StaticBackend is a simple backend that handles user management, database, file storage, forms, and real-time experiences via channel/topic-based communication for web and mobile applications.

Jan 7, 2023
A Grafana backend plugin for automatic synchronization of dashboard between multiple Grafana instances.

Grafana Dashboard Synchronization Backend Plugin A Grafana backend plugin for automatic synchronization of dashboard between multiple Grafana instance

Dec 23, 2022
The tool for manage gitlab terraform backend

The tool for backup and restore gitlab terraform states Build how to: git clone https://github.com/CRASH-Tech/gitlab-terraform-manager.git cd gitlab-t

Oct 3, 2021