Assignments: ============================= This repository contains code for GlobalRelay technical assignment, authored in January of 2013 Description of the assignment is provided below. What was done: - This assignment took me 1 full day to write - It covers 80% of the required functionality To Do: - ServiceConfiguration should be identified by Service URL, not by user-defined name as it is now - Listeners should subscribe by combination of <Service URL : query interval> - Unit tests should be based on mocks Interview environment: - Interviewers strongly believe that this is your only option on the market, so spare your time on explanation that you were hesitant to spend more than 1 day on a "throw-away code" - Be mentally prepared for provocative questions, such as "if this method is never used (for instance Configurator#removeConfiguration) - why is it in" ? ============================= Technical Assignment Design and implement in (java or c#) a service monitoring class. This monitor will be used to monitor the status of multiple services. A service is defined as a host/port combination. To check if a service is up, the monitor will establish a TCP connection to the host on the specified port. If a connection is established, the service is up, if the connection is refused, the service is not up. The monitor will allow callers to register interest in a service, and a polling frequency. The callers will be notified when the service goes up and down. The monitor should detect multiple callers registering interest in the same service, and should not poll any service more frequently than once a second. At any time a service can be configured with a planned service outage; however, not all services need to specify an outage. The service outage will specify a start and end time for which no notifications for that service will be delivered. The monitor should allow callers to define a grace time. If a service is not responding, the monitor will wait for the grace time to expire before notifying any clients. If the service goes back on line during this grace time, no notification will be sent. If the grace time is less than the polling frequency, the monitor should schedule extra checks of the service. The code should include a set of unit tests.