"Remember, this is a probabilistic approach and works well if the lines in your file are roughly the same length. If the line lengths vary significantly, some lines will have a higher or lower chance of being selected."
It had already addressed "the real problem with its implementation" that you pointed out.
> PS in the case of dictionary words with a length limit of say 30 letters, there is still an O(k) general solution using rejection sampling.
Again, what ChatGPT wrote:
"In a typical scenario where lines can have variable lengths, true O(k) random sampling isn't feasible without some prior knowledge about the file."
Knowing that the limit is 30 characters without question counts as "some prior knowledge".
As an interviewer, it sounds like you're not hearing what the candidate is saying.
> And it definitely shows the limits of GPT here
I don't think anyone here is claiming that ChatGPT is limitless. The topic is "a coder considers the waning days of the craft", not "a coder considers the bygone days of the craft." ChatGPT is capable of solving many real world problems already. If it continues improving, some people are concerned about what that could mean, especially for less experienced developers.
How many people have you interviewed with that brainteaser that have actually provided the complete solution you're looking for? Vanishingly few, I would imagine, unless you were dropping some serious hints. It's not a real world problem. Most brainteasers have solutions that are "conceptually simple" once you already know the solution.
> I'd prefer to think it's more like a real engineering problem, and less like a simple interview question
It's absolutely not, though. It's exactly like the infamous trick questions that many tech interviews are known for, which have nothing to do with real engineering that you would encounter on the job.
You might as well have someone invert a binary tree for all the value that it provides.
"Remember, this is a probabilistic approach and works well if the lines in your file are roughly the same length. If the line lengths vary significantly, some lines will have a higher or lower chance of being selected."
It had already addressed "the real problem with its implementation" that you pointed out.
> PS in the case of dictionary words with a length limit of say 30 letters, there is still an O(k) general solution using rejection sampling.
Again, what ChatGPT wrote:
"In a typical scenario where lines can have variable lengths, true O(k) random sampling isn't feasible without some prior knowledge about the file."
Knowing that the limit is 30 characters without question counts as "some prior knowledge".
As an interviewer, it sounds like you're not hearing what the candidate is saying.
> And it definitely shows the limits of GPT here
I don't think anyone here is claiming that ChatGPT is limitless. The topic is "a coder considers the waning days of the craft", not "a coder considers the bygone days of the craft." ChatGPT is capable of solving many real world problems already. If it continues improving, some people are concerned about what that could mean, especially for less experienced developers.
How many people have you interviewed with that brainteaser that have actually provided the complete solution you're looking for? Vanishingly few, I would imagine, unless you were dropping some serious hints. It's not a real world problem. Most brainteasers have solutions that are "conceptually simple" once you already know the solution.
> I'd prefer to think it's more like a real engineering problem, and less like a simple interview question
It's absolutely not, though. It's exactly like the infamous trick questions that many tech interviews are known for, which have nothing to do with real engineering that you would encounter on the job.
You might as well have someone invert a binary tree for all the value that it provides.