Company: Accenture NIT Patna
Difficulty: medium
Dynamic Background Color API Problem In the original assessment (Front end Technology) you finish an HTML page that has a color-box division. You must create three buttons below the box: the buttons have the ids red-button , green-button and blue-button and the texts red , green and blue ; each button's background color is red, green or blue respectively, and its text color is white; clicking a button changes the background color of the box to that button's color. The id attributes must not be changed, because the page's JavaScript uses them. This offline version has no browser. The page is served by a small backend that keeps the color of the box in memory and exposes it through three endpoints. A sequence of actions is given on standard input: user clicks on page elements and HTTP requests to the backend. Replay them in order against one shared box and print the response to every request. (inferred -- the source is a front-end task; the endpoints below are the contract of the existin