Skip to content

Instantly share code, notes, and snippets.

@MattyAyOh
Last active August 5, 2020 02:33
Show Gist options
  • Save MattyAyOh/b897c966e7d2d565d22eca668a34a4ff to your computer and use it in GitHub Desktop.
Save MattyAyOh/b897c966e7d2d565d22eca668a34a4ff to your computer and use it in GitHub Desktop.
Betty Labs Backend Engineer Takehome Project Specs

BettyLabs Backend Engineer Takehome Project


Please spend about 4 hours on this project, afterwards we'll have a 30 minute discussion review and discuss what we could add to the project

  • Please make an initial commit once you start, and incremental commits as you see fit

So here’s the outline for the exercise:

Our main app, Locker Room, allows users to communicate to each other with text messages, that emit to all present clients in a room. We currently store chat messages in memory, and they are wiped out after a room is closed.
We would like to save chat logs for posterity, so we can reference them for bug reports, feature requests, or toxicity reports.
We would like you to build a microservice that archives chat messages from our main app. You are free to choose any tech you would like for the data persistence.

Chat messages will emit over a Kafka topic. In the Heroku App's config vars, you will find:

  • Kafka URL
  • Kafka Client Cert
  • Kafka Client Cert Key
  • Kafka Prefix
  • Kafka Trusted Cert

I will send your Consumer Group ID over email, chat-archive.candidate-X

Kafka chat messages are sent in the Chat topic. It is send with the following JSON structure:

{
   "route": "CLUSTER_CHAT_MESSAGE",
   "payload": {
       "userId": "",
       "roomId": "",
       "firstName": "",
       "lastName": "",
       "verified":  false,
       "message": "",
   }
}

Keep in mind there are other messages on this topic. You will need to filter them out based on the route

We will give you access to an isolated Heroku app where you will have access to the Kafka queue. We will also give you access to our development environment on test flight, so you can test your service in real time.

Criteria:

  • Maintainability
    • Modular
    • Readability
  • Performant

Output:

  • A code repository, including /.git, zipped
  • A list of features you would add to this project if you had more time, as well as any improvements you could make (if applicable)
  • Please email your submission to matt@bettylabs.io

That's it! Please let us know if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment