This is a take home exam for Abnormal Security, specifically for a backend API developer.
Abnormal Security has a successful product that secures cloud email systems of our customers.
The intent of this exercise is to figure out the technical skill level of the candidate, and the design decisions, and choices made. We are keen to see the use of unit testing, event driven thinking and leverage the use of docker in the process.
The sales team in Abnormal use Salesforce to track opportunities and update the system when clients move to purchase our premier email product offering.
To automate the flow of data from salesforce to Abnormal's systems, we use Salesforce webhook APIs to read for events triggered when customer data is changed.
In this problem, you will need to assume that we have made the arrangement to subscribe to salesforce customer data change events, and you should provide the endpoint that receives incoming data change events from salesforce, and perform some simple processing.
You will need to filter the events, and provide a system that maintains licenses and stock keeping units (SKUs) purchased by the customer. Other applications in Abnormal will need to be able to read the service provided to ascertain if the feature is made available to the user logged in.
Candidates are required to:
- Fork this repository to their personal github space
- Add the code necessary to complete the task
- Ensure that the code performs as required
- Ensure that unit tests meets at least 50% code coverage
- Be prepared to explain decisions taken and possible improvements
- Do not spend more than 2 hours on the take home test
- Submit by submitting a PR on this repository
The application attached ships with a postgresql DB server, and a kafka broker running in the docker compose environment.
Candidates are required to run docker-compose up -d
before starting
development to ensure they have a working environment.
One of the images spun up is for a golang application that simulates salesforce
periodically sending customer data to the webhook endpoint the candidate must
code and provide: http://web/salesforce/webhook
For the purposes of this take home, please assume that the necessary work has
been done to subscribe to salesforce customer change events, and it has been
configured to send these events via RESTful POST calls to
http://web/salesforce/webhook
type CustomerData struct {
AccountManager string
Id string
Name string
SalesEngineerId string
SignedTos bool
SKU1 bool
SKU2 bool
SKU3 bool
}
Your task include:
- prepare an web service that will service the endpoint
http://web/salesforce/webhook
. - queue a message with an appropriate payload on the kafka broker
- read the customer change data from the kafka broker
- design the license and SKU data models
- save the customer change data in the provided postgresql db
- ensure at least 50% code coverage for code developed
- (optional) provide an API to allow abnormal applications to read the license data
You can choose to complete the test with either python or golang, and should not be doing both.
A Dockerfile
and docker-compose.yaml
to setup and simulate the environment.
The candidate should be able to run docker-compose up -d
to simulate running
the environment.
A simulator has been added to the repository and docker environment. This will
start sending messages to the web component at the endpoint
http://web/salesforce/webhook
with HTTP POST, and with the data structure
provide in the Salesforce Customer Data
section above.
The stack consists of:
- python==3.11.1
- django==4.1
- psycopg2
- pytest
A requirements.txt file is provide, and you should set up with a virtual env
and install with the pip install -r requirements.txt
command to have the basic
libraries installed.
The candidate may choose any framework he is familiar with, and not limit himself/herself to using django.
To be provided at a later stage
- We will require that testing be incorporated to meet at least 50% of code coverage in unit testing.
- Candidates must submit their work via a github PR on this repository
- Error with installing
psycopg2
on Mac Refer to this (thread)[https://stackoverflow.com/questions/66777470/psycopg2-installed-on-m1-running-macos-big-sur-but-unable-to-run-local-server] on stackoverflow for solutionsbrew install openssl export LDFLAGS="-L$(brew --prefix openssl)/lib" pip install psycopg2