Interview Code Snippet
-
@tster said:
A. Don't be a dick
B. If you are going to be a dick, don't be wrong.
Count is a property on ICollection<T>. Nobody every said anything about Count being static or calling it statically.
This code will compile:
IList<int> list = getIList();
int count = list.Count;
A. Read the original post before trying to sound smart.
B. Read the original post before trying to sound smart.
We all know that Count is a property on ICollection<T>. However, the OP (still right there for all to see!) explicitly wrote int count = IList.count(), which is completely meaningless and won't compile. But we agreed to classify that as a memory lapse and assume that he didn't actually write it that way in the interview.
-
@Shinhan said:
And? Did they hire you?
Good news! Today I received word that I passed the tests.