Rivian interview question

A cumulative sum type question in sql.