Here is a sample application specification I use as a base for Go interviews. It's pretty simple to write and I use it as a foundation for further conversations with a candidate.
Task specification
- create simple Go application exposing REST API
- no specific web framework is required to be used
- when
/api/weather
endpoint is called, fetch weather alerts data for the state of New York using this API - read weather alerts headlines from the
api.weather.gov
API response (JsonPath$.features[*].headline
) - return alerts headlines in a similar response:
{"alerts": ["Wind Chill Advisory issued February 12 at 4:02AM EST until February 12 at 10:00AM EST by NWS Binghamton NY"]}
Extra points
It is up to you how simple or complex the application will be. However you can treat this application as an occasion to brag about the things you know. For example:
- Do you like unit testing? Go for it and show us your favorite testing libraries in action!
- Docker fan? Dockerize the application then and include your Dockerfile!
- Any other cool libraries you know and wanna show us? Let us learn from you!
Top comments (5)
Happened to see this while looking through recent posts and figured what the heck. I went for very simple with the standard library, a Dockerfile, and no tests. Threw them up as a gist.
gist.github.com/shindakun/4ebd21c2...
Thank you Steve! I love it.
+1 for how you use Go Docker image and Docker stages to build project! I see this build in stage pattern being more and more popular for cloud native applications. It makes total sense for me!
BTW Is there any reason to set up
GOPROXY
? I guess it defaults tohttps://proxy.golang.org
anyway?PS I will try to comment more later!
Thanks! The
GOPROXY
is really just left over from and older revision, it does not need to be in there any longer as far as I know.Hey Steve :) , Why did you use docker in this task, could we just use go run ? Thanks !
Hello Henryk, is there a way to know all the possible states ?
Thanks !