谷歌上门系统设计 Design Google Docs Versioning System

面的是L5

Design Google Docs Versioning System

You have to implement Google Docs’s versioning feature.

A document can be rich (multimedia like Youtube videos, embedding spreadsheets from Google Sheets, etc) and you will need implement the versioning system which allows you to revert back to an older version of the doc.

Let say this is the current version tree of a document: 1-> 2-> 3-> 4-> 5 (now)

A user can revert back to version 3, make an edit, and the new edit will be counted as version 6.

It is not possible to edit past versions.

(The answer is something about using an immutable tree whereby edits to one area will only result in that subtree being replaced with subtree. Would love another expert to explain how this works exactly)

这个思路靠谱吗