Giter VIP home page Giter VIP logo

hack-diversity-pre-interview's Introduction

Hello Hack.Diversity!

This application is a facsimile of a reporting microservice. It's a sandbox that mimics the kind of environment you might see as an engineer.

Prologue: The Best of the Best

The right reporting, analytics, and information delivery strategy can have a significant impact on an organization. It can fundamentally change the way people perform their jobs and the way decisions are made.

You are the engineer responsible for generating our very first report. There is one important question that we want to answer:

  1. How long does it take for my team members to RESPOND to end users who send us chats?

Someone else has gotten a head start on this service and have handed it off to you, leaving you to implement some of the calculations that will bring this data to life.

Your Goals

  1. Fork this repo
  2. Get this Java app set up (instructions below, feel free to use the internet for help!)
  3. Complete the "health check" challenge
  4. Complete the "average response time" challenge
  5. Submit your work by emailing a link to your repo to Drift

Setup

  1. Checkout a new git branch before you begin
  2. Open in Intellij
  3. If necessary, run mvn clean install -U
  4. Run in debug mode using Start Interview Application runtime config ๐Ÿž

If it's running, your console should be free of errors.

Challenge 1: Health check

This is your warm-up. ๐Ÿ”ฅ

โ‰๏ธ๏ธ Please make a GET request to a healthcheck endpoint in your app to confirm that it's running.

โœ… @GET localhost:7070/metrics/healthcheck should return a 200 OK.

Challenge 2: Implement average response time

โ‰๏ธ๏ธ Implement a method (already stubbed) to calculate and return the average response time in a conversation.

โœ… @GET localhost:7070/metrics/conversations/2 to return the response time for conversation #1.

Details

Conversation object signatures look like this:

Conversation{id=0, messages=[]}

Message object signatures look like this:

Message{id=0, conversationId=0, message="", createdAt="", authorId=0, isTeamMember=true|false}

The spec for calculating the average response time based on the following:

  • Response time is defined as the time between an End User message and the next Teammate message.
  • If there are multiple End User messages in a sequence, calculate the response time from the first end user message.

For the conversation:

@0.0s  End User:    Hello
@2.0s  End User:    I'd like to know more about Thneeds
@6.0s  Team member: I'm here to help. What's your question?
@6.5s  End User:    What can it do?
@8.5s  Team member: The real question is what can't it do
@9.5s  Team member: A Thneed can do anything you need!

The final response should look like this:

# GET /metrics/conversations/2
{
  "conversationId": 2,
  "avgResponseMs": 4000.00
}

Which other cases would be useful to validate with unit tests? Feel free to add these as part of your solution if you feel that they are valuable.

Resources

Tech

There are some tools in use with which you may not be familiar.

Dropwizard straddles the line between being a library and a framework. Its goal is to provide performant, reliable implementations of everything a production-ready web application needs. Because this functionality is extracted into a reusable library, your application remains lean and focused, reducing both time-to-market and maintenance burdens.

We rely on Guice for dependency injection. Here's what they have to say:

...dependency injection is just a design pattern. The core principle is to separate behaviour from dependency resolution. In our example, the RealBillingService is not responsible for looking up the TransactionLog and CreditCardProcessor. Instead, they're passed in as constructor parameters.

Java annotation processors to generate simple, safe and consistent value objects. Do not repeat yourself, try Immutables, the most comprehensive tool in this field!

We access ReactiveX via RxJava

An API for asynchronous programming with observable streams

hack-diversity-pre-interview's People

Contributors

a-alhayek avatar drift-opsbot avatar apiguy avatar lukevs avatar pkarl 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.