A
A
Alexey2016-08-07 20:17:43
JavaScript
Alexey, 2016-08-07 20:17:43

How to form blocks like in Google Calendar?

Today I had an interview, position - "Front-end developer". They asked a question, to which I answered, we will not speak as accurately as I would like. I have never done this, I would like to know how you would answer it ...
The illustration itself:
google.png
The illustration shows that there are columns - days. For example, let's take Wednesday, in a certain period of time there is a so-called. collisions when events are superimposed on each other (there can be either 1 or 31 of them ...).
At the same time, there is data:
Start: 9-00 End 9-30
Start 9-20 End 12-00
So the question is, how is the sorting algorithm, data definition and drawing arranged, when there are "collisions" and when they are not? I tried my best to explain the issue. I will be grateful for answers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-08-15
@azovl

As far as I understand, you need to look at data structures and algorithms in javascript. Here a solution is needed using the methods tree, binary trees.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question