What Interviewers Want | Question #2 | Palindrome Strings

  1. I don’t like taking interviews because it takes away from my time
  2. I don’t like to judge them because I judge them in real life all the time
  3. I don’t like rejecting people because rejection is never easy, irrespective of whether you are at the receiving end or rejecting end of it.
  4. I’m just lazy. PERIOD.

All said and done, I’m forced to take interviews at least once in a day. For the past 2+ years of lockdown (the period when we got the awesome Work From Home), our panel of interviewers is bombarded with interview schedules. We take interviews on the week days with an assumption that we would compensate the work of the lost interview time. Since this isn’t enough of a torture, the superiors (management and HR combined) asks us to conduct a weekend drive. A weekend drive is essentially wasting your Saturday to interview people that you aren’t going to hire.

You see how painful that is?

It doesn’t help that the candidates we interview are mostly garbage, and I’m being polite here.

What Interviewers Want, really?

After years of frustration, I think it’s time to part some wisdom here. After interviewing tons of people, I think I should now write a series of blog posts of what exactly I look for in a candidate.

Today is my unofficial first job anniversary. It was Friday August 12, 20XY when I joined my first company, and that’s why I’m starting this series today. Smart and thoughtful, I told you.

As for the title, it mimics What Women Want. I’m such a smarty-pant. You will see this often.

This series couldn’t fit in my already cluttered website The Other Me Unfolded, hence I’m using this new blog to share the same.

Alright, without much further ado, let’s get started.

PS: As I write this, I have 12 open positions for Java/Full Stack developers. If you’re interested and confident that you can be a good addition to my team, drop me a note. I would be more than happy to recommend your CV (and earn a referral bonus).

Q2: Write a Java Program to Find Palindrome Strings

Given two unequal size integer array, write a program to output index-base comparison to return an array containing maximum of the two arrays.


a = [10,2,3,4,55]
b = [3, 5,6,8,23,56]

out = [10,5,6,8,55,56]

What Interviewer Wants

  1. Palindrome strings read the same from both ends: level, radar, pop. You should know that.
  2. Don’t start with accepting the input from user. In other words, don’t give the answer that you find elsewhere on internet.
  3. Don’t try to be too smart and use reverse function; we are not looking for that. We are looking to test your programming skills, not your knowledge of Java APIs.
  4. You might think of providing your own code to do the reverse, but think again. Is it efficient?
  5. Focus on the core logic of the function. i.e.

    Write the body of below function:

    public boolean isPalindrome(String input) {

    }

  6. Try to be efficient in your response.
/**
 * 
 * Write a Java program to determine whether the input string is a palindrome or
 * not.
 * 
 * @author Shabana Mukhtar
 *
 */

public class Question2 {

	public static void main(String[] args) {
		Question2 q = new Question2();
		String input = "level";
		System.out.printf("Is %s palindrome? %s", input, q.isPalindrome(input));
		input = "abbdba";
		System.out.println();
		System.out.printf("Is %s palindrome? %s", input, q.isPalindrome(input));
	}

	public boolean isPalindrome(String input) {
		if (input == null || input.length() == 0) {
			return true;
		}
		int length = input.length();
		int mid = length / 2;
		for (int i = 0; i < mid; i++) {
			if (input.charAt(i) != input.charAt(length - i - 1))
				return false;
		}
		;
		return true;
	}
}

When you run the program, you will get output as below:

Is level palindrome? true
Is abbdba palindrome? false

Shabana Mukhtar 

 

If you have read my post, you might already be aware of the reason of this post. You can scrolldown and read the real question. If not, be my guest and read through these words of wisdom (and frustration).

Interviews Suck

Being a Senior Software Specialist, taking interviews is part of my work profile. And, this is also one of the most hated parts of my job. The reasons are three-fold.

  1. I don’t like taking interviews because it takes away from my time
  2. I don’t like to judge them because I judge them in real life all the time
  3. I don’t like rejecting people because rejection is never easy, irrespective of whether you are at the receiving end or rejecting end of it.
  4. I’m just lazy. PERIOD.

All said and done, I’m forced to take interviews at least once in a day. For the past 2+ years of lockdown (the period when we got the awesome Work From Home), our panel of interviewers is bombarded with interview schedules. We take interviews on the week days with an assumption that we would compensate the work of the lost interview time. Since this isn’t enough of a torture, the superiors (management and HR combined) asks us to conduct a weekend drive. A weekend drive is essentially wasting your Saturday to interview people that you aren’t going to hire.

You see how painful that is?

It doesn’t help that the candidates we interview are mostly garbage, and I’m being polite here.

What Interviewers Want, really?

After years of frustration, I think it’s time to part some wisdom here. After interviewing tons of people, I think I should now write a series of blog posts of what exactly I look for in a candidate.

Today is my unofficial first job anniversary. It was Friday August 12, 20XY when I joined my first company, and that’s why I’m starting this series today. Smart and thoughtful, I told you.

