Member-only story
Prepare For A Coding Tech Interview Part 2

Do you want to get a job as a coder / software developer or switch to other company? In this series I’ll share information how to solve coding tasks, how to prepare CV and answers to the most popular interview questions for coding positions to land a new coding job!
Hi! My name is Tom Smykowski. I’ve interviewed hundreds of people and also participated in hundreds of interviews to choose companies I worked for. This gives me an insight into how to win a tech interview
Today let’s talk about basic programming questions again. You can of course ask AI to solve them, but you’ll get ready solution. So I’ll focus only how to solve these tasks, and you can implement them in any language you want. You may stumble upon these tasks even if it’s completely unrelated to the role you’re applying. But in this article we’ll focus only on how to solve them:
1. Check for Palindrome
Question: Determine if a given string is a palindrome (reads the same forward and backward).
Example Input: "racecar"
Example Output: True
Since palindrome reads the same forward and backwards, what you can do to check if a string is a palindrome is this:
- Take n and iterate over it from 0 to half of the string length
- Check if the character on n position and (string length — n) is different
- If it’s different = it’s not a palindrome (you can skip loop)
- If you finished the loop and all were the same — it’s a palindrome
In this implementation you need to calculate center of the string and take the floor of it for point 2. Because for example “abba” has length of 4. Half is two. That is ok. But “catac” length is 5, half of 5 is 2.5. Floor of 2.5 is 2. So you’ll check for n = 1, and n = 2. You don’t have to check the middle letter because it’s irrelevant (whatever it is, the string is palindrome).
2. Find the Missing Number in an Array
Question: Given an array containing numbers from 1 to n
except one missing number, find the missing number.
Example Input: [1, 2, 4, 5, 6]
Example Output: 3