Rakuten Interview Question

Design a REST endpoint in Springboot. Implement a button with rendering logic on React. How would you find the 2nd largest element in array. All whiteboard