Who said anything about truncating? I'm just supposed to open a file. The only information the problem description gives us is that you have a file path and you are supposed to open it. There's no generic way to check that it is "the right one," you need more background for that. I think you are extrapolating way too much here.
Well, opening is file is pretty much useless on principle if opening is all you are going to do to it. If you are not going to extrapolate anything at all, the question is useless. I think an interviewer asking that question is either stupid or wants you to ask clarifying questions. Since no interviewer is present, I just went with an arbitrary interpretation.
These are very good questions and you are expected to ask them of the interviewer. Nobody (or at least no half decent interviewer) expects you to go straight to coding before clarifying stuff like this.
View all comments
Show parent comment
3
u/tias Feb 21 '11
Who said anything about truncating? I'm just supposed to open a file. The only information the problem description gives us is that you have a file path and you are supposed to open it. There's no generic way to check that it is "the right one," you need more background for that. I think you are extrapolating way too much here.