Comment by place1asdf

Comment by place1asdf 2 days ago

2 replies

The coding interview question involves a collection of points (places) on a 2D grid. Places and Queries against those places are listed in sequential order in a commands.txt file in a colon-seperated format. A query is a circle with a center point and radius, along with a collection of 0-N expected places contained within it.

    Place - id, x, y
    Query - id, x, y, radius, expected return values (comma-separated)
The task is to persist the places data in sequence and ensure queries return the set of expected places out of all places that have been seen so far. This is a basic geometry problem - if the euclidian distance (x^2 + y^2 = r^2) between any place and the circle's center is less than the radius, the place is contained in the circle. You should anticipate thinking of ways to optimize once the dataset gets very big if you successfully complete the specific task within the allotted time.

    # commmands.txt example

    place-1:34.7:94.5
    place-2:54.1:5.2
    query-1:15.2:17.1:5.0:                  # no results expected
    place-3:44.9:27.4
    query-2:35.0:94.0:2.0:place-1           # one result expected
    ...
    query-100:50.0:30.0:place-27,place-64   # multiple results expected
    ...
dang 2 days ago

Please don't do this here.

  • place1asdf a day ago

    Understood, will avoid doing so in the future. I see it's already been detached.

    It's not clear this comment specifically violated any of the guidelines, but I appreciate that more of the same would deteriorate the spirit of the monthly hiring roundup. Given HN is IMO one of the last remaining places on the internet worth visiting, I'm happy to oblige a request from mods that seem to be both reasonable and honorable in how they go about maintaining that community (touche).

    In GOT, Littlefinger correctly points out to Sansa, "There is no justice in this world, not unless we make it." I slept better last night having posted this solution after radio silence following three interviews and a followup email. Some balance has been restored to the moral universe, even if it was just a minor annoyance to $CORPORATION.

    A more productive and appropriate solution would be to assemble and then post a ShowHN submission of a repository of anonymously-submitted technical interview problems associated with corporations that elect to conduct business like this. I'll opt for that route in the future and hopefully be in the position to use my actual name, when I'm not threatened by the asymmetry of doing so.

    Know your worth, kids. Keep at it, work those side projects, build your website, keep your head up. Programming rocks, corporations don't. Happy holidays <3