I was recently sent a code test by a potential employer to complete on my own time. The first question has to do with identifying whether a given zoning code falls within a range of codes. I'm not looking for the actual solution (someone else already tried that on SO) and I already declined to take the test since I was frustrated by this question as well as another one that was about screen scraping where the site in question was down for maintenance.
My question is just whether the "ranges" described are ambiguous or not. Is there some standard that clearly defines what is meant by "M1-1/R5 – M1-6/R10"? There is a hint for the first range that seems to suggest that this could be a self-contained question that doesn't require any domain-specific knowledge, except many of the test inputs, like C4-4A (no letters mentioned in the range with C codes), seem like they wouldn't be in any of the ranges until you research the zoning codes in New York and discover that they are actually valid, as shown in this document. Here is the original question:
Question 1 Description: Write a method which accepts a list/array of codes and returns the code along with its description as JSON. Note that the range for R1-1 - R10H encompasses R1-1 to R10-10 and R1A to R10H.
Bonus: Write a unit test.
Description Data:
Codes Descriptions
---------------------------------------------------------------
R1-1 - R10H General Residence Districts
C1-6 - C8-4 Commercial Districts
M1-1 - M3-2 Manufacturing Districts
M1-1/R5 – M1-6/R10 Mixed Manufacturing & Residential Districts
BPC Battery Park City
PARK New York City Parks
PARKNYS New York State Parks
PARKUS United States Parks
ZNA Zoning Not Applicable
ZR 11-151 Special Zoning District
Example output:
Given ['M3', 'R3-2', 'PARKNYS', 'M1-3/R9']
{
"codes":[
{"code":"M3", "description”:”Not found“},
{"code":"R3-2", "description":"Residential Districts"},
{"code":"PARKNYS", "description":"New York State Parks"},
{"code":"M1-3/R9", "description":"Mixed Manufacturing & Residential Districts"}
]
}
Input:
The list is:
R7A
R8A
C4-4A
M3-2
R8B
C1-6A
R7B
R8X
C1-7A
PARK
C1-9A
R6
C1-7
C2-6
R10
C4-5
C6-3X
C1-6
C6-2M
C6-4M
M2-4
M1-5/R7X
UPDATE: The answer from MichaelT makes some good points, but I disagree that the hint in the first question gives you the complete list of zoning codes. It only does so for the first range.
Aucun commentaire:
Enregistrer un commentaire