Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gnattwc/uwitcoding

Repository files navigation

uwitcoding

This code was written as part of a UW IT Coding Challenge as described in problem.md

setup

parse_query demo

python parse_query.py

to run unit tests

python -m unittest

note:

The instructions say the output looks like

{
    "name": ["itconnect.uw.edu.", "english"],
    "type": ["A"],
    "data": []
}

but I wasn't sure exactly what the format means. The instructions also say the details are deliberately ambiguous.

So... for my parse_query,

  1. the input string is interpreted as search terms separated by spaces
  2. its output are the dns records that
    1. match the search terms
    2. sorted by number of search term matches, highest first
    3. "transposed" into the dict format, sorted by the most matched record starting from the left
{
    'name': ['www.uwmedicine.org.', 'v23488023.s.uw.edu.', 'english.washington.edu.', 'english'],
    'type': ['TXT', 'TXT', 'CNAME', 'A'],
    'data': ['THE UW Medicine', 'reserved by someone', '192.168.1.45', '192.168.1.45']
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages