GithubHelp home page GithubHelp logo

palindrome's Introduction

No, I will not write you a palindrome tester

For better or worse, this question seems to come up all the time for software engineering roles. You talk to a recruiter and get screened a little on background and desired salary. Next up, you talk to someone over the phone and then you screen share and do some bullshit "programming exercise", like write code that can detect if it received a palindrome.

I joked with a friend of mine that I was 3-4 on the palindrome question. What I didn't understand was why did the one company pass on me when the other three proceeded to move me to the next round?

"Did you use recurssion?" he asked.

"Um, no. I just take a string and then create a new string by iterating over the first string backwards. Then I compare the two strings with the equals method," I was confused.

"Yeah, you should create a function that trims the first character of the string and compares it to the last character. If equal, send a trimmed string back to the function and repeat. It's faster this way because it breaks the loop at the first sign of not being a match."

So, here it is. A recursive palindrome tester in Java. Clone this repo.

javac Palindrome.java

java Palindrome Taco cat

Comes back true.

java Palindrome Coding interviews are stupid

Comes back false, but the real answer is true.

For all of this supposed shortage of talent in tech, it is hiring practices like this that are causing the problem. As an employer in an industry that values INNOVATION why interview candidates based on their ability do rote memorization? Do you want to hire canidates who read "Cracking the Coding Interview" or candidates who can actually think?

Most problems in Software Engineering come from being able to understand requirements, push back on bad decisions, and knowing how to do CRUD operations. Knowing how to store the data, secure the data, and retrieve the data along with sensible validation rules are waaaaaaaaay more important than memorizing someone else's algorithm and hoping to win the algorithm lottery.

So next time you're at an interview see if you can showcase some of your code on github, or talk about how you solved a problem in a previous role. If they still want to test a string to see if it's a palindrome, ask yourself, "Do I really want to work here?" If the answer is still yes, then pretend this is the very first time you heard this question and regurgitate this answer. You are welcome.

Personally, I think I would do my best Nancy Reagan impression and "Just say no!" Unless, of course I was interviewing at one of the FANG companies that everyone on the Blind insists is offering an $80k signing bonus, $200k in salary, and $300k in Restricted Stock Units, in which case:

I'm your private dancer, A dancer for money, And any old music will do โ€“ Tina Turner

palindrome's People

Contributors

pokerguy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.