r/programming • • Oct 30 '13

I Failed a Twitter Interview

http://qandwhat.apps.runkite.com/i-failed-a-twitter-interview/
285 Upvotes

259 comments sorted by

View all comments

Show parent comments

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].

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.