For the 7th round, we're going to let our Software Engineering Manager, DeShawn Williams, take you into the whiteboard room for another short interview.
Given a string, find the length of the longest palindromic substring in it.
Did you know you can google that homework problem, friend?
Easton Robinson
import mlpy
def lcp(s): s = [ord(x) for x in s] return mlpy.lcs_std(s, s[::-1])[0]
Jayden Hall
>import solution >solution.do(muh_data)
Gabriel Phillips
Reducing a specific problem to a well understood classic problem is a lot more useful than some shitty adhoc solution.
Elijah Young
wrong >The longest palindromic substring problem should not be confused with the different problem of finding the longest palindromic subsequence
Isaiah King
Tell me again why people want these jobs so badly?
Juan Watson
What are you on about? Substring is just the subsequence of a string. And to get the length of the longest palindromic substring you have to find it first.
Thomas Turner
Thank you for your time, but we've decided to not continue on account of your argumentative approach and lack of attention to detail.
Friendly reminder that you should be able to do this in linear time, some random dude did it 43 years ago.
Christopher Long
Oh wow, you're actually right. My bad.
Jose Johnson
Cheers for the tone switch. Yeah, that's a common enough mix up that it's mentioned in multiple places - both the LPS article and the substring and subsequence ones. Happens to most of us, in any case.
Ian Morgan
Substring is not same as subsequence.... Well. I have learned something today.
Adrian Brooks
bool is_palindromic(char* str, int start, int end){ while(start
Easton Morris
>O(n^3)
>while(startreturn max; >}
Josiah James
>perform obtuse, minimal use case problems or you're a BRAINLET I dont have a problem with these kinds of problems except when its tedious string analysis. Strings are almost always a pain in the cock to manipulate and analyze programmatically and its almost never needed in production.
Nolan Morales
>working solution is provided >NO YOURE WRONG Did you want a solution or not? Nobody expects optimization in a whiteboard problem
Jack Martinez
>Nobody expects optimization in a whiteboard problem
Justin Reed
fuck you
Mason Wilson
That's right though. If he doesn't tell you that he wants a solution with a certain run time then it doesn't matter.
Austin Kelly
It seems you are lost, friend. Here:
Jaxon Bell
It's not a bad idea to qualify your code with "shit perf tho, we can optimize it to quadratic or even linear" disclaimers, so they don't mistake you for a pajeet
Josiah Wood
Well, if Chad is also applying for the same position and his algorithm is more efficient, we will of course hire Chad instead of you Pajeet.
Brandon Bennett
Only matters if the function is a bottleneck, which string manipulators never are, because once again theyre never used
Hudson Allen
Eh, depends. If Chad wastes a lot of time optimizing the code without being asked to, I'd hire the other guy.
Tyler Martinez
Which is something you should say to the interviewers, lest they think you're part of the "complexity, what's that?" generation, or a "small-scale complexity instead of whole-solution priorities" autist.
for i in range(0,l-1): # Compute length 1 and 2 palindromes dp[i][i] = 1 if s[i] == s[i+1]: dp[i][i+1] = 1 longest=s[i:i+2]
for palLen in range(2,l): # Compute length 3+ palindromes based on the previous init of 1 and 2 for i in range(0, l-palLen): j = i + palLen if dp[i+1][j-1] > 0 and s[i] == s[j]: dp[i][j] = 1 if j-i+1 > len(longest): longest = s[i:j+1] return longest
Oliver Davis
Okay so add a single comment at the top that just says "unoptimized solution"
Carson Collins
>if the function is a bottleneck, which string manipulators never are, because once again theyre never used >what is bioinformatics
Carson Gutierrez
Bioinformatics leverages parrallel computing not single threaded O(n^x) classic algorithms
Thomas Flores
Maybe python isn't that hard
Isaiah Gonzalez
>7 rounds of interviewing >software engineering manager What kind of shitty company is this, and why the fuck are we wasting our time with it.
Aaron Rogers
>implying your NEET status is going to impress other companies
Austin Stewart
Just because you've never gotten a job doing actual programming doesn't mean the rest of us don't know what's involved in the interviewing process.
>parallel computing is magic fairy dust that doesn't involve time/space complexity oh boy
Cameron Martinez
in erlang it's basically magic fairy dust
Joseph Cox
>in erlang it's basically magic fairy dust sure, that's the boilerplate taken care for you still >in erlang it's basically magic fairy dust that still runs slower or faster depending on the algorithm's time complexity