I had a front end phone interview with Amazon today. Just basic questions on how to come up with front end system design, and best practices. Like how to design a newspaper site. How to find errors. How to improve performance.
Coding question was:
/* Imagine we have a page that displays logs from our website in a table. Given these logs, write a function that tests whether a one URL
is linked to another URL, even if it take more than one link to get there. For example:
areURLsLinked("/", "/search") => true
areURLsLinked("/", "/reviews") => true
areURLsLinked("/", "/robots.txt") => false
*/
Whats the best way to get this? I used recursion and hash to keep track of previously accessed URL's so endless loops are avoided.
Thanks