Implement a custom version of the getElementsByTagName method from scratch.
Asked in frontend interviews at Google, Dropbox and LinkedIn