Andrei Solntsev
22 Apr 2012

Estimate your skills!

Every developer wants to estimate his skills. One way to do it is to ask a test task for applying some job, even if you are not actually going to apply. We suggest you a simple way.

The following is our test task. You can try to solve it and understand: are you ready for working at Codeborne - even if you are not going to.

We typically use Java or Scala, but you can choose any language this time. This task is neither too complex nor simple, it’s just an example of our everyday job. So, the task is to compute electricity day- and night- consumption of a client.

  • Given client’s per-hour electricity consumption for some month.
  • Goal is to compute total day- and night- consumption.
  • Hours are enumerated from 1 starting from beginning of month. Day hours are 7-23 at working days (8-24 at daylight saving time or summer). All other hours are night hours.

Example for January 2012:

  • 1 - 2kW (hour #1 is January 1, Sunday, 00:00 - 01:00 - NIGHT)
  • 2 - 3kW (hour #2 is January 1, Sunday, 01:00 - 02:00 - NIGHT)
  • 26 - 3kW (hour #26 is January 2, Monday, 01:00 - 02:00 - NIGHT)
  • 32 - 6kW (hour #32 is January 2, Monday, 07:00 - 08:00 - DAY)
  • 744 - 0kW (hour #744 is January 31, 23:00 - 24:00)

In this case, night consumption is 8 = 2+3+3 and day consumption is 6.

POST YOUR SOLUTION and get feedback in English, Estonian or Russian. It’s anonymous. It’s free. It should be fun.

PS. Veiko and Tauno, we have lost your email addresses. Please repost them to get feedback.

###Archived comments##

[kurapov.name] 2012-05-09T12:45:00.185Z

Try using interviewstreet.com - this way submitters will actually have their code tested

Our recent stories