Salesforce Interview Question

2 questions on the Hackerrank website.