Robinhood Fontend Interview

You are given a piece of simple HTML code like

A
B
C

implement a class (I forgot the name but let’s call it A)
const solution = new A();

first part:
A.find(“A”).color(“red”)
find: get the element which has innerText “A”
color: set the background color of the found element;

second part
A.find(“A”).click((e) => console.log('")).find(“B”).click(…).color(“red”)
click: print the innerText of founded element

third part:
A.find(“A”).delay(5000).color(“red”).color(“blue”).afterDelay(() => { console.log(…)})
delay: make the element first turn blue after 5 seconds then turn red
afterDelay: after 5 seconds print the element’s innerText