Skip to content

Instantly share code, notes, and snippets.

@alexseman
Created October 4, 2025 09:24
Show Gist options
  • Select an option

  • Save alexseman/83da12aa906ff0c3c8dad72e4a62d4c0 to your computer and use it in GitHub Desktop.

Select an option

Save alexseman/83da12aa906ff0c3c8dad72e4a62d4c0 to your computer and use it in GitHub Desktop.
Geo Node.js Test
We would like for you to build out an API exposing an endpoint that returns the geolocation info for an IP v4 address
received as a param.
# Backend
Please implement the backend in Node.js (any framework or no framework at all — your choice).
Your API should expose a single GET endpoint that receives an IPv4 address and returns its location data in JSON.
You may use this CSV file that contains partial location
data: https://github.com/alexseman/ipinfo-sample-db/blob/main/IP%20Geolocation/ip_geolocation_sample.csv. This data is
indexed by IP address and is the ultimate data source for serving data in an API. You may transform this CSV into any
other form that serves your purpose better. Note that in your solution, you must assume that this CSV file could be
40-50GB in size.
Your API response should include:
- All data fields found in the CSV (excluding the IP key fields)
- An additional `hostname` field based on reverse DNS lookup (PTR) of the queried IP address, performed dynamically at
request time.
Please make sure your solution:
- Remains responsive and efficient under high request volume - assume QPS is high & think about things like caching,
connection handling, or indexing strategies
- Tracks and persists usage metrics across restarts
- Handles invalid or unusual IPs gracefully
- Is robust — the server shouldn’t crash or block due to slow lookups or large input
Please also include a brief README explaining:
- How you approached loading and querying the dataset
- How you’d handle data updates (e.g. swapping to a new dataset version without downtime)
- What you’d consider for scaling up if traffic or dataset size grew by 10–100×
- How you’d ensure reliability if one of the components (file, DNS, network) slows down or fails
You don’t need to implement complex clustering or external services — we just want to see your reasoning and practical approach.
# Bonus: Frontend
If the position is fullstack and you have the time, you can feel free to give it a go at building a tiny FE for this -
it can be in Pion.js/React/Vue or whatever you are comfortable in.
You should create a JSON widget for exposing the response, similar to https://github.com/microlinkhq/react-json-view (
this lib is just given as an example on aesthetics, we don't mean to build something with those capabilities).
There should also be a section of the frontend that displays current API usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment