CtrlK
BlogDocsLog inGet started
Tessl Logo

simon/skills

Auto-generated tile from GitHub (10 skills)

92

1.16x
Quality

94%

Does it follow best practices?

Impact

92%

1.16x

Average score across 44 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-17/

High-Throughput Merchant DNS Routing Service

Problem/Feature Description

DispatchHub is a logistics platform that routes real-time parcel pickup requests to the nearest available carrier. When an order arrives, the service resolves the merchant's domain name to determine their geographic region and select the appropriate regional carrier API endpoint. At peak times (major sales events), DispatchHub handles 200–500 concurrent orders per second, each requiring hostname resolution.

Recently the engineering team noticed that average order-routing latency spikes from under 5 ms to 200–800 ms during peak load. An initial investigation pointed at Node.js internals: the service is making many concurrent DNS lookups, and response times degrade in a pattern consistent with resource contention rather than network latency. A staff engineer suspects the thread pool is saturating, but wants the fix implemented with proper thread pool configuration and observability rather than a surface-level workaround.

Your job is to build a production-quality hostname routing module that resolves merchant domains efficiently under load, stays observable so the on-call team can detect saturation before customers are affected, and is configured correctly for the expected concurrency.

Output Specification

Produce the following files in your working directory:

  • service.js — The main routing service module. It should export (or demonstrate inline) a function that accepts a merchant hostname and returns its resolved IP address. It should also include monitoring logic to detect thread pool saturation.
  • package.json — With a "start" script that launches the service with the correct runtime configuration for high-throughput DNS workloads.
  • startup-instructions.txt (optional) — If any environment configuration must be set before starting the service, document it here with the exact commands or environment variable assignments.

The implementation should handle at least the following:

  • Resolving a merchant hostname to an IPv4 address
  • Returning a cached result on repeated lookups for the same hostname (with appropriate expiry)
  • Emitting a warning or log line when thread pool pressure is detected
  • Gracefully handling resolution errors

A short demo.js that exercises the routing function with a handful of example hostnames and logs the results is welcome but not required.

evals

README.md

tile.json