0% found this document useful (0 votes)
54 views

Address Parser

This document outlines an address parsing problem, where a program is required to take an address string as input, parse it, and return an object with the standardized address fields of street, locality, city, state, postal code, and country. Sample input and output formats are provided, along with evaluation criteria prioritizing correctness, maintainability, and logical approach. The deliverables are the source code and a sample output file in the specified format.

Uploaded by

anoop0502
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Address Parser

This document outlines an address parsing problem, where a program is required to take an address string as input, parse it, and return an object with the standardized address fields of street, locality, city, state, postal code, and country. Sample input and output formats are provided, along with evaluation criteria prioritizing correctness, maintainability, and logical approach. The deliverables are the source code and a sample output file in the specified format.

Uploaded by

anoop0502
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Software Ability Test (Address Parser)

The Context
While doing any online transaction the address of the user is mandatory. Rather than
entering street name, locality, State etc, as separate fields, the better way to get the
address is that you can ask the user to enter the complete address in one field. What
the merchant will require would be the exact address with different fields like street,
locality, city, zip code etc.

The Problem
You will be given an address in a string, you need to parse the address from the
string and return the structure Address.

Signature Address parseAddress(String address)


:
Input: String with address(e.g. “Lunkad Tower, 6th floor, \r\n
Viman Nagar, \r\n Pune 411014")
Output: The structure Address

public class Address


{
public string Street {get;set;}; // Lunkad Tower, 6th floor
public string Locality {get;set;}; // Viman Nagar
public string City {get;set;}; // Pune
public string State {get;set;}; // MH, Maharashtra
public string PostalCode {get;set;}; // 60611
public string Country {get;set;}; // e.g. India, IN
}

Sample Input:
Find attached sample input test file where each address is separated by a blank line.

Address parsing
inputs.txt
Expected Output:
We want your application to parse all the given addresses in the attached input file.
The output should be in a text file containing all the parsed addresses, where each
parsed output address is in the following format:
Street|Locality|City|State|PostalCode|Country
Each address output should be in a new line.
In case any of the address field is missing, leave the space blank between the “|”
(pipe) separators. Don’t remove the pipe separators.
For example, if State is not mentioned in the input string, the output should be:
Street|Locality|City| |PostalCode|Country

Hints & Guidelines


I. Your faithful friend (www.google.com)
II. Hint: If you don’t understand the problem, “ASK”
III. DON’T hardcode

Indigo Architects Proprietary & Confidential Page 1 of 2


Software Ability Test (Address Parser)

Our Evaluation Criteria


Your deliverables will be evaluated on the following criteria:

1. Correctness: Functionally correct


2. Maintainability: The code should reflect a good coding discipline
(standards, best-practices, etc)
3. Approach & Basis of logic used, assumptions made
Thinking:

Deliverables
1. Mandatory: Compilable source code (self-documented) in any language. Sample
output text file in the format mentioned.
2. Extra Credits: Ideas to evolve code

Indigo Architects Proprietary & Confidential Page 2 of 2

You might also like