Apple Special Projects Group
First Round:
Q: I have a video software app, video contains sub-sections, and each sub-section consists of two attributes: length and duration. Given an array of sub-sections, write me code to find out the length of the video.
A: This question is so easy that I wasted so much time thinking that it's a trick question!
- O(N) answer: loop through the array and add all the durations.
- O(1) answer: take the last frame, add the duration and start time and return it.
Q: What's the difference between composition and inheritance?
A: This is a good question, it shows your understanding of OOP in general. I answered it using the knowledge I gathered from my past coops and casual conversations I had with SW developers throughout life... I found this on the web for people who wanna kinda know the answer, do your own search if it wasn't helpful.
Second Round:
A very nice and satisfying conversation about testing stuff! How do you have multi-levelled tests, etc. He also told me to look up mutation testing, which was really cool.