Skip to content

Aman1531/bookinGuru-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend Recruitment Task

Run it as (npm install && npm start)
Access the API at localhost:3000/cities
Optional Query params are country page limit

Determination of the valid city name is done in 3 steps:

The extra data at the begining & end of the name is removed . At the begining of the name there can be generic nouns like station district followed by hyphen this fact can be used to construct the regex Trailing strings are the generic nouns in brackets like (Zone), (District)

Then the accent marks are removed followed by triming & replacement of spaces with underscores

Lastly the invalid names can filtered based on wiki API response.

Limitations The regex step may fail to sanitize in case the name comes in unexpected format . A list of valid city names to search can be a more foolproof but costly way to cover such cases.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published