How to implement a spreadsheet in a browser?

I recently asked about this in an interview (Software Engineer) and did not know how to answer the question.

The question was focused both on the spreadsheet algorithm and how it will interact with the browser. I was a little confused about which data structure would be optimal for processing cells and their values. I assume that any form of hash table will work with cells that are a unique key, and the value will work with an object in a cell? Then, when something is updated, you just update that record in your table. The interviewer hinted at the chart, but I did not know how the chart would be useful for the spreadsheet.

Other things I considered were:

  • Browser spreadsheet = auto save. With any update, send all the data to the server
  • Cells that are connected to each other, i.e. C1 = C2 + C3, C5 = C1-C4. If the value of C2 changes, both C1 and C5 change.
  • Using design patterns? Does anyone single out the other for this particular situation?

Any tips on how to solve this? Besides the algorithm of the spreadsheet itself, what else could the interviewer do? Does the fact that it is difficult in the browser compared to a separate application?

Thank!

+4
source share
3 answers

. , , .

, , , .

, , , , . , .

, , , , , , . , JavaScript, . , . , , . , Excel , . ​​ , . (), . 100 000 , , script. .

, . ? , ? (, , , , ).

, , .

, , , , , .

+4

. , , :

, , , , . , .

" " ( " " - " " , - , , ) - , , :

  • ( )

  • ( )

  • "", , ,

  • ( , , , )

0
  • CSS, - .
  • HTML- CSS? HTML .
  • offsetX OffsetY.
  • . Mongo, mySQL, Firebase, ... . .
  • Javascrip/ECMA Excel . -?
  • , ? .
  • Most importantly, do not do this . What for? Because it has already been done . Find a job and complete this project.
0
source

Source: https://habr.com/ru/post/1542728/


All Articles