Skip to content

Instantly share code, notes, and snippets.

@johnhof
Last active March 22, 2024 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnhof/bb1174c4c3dbc38f8c100c41a5b7c0a6 to your computer and use it in GitHub Desktop.
Save johnhof/bb1174c4c3dbc38f8c100c41a5b7c0a6 to your computer and use it in GitHub Desktop.
A short golang coding challenge prompt

Prompt

Create a golang http server for storing unstructured objects by ID.

Parameters

Any coding tools, googling, etc are allowed. Best practices can be skipped as long as theyre called out when they occur.

Data Format

The Structured fields for an object should be:

ID string
CreatedAt time.Time
Labels []string
Object any

The data storage mechanism should be an in-memory data structure defined in your code.

API endpoints

Create: Add an object for ID

Delete: Remove an object by ID

List: list objects with query modifiers:

  • Ordering:
    • CreatedAt (Default)
    • ID
  • Filtering:
    • Labels - any of the provided labels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment