Pergunta de entrevista da empresa Appian

Given a tree based navigation on a web page write a method which allows a user to traverse it up or down by hitting cursor up or down key and also highlighting the current item.

Resposta da entrevista

Sigiloso

30 de set. de 2018

I was already given some API's I could use like node.hasChildren, node.numChildren, node.isLast, node.pathAtNode, node.currentPath. Also the path was increasing sequentially so the top most item would have path [0], then the next item would have path [1]. If this item had children then their path would be [1,0], [1,1] etc. I couldn't finish the whole logic but just the cursor key down part partially.