Hacker News new | past | comments | ask | show | jobs | submit login

> I've had people who took 10 minutes to split a string in C# by a delimiter

Is that bad?




Everybody knows that the amount of time one should spend "splitting a string in C# by a delimiter" is 2 minutes 16 seconds. More than that and it's a "red flag".

I'm tired of all this BS really.


I don't know c# at all, but it just took me 47 seconds.

I did know that a language like that must have a string function for it, the first result of my search was a docs.microsoft.com page with the syntax and examples.


Yea, we don't know the circumstances of the question. Were they asked to implement string splitting from scratch to demonstrate their ability to do so, or was it just something they needed to use as a part of something else? Did they have access to docs or were they supposed to do it without any help? Something tells me the problem wasn't phrased as "google how to split a string in c#" so I assume there must've been more to it.

I don't know C# very well either. Taking 10 minutes to research the possible solutions and their pitfalls doesn't sound like a bad thing. What's the idiomatic way, and is there more than one commonly used way? What are the performance characteristics of each way? Are there any pitfalls and caveats (as e.g. strtok in C has when it comes threads or to strings that may have empty fields)? Do these ways modify the original string or do they produce copies? Is the delimiter a single character, a string, a regex?

This should indeed be simple and quick if all you need is to speedrun to an answer through Google. If you need to be thorough and understand the ins and outs of what you're doing, 10 minutes doesn't look like much at all for someone who doesn't have extensive & recent experience with the given language.


A good question would be, "Can I use the Split method or do you mean, implement the Split method?"


well, it's pretty common operation, so kinda weird.


It might just tell you that the person being tested hasn't spent a lot of time with C# recently. Which says little about their competency in general.


Looking at String documentation takes a few seconds. If the developer can't look at the documentation in the interview, the developer is not the problem.


This comment applies to more of my real-life interviews than any other.

So many ask, "How do you do X?" and the correct answer in a real job situation is always either "Look up the documentation for X, and do it that way.", or "There is a 20-year-old open-source library for doing X, so I'd use that."

I am not a walking catalog of esoteric programming knowledge. When working, I have 24-hour access to all official documentation, as well as all blogs, projects, and message boards on the Internet. The first step in solving any problem is checking to see if someone else already solved it.

The same goes for the brain teasers. If you can look up the problem on the Internet, I probably saw it first. Your original, non-plagiarized riddles, please, or don't bring it in to the interview.


Are there any languages other than C and assembler that don't have a function to split a string on delimiters as part of their standard library?


C has one, strtok().


I agree, but where's boundary?




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: