We do not accept applications anymore, but you can still challenge yourself.

Just try to solve the test.

Temperature Test Suite v1.00

Story

For one of the ScaleFocus clients we need to create a graphical representation of climate data over extended periods of time. The client will provide us with raw data containing dates and temperatures for the corresponding dates that are chronologically ordered.

Description

Write a program that from given days and temperatures for them, returns the day that fit in the following conditions:

  1. Closest to 0 that is not 0
  2. If more than one temperature are equally close to 0, return from that set the first day that have positive temperature.
  3. If from the set that is closest to 0 have no positive temperatures, return the first day in the list.

Input: Array of day objects

Output: String

Sample Input:

  • [ {“date”:”Mo”, “temp”: -10},
  • {“date”:”Tu”, “temp”: 7},
  • {“date”:”We”, “temp”: 5},
  • {“date”:”Th”, “temp”: 3},
  • {“date”:”Fr”, “temp”: -1},
  • {“date”:”Sa”, “temp”: -9},
  • {“date”:”Su”, “temp”: -4} ]

 

Expected Result: “Fr”

							
								
							
						

Check your code

Stay connected:
Powered by ScaleFocus