/investec-coding-assignments-go

Investec Bank coding assignments done in Go

Primary LanguageGo

investec-coding-assignments-go

Investec Bank coding assignments in Go

These assignments are required by Investec to be done in Java, but I thought I'd do them in Go as well.

Assignment Questions

  1. Find the greatest common divisor for a given array of integers.

  2. Given the attached addresses.json file which contains an array of addresses, do the following:

    a. Write a function to return a pretty print version of an address in the format: Type: Line details - city - province/state - postal code – country.

    b. Write a function to pretty print all the addresses in the attached file.

    c. NA

    d. Write a function to validate an address.

    i. A valid address must consist of a numeric postal code, a country, and at least one address line that is not blank or null.

    ii. If the country is ZA, then a province is required as well.

    e. For each address in the attached file, determine if it is valid or not, and if not give an indication of what is invalid in a message format of your choice.