Project · Go Programming (backend and cloud)
Project: UPI payment reconciliation for a pharmacy chain
The brief
Sai Medicals has three branches and gets hundreds of UPI payments a day, each with an order number in the note. You build a tested Go module that parses amounts, matches payments to orders with clear error values, alerts the owner about wrong amounts through an interface, and settles all branches at the same time without data races.
Why it matters
Reconciliation (matching money received against money expected) is core work at every fintech, payment gateway and accounting team in India. The Go skills here are the ones interviewers probe for mid-level roles: package layout with internal/, table-driven tests, sentinel and typed errors, small interfaces with fakes, and goroutines that pass go test -race.
Skills you practise
- internal/ packages and imports
- table-driven tests with t.Run
- errors.Is, errors.As and %w
- interfaces and test fakes
- goroutines, WaitGroup and Mutex
- go test -race, -cover and go vet
You need
- Go 1.22 or newer installed from go.dev/dl
- For go test -race on Windows: WSL (Ubuntu), or a C compiler such as MSYS2 MinGW-w64 gcc with CGO_ENABLED=1. On Linux and macOS it works as it is.
- An editor with Go support (VS Code with the Go extension)
What you will have at the end
A Go module example.com/upirecon with internal/money and internal/recon packages, table-driven tests that pass with -race and over 80% coverage, and a main that prints the day's reconciliation for three branches.
How it is marked (rubric, 100 points)
| Correct reconciliationMatches, duplicates, unknown orders and mismatches are counted right; totals match to the paisa. | 30 |
|---|---|
| Errors and interfacesSentinel errors wrapped with %w, a typed MismatchError used with errors.As, and a one-method Notifier with a fake in tests. | 25 |
| Safe concurrencyOne goroutine per branch, a WaitGroup, mutexes on shared state; go test -race is clean. | 25 |
| Tests and toolingTable-driven tests with named cases, 80% or more coverage, gofmt and go vet clean. | 20 |
0/7 steps done
Step 1 of 7
Lay out the module and make the money tests pass
go test -v ./internal/money/ passes every TestParse case and TestFormat.
Make a folder upirecon, run go mod init example.com/upirecon, and create every file from the tabs at its path (internal/money/money.go and so on). Code under internal/ can only be imported by this module. money_test.go is a table-driven test: one slice of cases, one loop, and t.Run gives each case a name. Write Parse so all nine cases pass: trim spaces, remove commas, reject a leading minus, split rupees and paise with strings.Cut, and wrap ErrInvalidAmount with %w in every error so errors.Is can find it.
$ mkdir upirecon && cd upirecon
$ go mod init example.com/upirecon
$ mkdir -p internal/money internal/recon
$ go test ./internal/money/$ go test -v ./internal/money/Also check yourself
Your notes: internal/money/money.go, internal/recon/recon.go, internal/recon/recon_test.go, internal/recon/settle_test.go, internal/recon/batch.go, main.go
Write down each command you ran. It goes into your project summary.