Two coding questions. The first was a front end JS coding challenge to create query refiner-like selection boxes from the given raw data in object. Coding was performed directly on the laptop provided by interviewer. The next was a white board coding that is to write a function on the white board to return the subtree nodes under an input node from the raw data that represents the tree.
Anonymous
<div> Checkbox selection </div> /* *javascript could be like below * @checkboxes variable is initialised here but we can make the same through some API call as well. Store the * response in the same variable and then the further code will be same. */ function renderCheckBoxes() { let checkboxes = [ {'label':'Checked', value: true}, {'label':'Unchecked', value: false} ], html = ''; wrapper = document.getElementsByClassName("checkbox-wrapper")[0]; for (let i=0; i ${checkboxes[i].label}`; } wrapper.innerHTML += html; }); //call the function via required event or directly. renderCheckBoxes(); //any improvements will be most welcome.
Check out your Company Bowl for anonymous work chats.