Software Engineer - Backend Test
Software Engineer - Backend Test
As you can see there are many categories in the website (travel and entertainment, lifestyle and
wellness, F&B, etc).
Please explore each categories using code written in NodeJS. Do not hard code the url of
each category. But it’s ok to hard code this URL https://www.bankmega.com/promolainnya.php
as the starting point
We want you to get all the information about all the promo in each category. So go explore the
links in each categories and get all the promotion in that categories. Don’t forget each category
has pagination link below so please go through each page in the categories. For each
promotion, give me the promotion title, image url, and all other detail that is described in the
promotion. For image promotion, you can grab the image from promotion detail, for example:
https://www.bankmega.com/promo_detail.php?id=874 has an image and other info that you can
grab
The ordering of the promotions doesn’t matter as long as they are inserted to the correct
category. So you can parallelize the scraping to make it faster. (hint use Promise.all or
Promise.map)
At Cermati, we value individual who likes challenges, is a fast learner, can learn things
independently and have an awesome work ethic.
I will share with you several npm packages that might be useful: (you don't have to use this
though)
1. https://github.com/request/request (to make request)
2. https://github.com/cheeriojs/cheerio (to parse the html and pull data from it)
3. https://www.npmjs.com/package/bluebird (Promise to handle the asynchronous nature of
javascript)
Promise.js has a parallel function. So try to use the "parallel" way of scraping to make scraping
faster.
Thanks, let us know if you have questions. And if you want to know more about our engineering
team, please visit engineering.cermati.com