Lifeley is a venture-backed startup delivering the most advanced Life Insurance technology in the world. Our industry-leading software helps agents and IMO's alike run their business with efficiency.
You must be a U.S. resident living in the continental United States; do not apply otherwise.
Create a single class that when subclassed allows this sample test code to run using only the file system for storage, no pre-built database allowed; use files.* Create all classes required to pass the test case.
The id, save, delete, and find methods must be in the superclass only; subclasses must not implement these methods themselves.
Do not put your solution on Github, or a zip file, or an attachment, code is just text, email handles text just fine; you can submit the code in the body of an email as plain text. We're interested in the classes you create, not in build-able solutions or projects, just submit a fileout.
The purpose of the exercise is to see some of your code and discuss with you the solution you if you make it to an interview. Your resume will not be looked at without code that passes this test. Submit your code along with your resume to email@example.com. If we like your solution, we'll contact you to continue the process.
testProgrammer | address customer company savedCustomer savedCompany | address := (Address new) street: '56 Main St'; city: 'Mesa'; state: 'AZ'; zipCode: '38574'; yourself. customer := (Customer new) firstName: 'John'; lastName: 'Doe'; address: address; yourself. company := (Company new) name: 'Google'; address: address; yourself. self assert: customer id isNil. customer save. self assert: customer id notNil. self assert: company id isNil. company save. self assert: company id notNil. savedCustomer := Customer find: customer id. self assert: savedCustomer notNil. self assert: customer address == address. self assert: savedCustomer address equals: address. self assert: customer id equals: savedCustomer id. self assert: customer firstName equals: savedCustomer firstName. self assert: customer lastName equals: savedCustomer lastName. self assert: customer equals: savedCustomer. self deny: customer == savedCustomer. savedCompany := Company find: company id. self assert: savedCompany notNil. self assert: company address == address. self assert: savedCompany address equals: address. self assert: company id equals: savedCompany id. self assert: company name equals: savedCompany name. self assert: company equals: savedCompany. self deny: company == savedCompany. customer delete. self assert: customer id isEmptyOrNil. self assert: (Customer find: customer id) isNil. company delete. self assert: company id isEmptyOrNil. self assert: (Company find: company id) isNil