MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1pjc6i/i_failed_a_twitter_interview/cd4kgd5
r/programming • u/mobby1982 • Oct 30 '13
259 comments sorted by
View all comments
Show parent comments
2
The specific question was given further down the thread (and technically it's not even filtering):
Given an interval [a, b], and a list of intervals [x, y], [z, w], ..., return 'true' if all the intervals in the list are fully contained in [a, b].
1 u/balefrost Nov 11 '13 intervals.All(i => i.IsFullyContainedBy(testInterval))I can't tell if using built-in features is cheating, or the best way possible to answer an interview question. 1 u/oridb Nov 11 '13 It's neither; I'd be pretty glad to see that you know the API well enough to use it, and then I'd follow up by making sure you knew how to come up with your own algorithms as well.
1
intervals.All(i => i.IsFullyContainedBy(testInterval))
I can't tell if using built-in features is cheating, or the best way possible to answer an interview question.
1 u/oridb Nov 11 '13 It's neither; I'd be pretty glad to see that you know the API well enough to use it, and then I'd follow up by making sure you knew how to come up with your own algorithms as well.
It's neither; I'd be pretty glad to see that you know the API well enough to use it, and then I'd follow up by making sure you knew how to come up with your own algorithms as well.
2
u/oridb Nov 01 '13 edited Nov 01 '13
The specific question was given further down the thread (and technically it's not even filtering):
Given an interval [a, b], and a list of intervals [x, y], [z, w], ..., return 'true' if all the intervals in the list are fully contained in [a, b].