Giter VIP home page Giter VIP logo

unity-ads-recruiting's Introduction

We're excited you are applying to Unity! As a part of the recruitment process, we would like to validate your technical skills through a small assignment. Return your answer as a zip file containing all relevant files with tests and documentation. Include .git, so that we can see your commit history.

Do not fork this repository.

Assignment

Design and implement (with proper tests) a message delivery system using Go, C/C++/C#, or Java (no Java NIO package). You are free to use any external libraries if needed, but make sure your deliverable either contains these or allows us to automatically download any dependencies.

Design the protocol so that it uses a minimal amount of bytes on the wire. The server should consume a minimal amount of resources (memory, cpu, etc.) when processing messages.

In this simplified scenario the message delivery system includes the following parts:

Hub

The Hub relays incoming message bodies to receivers based on user ID(s) defined in the message. You don't need to implement authentication, the hub can for example assign arbitrary (unique) user id to the clients as they connect.

  • user_id - unsigned 64 bit integer
  • Connection to hub must be done using pure TCP. Protocol doesnt require multiplexing.

Clients

Clients are users who are connected to the hub. Client may send three types of messages which are described below.

Identity message

A Client can send an identity message which the hub will respond with the user_id of the connected user.

Identity

List message

Client can send a command to list messages, which cause the hub to answer with the list of all connected client user_id:s (excluding the requesting client).

List

Relay message

Clients can send relay messages where the body of the message is relayed to the receivers marked in the message.The message body can be relayed to one or multiple receivers.

  • max 255 receivers (user_id:s) per message
  • message body - byte array (text, JSON, binary, or anything), max length 1024 kilobytes

Relay

Relay example: receivers: 2 and 3, body: foobar

unity-ads-recruiting's People

Contributors

nabiber avatar orbat avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.