As for the title, it mimics What Women Want. I’m such a smarty-pant. You will see this often.

This series couldn’t fit in my already cluttered website The Other Me Unfolded, hence I’m using this new blog to share the same.

Alright, without much further ado, let’s get started.

PS: As I write this, I have 12 open positions for Java/Full Stack developers. If you’re interested and confident that you can be a good addition to my team, drop me a note. I would be more than happy to recommend your CV (and earn a referral bonus).

Q2: Write a Java Program to Find Palindrome Strings

Given two unequal size integer array, write a program to output index-base comparison to return an array containing maximum of the two arrays.


a = [10,2,3,4,55]
b = [3, 5,6,8,23,56]

out = [10,5,6,8,55,56]

What Interviewer Wants

  1. Palindrome strings read the same from both ends: level, radar, pop. You should know that.
  2. Don’t start with accepting the input from user. In other words, don’t give the answer that you find elsewhere on internet.
  3. Don’t try to be too smart and use reverse function; we are not looking for that. We are looking to test your programming skills, not your knowledge of Java APIs.
  4. You might think of providing your own code to do the reverse, but think again. Is it efficient?
  5. Focus on the core logic of the function. i.e.

    Write the body of below function:

    public boolean isPalindrome(String input) {

    }

  6. Try to be efficient in your response.
/**
 * 
 * Write a Java program to determine whether the input string is a palindrome or
 * not.
 * 
 * @author Shabana Mukhtar
 *
 */

public class Question2 {

	public static void main(String[] args) {
		Question2 q = new Question2();
		String input = "level";
		System.out.printf("Is %s palindrome? %s", input, q.isPalindrome(input));
		input = "abbdba";
		System.out.println();
		System.out.printf("Is %s palindrome? %s", input, q.isPalindrome(input));
	}

	public boolean isPalindrome(String input) {
		if (input == null || input.length() == 0) {
			return true;
		}
		int length = input.length();
		int mid = length / 2;
		for (int i = 0; i < mid; i++) {
			if (input.charAt(i) != input.charAt(length - i - 1))
				return false;
		}
		;
		return true;
	}
}

When you run the program, you will get output as below:

Is level palindrome? true
Is abbdba palindrome? false

Shabana Mukhtar 

 

If you have read my post, you might already be aware of the reason of this post. You can scrolldown and read the real question. If not, be my guest and read through these words of wisdom (and frustration).

Interviews Suck

Being a Senior Software Specialist, taking interviews is part of my work profile. And, this is also one of the most hated parts of my job. The reasons are three-fold.

  1. I don’t like taking interviews because it takes away from my time
  2. I don’t like to judge them because I judge them in real life all the time
  3. I don’t like rejecting people because rejection is never easy, irrespective of whether you are at the receiving end or rejecting end of it.
  4. I’m just lazy. PERIOD.

All said and done, I’m forced to take interviews at least once in a day. For the past 2+ years of lockdown (the period when we got the awesome Work From Home), our panel of interviewers is bombarded with interview schedules. We take interviews on the week days with an assumption that we would compensate the work of the lost interview time. Since this isn’t enough of a torture, the superiors (management and HR combined) asks us to conduct a weekend drive. A weekend drive is essentially wasting your Saturday to interview people that you aren’t going to hire.

You see how painful that is?

It doesn’t help that the candidates we interview are mostly garbage, and I’m being polite here.

What Interviewers Want, really?

After years of frustration, I think it’s time to part some wisdom here. After interviewing tons of people, I think I should now write a series of blog posts of what exactly I look for in a candidate.

Today is my unofficial first job anniversary. It was Friday August 12, 20XY when I joined my first company, and that’s why I’m starting this series today. Smart and thoughtful, I told you.

As for the title, it mimics What Women Want. I’m such a smarty-pant. You will see this often.

This series couldn’t fit in my already cluttered website The Other Me Unfolded, hence I’m using this new blog to share the same.

Alright, without much further ado, let’s get started.

PS: As I write this, I have 12 open positions for Java/Full Stack developers. If you’re interested and confident that you can be a good addition to my team, drop me a note. I would be more than happy to recommend your CV (and earn a referral bonus).

Q2: Write a Java Program to Find Palindrome Strings

Given two unequal size integer array, write a program to output index-base comparison to return an array containing maximum of the two arrays.


a = [10,2,3,4,55]
b = [3, 5,6,8,23,56]

out = [10,5,6,8,55,56]

What Interviewer Wants

  1. Palindrome strings read the same from both ends: level, radar, pop. You should know that.
  2. Don’t start with accepting the input from user. In other words, don’t give the answer that you find elsewhere on internet.
  3. Don’t try to be too smart and use reverse function; we are not looking for that. We are looking to test your programming skills, not your knowledge of Java APIs.
  4. You might think of providing your own code to do the reverse, but think again. Is it efficient?
  5. Focus on the core logic of the function. i.e.

    Write the body of below function:

    public boolean isPalindrome(String input) {

    }

  6. Try to be efficient in your response.
/**
 * 
 * Write a Java program to determine whether the input string is a palindrome or
 * not.
 * 
 * @author Shabana Mukhtar
 *
 */

public class Question2 {

	public static void main(String[] args) {
		Question2 q = new Question2();
		String input = "level";
		System.out.printf("Is %s palindrome? %s", input, q.isPalindrome(input));
		input = "abbdba";
		System.out.println();
		System.out.printf("Is %s palindrome? %s", input, q.isPalindrome(input));
	}

	public boolean isPalindrome(String input) {
		if (input == null || input.length() == 0) {
			return true;
		}
		int length = input.length();
		int mid = length / 2;
		for (int i = 0; i < mid; i++) {
			if (input.charAt(i) != input.charAt(length - i - 1))
				return false;
		}
		;
		return true;
	}
}

When you run the program, you will get output as below:

Is level palindrome? true
Is abbdba palindrome? false

Shabana Mukhtar 

 

If you have read my post, you might already be aware of the reason of this post. You can scrolldown and read the real question. If not, be my guest and read through these words of wisdom (and frustration).

Interviews Suck

Being a Senior Software Specialist, taking interviews is part of my work profile. And, this is also one of the most hated parts of my job. The reasons are three-fold.

  1. I don’t like taking interviews because it takes away from my time
  2. I don’t like to judge them because I judge them in real life all the time
  3. I don’t like rejecting people because rejection is never easy, irrespective of whether you are at the receiving end or rejecting end of it.
  4. I’m just lazy. PERIOD.

All said and done, I’m forced to take interviews at least once in a day. For the past 2+ years of lockdown (the period when we got the awesome Work From Home), our panel of interviewers is bombarded with interview schedules. We take interviews on the week days with an assumption that we would compensate the work of the lost interview time. Since this isn’t enough of a torture, the superiors (management and HR combined) asks us to conduct a weekend drive. A weekend drive is essentially wasting your Saturday to interview people that you aren’t going to hire.

You see how painful that is?

It doesn’t help that the candidates we interview are mostly garbage, and I’m being polite here.

What Interviewers Want, really?

After years of frustration, I think it’s time to part some wisdom here. After interviewing tons of people, I think I should now write a series of blog posts of what exactly I look for in a candidate.

Today is my unofficial first job anniversary. It was Friday August 12, 20XY when I joined my first company, and that’s why I’m starting this series today. Smart and thoughtful, I told you.

As for the title, it mimics What Women Want. I’m such a smarty-pant. You will see this often.

This series couldn’t fit in my already cluttered website The Other Me Unfolded, hence I’m using this new blog to share the same.

Alright, without much further ado, let’s get started.

PS: As I write this, I have 12 open positions for Java/Full Stack developers. If you’re interested and confident that you can be a good addition to my team, drop me a note. I would be more than happy to recommend your CV (and earn a referral bonus).

Q2: Write a Java Program to Find Palindrome Strings

Given two unequal size integer array, write a program to output index-base comparison to return an array containing maximum of the two arrays.


a = [10,2,3,4,55]
b = [3, 5,6,8,23,56]

out = [10,5,6,8,55,56]

What Interviewer Wants

  1. Palindrome strings read the same from both ends: level, radar, pop. You should know that.
  2. Don’t start with accepting the input from user. In other words, don’t give the answer that you find elsewhere on internet.
  3. Don’t try to be too smart and use reverse function; we are not looking for that. We are looking to test your programming skills, not your knowledge of Java APIs.
  4. You might think of providing your own code to do the reverse, but think again. Is it efficient?
  5. Focus on the core logic of the function. i.e.

    Write the body of below function:

    public boolean isPalindrome(String input) {

    }

  6. Try to be efficient in your response.
/**
 * 
 * Write a Java program to determine whether the input string is a palindrome or
 * not.
 * 
 * @author Shabana Mukhtar
 *
 */

public class Question2 {

	public static void main(String[] args) {
		Question2 q = new Question2();
		String input = "level";
		System.out.printf("Is %s palindrome? %s", input, q.isPalindrome(input));
		input = "abbdba";
		System.out.println();
		System.out.printf("Is %s palindrome? %s", input, q.isPalindrome(input));
	}

	public boolean isPalindrome(String input) {
		if (input == null || input.length() == 0) {
			return true;
		}
		int length = input.length();
		int mid = length / 2;
		for (int i = 0; i < mid; i++) {
			if (input.charAt(i) != input.charAt(length - i - 1))
				return false;
		}
		;
		return true;
	}
}

When you run the program, you will get output as below:

Is level palindrome? true
Is abbdba palindrome? false

Shabana Mukhtar 

 

I try to moderate comments to filter out the trolls and weirdo. Your comments are welcome and opinion matter, but don't come here just to promote your content, and be nice, okay? Everyone is entitled to opinions. Alright, now go ahead, the comment section is your oyster. (I'm such a smarty pants)