Aspire Systems Interview Question

some coding question from c++ and sql