So I applied for a position as a web engineer at Mozilla Taiwan to work on firefox OS (a full html5 os to run on smartphone, super cool project), and I got a pre-interview assignment. The goal was to write a small autocomplete widget with some requirements:
- Avoid using well-known UI libraries.
- The dataset should contains around 100~1000 entries. (example of dataset provided).
- User should be blocked from submit the input unless the input
matches one of the entries.
- The whole thing should work when loading from
file:/// url, without server-side (e.g. PHP) logic. or
- Please take care of memory consumption and efficiency.
- Consider making your code unit-testable and reusable.
I spent 2-3 days on it, doing my best to have a decent widget, and the result is FrogComplete. The code is on github. There is live demo and you can find a small overview of the project on my lab page.
edit Ultimately it didn't work out for Mozilla :( /edit