r/compsci • • May 17 '19

20+ String Coding Interview Questions for Programmers

https://hackernoon.com/20-string-coding-interview-questions-for-programmers-6b6735b6d31c
113 Upvotes

41 comments sorted by

View all comments

104

u/[deleted] May 17 '19

If interviews ask you bullshit string questions like this don’t work there. Stop propagating a culture of rote learning and minutiae worship. This is why our industry sucks and most code in the wild is abysmal.

7

u/TheFeshy May 17 '19

This, at least 95%.

Some of these, I guess, would be okay if they are asking for one-sentence descriptions of how you would do it, to show that you understand the structure and common programming techniques ("I'd count letters by using a bucket sort" or "I'd check for anagrams by sorting the characters within the string.") And of course if you're not expected to know the best way off the top of your head, or write it all out on a white board or submit all 20 solutions in code to their automated server.

There's still better interview questions to ask, especially for anything other than an entry-level position (entry level is a bit more constrained because you can't ask them about past problems they have solved and that sort of thing.)

1

u/Kinglink May 18 '19

The problem is these prove "I can code" anyone can tell me what they did on their past problems. I mean I could tell you about any time I wrote code, but it's just as easy to lie or embellish and as much as people want to believe "I can spot a lie" I'm sure a skilled liar would fool them. You're a programmer not a lie detector.

Even if I did write the code, I don't tell you how much time I needed to write it. If I'm fluent or confident in my language of choice, or I even know how to write a for loops.

Just look up fizzbuzz questions and laugh at them, then go read testimonals of interviewers whose candidates CAN'T write out a program to print 1-100... I mean we can say "These are bad questions" all day long but the candidate who can't answer them probably isn't a good candidate.

If you can't answer these questions.... it's a really bad sign. They aren't tricks or traps necessarily, they aren't trying to go "haha the correct algorithm is." They want to see your approach (Do you ask question) and want to see if you tackle the problem well or notice edge cases brought up. I would expect most candidate to answer any of these questions with out much thought, even if it is not the optimal solution, studios should be having you prove you can program even at a basic level.