Frage im Vorstellungsgespräch bei Google

Using JS Browser DOM API available functions, write "getElementsByClassName(className)" which accepts a string className and returns a list of HTML Elements which have the required className.

Antwort im Vorstellungsgespräch

Anonym

31. Jan. 2019

I used tree traversal on the document tree and maintained a list of elements, which gets returned. The answer was simple and short, and the interviewer did not ask for any further questions about my answer.