Rivian Interview Question

A cumulative sum type question in sql.