Skip to content

Instantly share code, notes, and snippets.

@stepanbujnak
Last active February 9, 2024 15:37
Show Gist options
  • Save stepanbujnak/7fa18e2e97de2fd3f593c00b09c445c2 to your computer and use it in GitHub Desktop.
Save stepanbujnak/7fa18e2e97de2fd3f593c00b09c445c2 to your computer and use it in GitHub Desktop.
Full Stack Technical Challenge

Sr. Go Engineer challenge

Please design and implement a web based API that steps through the Fibonacci sequence.

The API must expose 3 endpoints that can be called via HTTP requests:

  • current - returns the current number in the sequence
  • next - returns the next number in the sequence
  • previous - returns the previous number in the sequence

Example:

current -> 0
next -> 1
next -> 1
next -> 2
next -> 3
next -> 5
current -> 5
previous -> 3
previous -> 2
previous -> 1
previous -> 1
previous -> 0

Requirements:

  • The API must be able to handle high throughput (~1k requests per second)
  • The API should be able to recover and restart if it unexpectedly crashes
  • The API should be able to handle integer overflows (for large Fibonacci numbers)
    • You have the discretion to choose the approach (e.g., returning an error upon overflow, using a data type capable of handling large numbers, etc.)"
  • Use Go and any framework of your choice for the backend
  • The submission should be sent in a GitHub repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment