Hacker News new | past | comments | ask | show | jobs | submit login

Anyone else like Bob Dylan... If people cheat, I believe there is a slow train comming.

Example: I had a friend who had an interview for company XYZ, "Write a program that clicks the first link in a wikipedia entry and exits when you reach the philosophy page (implement in the language of your choice). You have 15 mins"...

My friend was a really hard working, intelligent, and honest guy and he could not do it... i doubt cheaters could do it cold.




How would this be done? What kind of language, etc. would enable this?


I decided to try it.

https://gist.github.com/eli173/c089c27db9c1302fe4e003716b402...

Perhaps I am the kind of person they are trying to avoid, but I did this in a bit less than an hour. I am very ignorant of the Python library ecosystem, so if I had known the request library better and if I knew an html parsing library, I may have been able to complete this in the time limit. I also suspect there are a few cases which break my solution.


> if I knew an html parsing library

Beautiful soup https://pypi.python.org/pypi/beautifulsoup4


Wget/sh/sed/awk/perl soup


A simple shell script with curl piped through sed or awk...


Any language with support for web crawling? I can sorta see it being done in Node with cheerio[1] and an HTTP client.

[1] https://github.com/cheeriojs/cheerio


Would probably be my first choice these days too...


Thanks! Always good to learn new things


Some kinda javascript plugin that opens every link on the page, and then every link inside the pages following until it hits philosophy? XD

The best part is you could cap it to 5 levels of recursion before it runs away.

Still no way I'd have that in 15 minutes haha. I could describe it though!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: