Giter Club home page Giter Club logo

jacek-temp-inc's Introduction

Temp-Inc

'Always Right Temp Inc' temperature anomalies solution

Recruitment Task Description

Introducing 'Always Right Temp Inc' ๐ŸŒก๏ธ๐ŸŒž, the masters of temperature sensors! They've entrusted you to create an anomaly detector. To prove the solution is working end to end, you should create Temperature Measurement Generator, send as events to Kafka stream, implement anomaly detection algorithms, store anomalies in database and provide an API to query for anomaly statistics. Don't forget to include unit and integration tests to ensure the quality and functionality of the project.

To detect anomalies, we have two algorithms to choose from:

Anomaly Detection Algorithm ONE:

Label a temperature measurement as an anomaly if, within any 10 consecutive measurements, one reading is higher than the average of the remaining 9 by 5 degrees Celsius. Example: 20.1, 21.2, 20.3, 19.1, 20.1, 19.2, 20.1, 18.1, 19.4, 20.1, 27.1, 23.1

Anomaly detected: 27.1

Anomaly Detection Algorithm TWO:

Define an anomaly as any measurement that differs from the average of all readings by 5 degrees Celsius within a 10-second window based on the measurement timestamp. Example:

19.1 1684945005
19.2 1684945006
19.5 1684945007
19.7 1684945008
19.3 1684945009
25.1 1684945010
18.2 1684945011
19.1 1684945012
19.2 1684945013
25.4 1684945015

Anomalies detected: 25.1, 25.4

Solution design overview

What is expected from you

We provided a skeleton and sample code to allow you to start quickly, feel free to use it or write solution from scratch if you prefer. Modules and their description:

  • temperature-generator - service responsible for sample data generation. You should implement better TemperatureGenerator that will allow you to test solution and demo it with realistic data. Integration test framework using TestContainers is provided there.
  • temperature-domain - module for kafka event data models and other shared domain objects.
  • anomaly-detector - service responsible for processing temperature measurements, it should contain two AnomalyDetector algorithms implementations. Sample code is provided there and integration tests, you need to adapt it.
  • anomaly-storage - role of this service is persisting detected anomalies to the database of your choice.
  • temperature-analytics-api - please implement REST API here, at least following endpoints:
    • list of anomalies per thermometer id
    • list of anomalies per room id
    • list of thermometers with amount of anomalies higher that threshold (provided as query param or from properties)

Goal is to implement solution flow end to end, from data generator, to anomaly detection, storing detected anomalies in database and have a REST API to query for anomaly analytics.

Repository is configured as template, please do not fork it, you can create a copy of this repo, docs here.

jacek-temp-inc's People

Contributors

pawel-kontakt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.