I recently interviewed for multiple companies and one of them is Amazon. I've written a stupid code to calculate total compensation and the break down including the stocks for 4 years. (Since I got RSU spreaded oddly across 4 years).
Please feel free to update the code (not sure if you can in this playground) or share your own improved version in the comments.
https://leetcode.com/playground/5BQXosvF
PS: I hope you find this helpful in some way.