Responsibilities

  • Development of client-side web-applications (SPA, SSR) using TypeScript, Vue.js, Nuxt.js, Quasar.

Requirements

  • Basic knowledge of JavaScript. Good to have knowledge of TypeScript as well.
  • Theoretical knowledge of at least one web application development framework (not necessarily JS).
  • Willingness to learn a multitude of development technologies simultaneously in one’s personal time.
  • Mastery of any of the following is welcome: SQL, HTML, CSS (also lesscss, sass), Linux CLI, Docker, git, WebStorm (or other IDEs/editors).
  • Basic literacy in Computer Science is welcome, including databases, network technologies, technological stacks for building web applications, operating systems architecture (primarily the Linux family).

Task 1. Develop a Function to Determine the Score in a Game

Objective

In the code example below, a list of game score states throughout a match is generated.
Develop the function getScore(gameStamps, offset), which will return the score at the moment of offset in the list of gameStamps.
It is necessary to understand the essence of the written code, notice the nuances, and develop a function that fits in style with the existing code, preferably with adequate algorithmic complexity.

const TIMESTAMPS_COUNT = 50000;

const PROBABILITY_SCORE_CHANGED = 0.0001;

const PROBABILITY_HOME_SCORE = 0.45;

const OFFSET_MAX_STEP = 3;

type Score = {
home: number;
away: number;
};

type Stamp = {
offset: number;
score: Score;
};

const emptyScoreStamp: Stamp = {
offset: 0,
score: {
home: 0,
away: 0,
},
};

export const generateStamps = (): Stamp[] => {
const scoreStamps = Array(TIMESTAMPS_COUNT)
.fill(emptyScoreStamp)
.map(
((acc) => () => {
const scoreChanged =
Math.random() > 1 - PROBABILITY_SCORE_CHANGED;
const homeScoreChange =
scoreChanged && Math.random() < PROBABILITY_HOME_SCORE
? 1
: 0;
const awayScoreChange =
scoreChanged && !homeScoreChange ? 1 : 0;
return {
offset: (acc.offset +=
Math.floor(Math.random() * OFFSET_MAX_STEP) + 1),
score: {
home: (acc.score.home += homeScoreChange),
away: (acc.score.away += awayScoreChange),
},
};
})(emptyScoreStamp)
);

return scoreStamps;
};

export const getScore = (gameStamps: Stamp[], offset: number): Score => {
// continue the function's implementation
};

Deliverables

  1. A link to the gist with the source code of the function.

Task 2. Develop Tests for the Game Score Determination Function

Objective

For the getScore(gameStamps, offset) function developed in the previous task, develop unit tests using the jest library.
The tests should cover all possible use cases of the function, focus on testing a single case, not be repetitive, and the test names should reflect the essence of the checks being performed.

Deliverables

  1. A link to the gist with the source code of the tests.

Task 3. Develop Weather Forecast Application

Objective

Your task is to implement an application that displays the weather forecast and current weather conditions based on the user-selected location.

The application must be able to load a list of locations, with the ability to search through them. Example endpoint:
https://geocoding-api.open-meteo.com/v1/search?name=Berlin&count=10&language=en&format=json

Following that, the application should fetch the daily weather forecast using the next endpoint, as well as display the current weather conditions. Example endpoint:
https://api.open-meteo.com/v1/forecast?latitude=55.7522&longitude=37.6156&hourly=temperature_2m&start_date=2024-04-02&end_date=2024-04-03

The choice of how to display the weather forecast is up to the developer; it can be presented in a simple list or through a chart.

Implementation Requirements

  • You should use Vue.js framework.
  • Location search using an API.
  • Time stamps must be in the user’s timezone.

Deliverables

  1. A link to the deployed application where the functionality described in the task can be tested.
  2. Links to the GitHub repository with the source code of the solution.