Hacker Timesnew | past | comments | ask | show | jobs | submit | gspetr's commentslogin

It's simple, unless you're given a specific broader context (like we have an enterprise customer data pruning system that needs to handle a broad range of corner cases) then you must not resort to overengineering this early in an interview.

No, there's literally a "find" str method.

str.find(sub[, start[, end]])

"Return the lowest index in the string where substring sub is found within the slice s[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 if sub is not found."

Your instinct to resort to "in" is correc,t as it's generally slower than the "in" membership test, but the interviewer has even allowed the use of Google. Blanking out after that is really bad.


I don't understand how you jumped to the membership test instead of literally the .find() method on a string?

The interviewer is not asking to solve a problem here, they're asking for a simple ability to follow instructions, hence the offer to use Google to find the correct answer.

You could make a very solid case for using "in" (it is 2-4x faster), but only after you've solved the task at hand, this is what is expected in interviews. Not knowing the interview meta makes an average Joe basically unhireable in this market.


The unfortunate answer is just that I didn’t think of .find before thinking of “in,” haha. Nothing too clever going on in my head.

The existence of a more conventional .find method does some damage to my original point. Oops.


No worries. My point is, if you get asked questions that seem simple to the point where you feel they're asking if "water is wet", then you need to keep your own thinking process extremely simple in response.

The reason is the intent behind their question, which they don't vocalize.

This question means we are dealing with an extremely broad hiring funnel designed to fail people who can't FizzBuzz and need to keep answers at MVP level.

In other words, if you are asked to put out a fire use a bucket of sand, not a state-of-the-art fire extinguisher.


Step 1: https://www.google.com/search?q=list+python+string+methods

Step 2: Parse the output with your eyes. The method is literally called "find".

This one-trick pony failure mode could perhaps have been fine for a guy who did Java and nothing but Java for 10 years, but you are supposedly the person who runs "pythonforengineers" website...

100% correct call by the interviewer.


So I don't code python. Is it find() or index() or is being terse and rude not really going to add inches to your dick?

You're thinking of a perfect world. We're not in it.

In this one there are often thousands of applicants for a position, most of which can't pass FizzBuzz.

Why would they (or anyone for that matter) choose a candidate who can't figure out how to find info about a trivial method?


Why would you be interviewing for a Python developer position if you don't know Python?

What about 'in'? index()? There are at least 3 canonical methods for basic string searches, and 8 if your include the more specialized forms (all of which are considered solutions).

Please refrain from personal attacks here. Save that for less reputable forums.



You mean the same Anthropic, that wouldn't blink an eye at intentionally overcharging users hundreds of dollars just for having a HERMES.md file in a repo, would be above taking your data for... ethical reasons?


They also INTENTIONALLY gave people full refunds for that case.


What's stopping you from making the trivial adjustment to the original question: "Who is the next likely person after Satoshi Nakamoto to have authored this"?


> Comma placement isn't really part of the language; it's part of the education system.

Interestingly, LLMs disagree with you.

Your statement is only accurate in an extremely narrow case, like if you were there to hear the person speaking, before their speech which was transcribed. Obviously, it is not true for almost all of human writing.

And if you were to go commaless, you will quickly get to rather precarious sentences, such as this one:

"Let's eat grandma."

A comma is the natural fix:

"Let's eat, grandma."


The example you've provided just adds noise.

sha256 is deterministic, LLMs are not, even at temperature set to 0.


For Jevons paradox to be a win-win, you need these 3 statements to be true:

1)Workers get more productive thanks to AI.

2)Higher worker productivity translates into lower prices.

3)Most importantly, consumer demand needs to explode in reaction to lower prices. And we're finding out in real-time that the demand is inelastic.

Around 1900, 40% of American workers worked in agriculture. Today, it's < 2%.

Which is similar to what we see with coding: The increase in demand has not exploded enough to offset the job-killing of each farmer being able to produce more food.


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

Search: