20+ String Coding Interview Questions for Programmers

hackernoon.com hackernoon.com2 years ago in#Dev Love29

Originally published by Javin Paul on April 29th 2019 Print All Permutations of String Problem Along with array, binary tree, and linked list data structures, the string is another popular topic on programming job interviews. I have never participated in a coding interview where no string-based questions were asked. This is very obvious because I have also never written a program where I have not used a single String variable. You will always find String as one of the most used data type or data structure in any program. In this article, I am going to share some of the most common String based coding problems I have come across from many Programming interviews I have been part of. I also have experience from both side of the table as a candidate as well as Interviewer so I know how important these questions are. Btw, there is no point solving these questions if you don’t have basic knowledge of data structure or you have not to refresh them in recent time. In that case, I suggest you to first go through a good data structure and algorithm course or book to revise the concept. This will save you a lot of time going back and forth between the book and your IDE for each question. If you need resources, I suggest following online courses to learn Data structure and Algorithms, even though they are independent of any programming language, I strongly suggest you join the course which explains problems in the programming language you are most comfortable with. Like Data Structures and Algorithms: Deep Dive Using Java for Java developers Algorithms and Data Structures in Python for those who love Python JavaScript Algorithms and Data Structures Masterclass by Colt Steele for JavaScript programmers Mastering Data Structures & Algorithms using C and C for those who are good at C/C How to solve String based Coding Problems A good thing about the string data structure is that if you know the array data structure, you can easily solve string-based problems because strings are nothing but a character array. So all the techniques you know by solving array-based coding questions can be used to solve string programming questions as well. Here is my list of some of the frequently asked string coding questions from programming job interviews: How do you reverse a given string in place? (solution) How do you print duplicate characters from a string? (solution) How do you check if two strings are anagrams of each other? (solution) How do you find all the permutations of a string? (solution) How can a given string be reversed using recursion? (solution) How do you check if a string contains only digits? (solution) How do you find duplicate characters in a given string? (solution) How do you count a number of vowels and consonants in a given string? (solution) How do you count the occurrence of a given character in a string? (solution) How do you print the first non-repeated character from a string?  » Read More

Like to keep reading?

This article first appeared on hackernoon.com. If you'd like to keep reading, follow the white rabbit.

View Full Article

Leave a Reply