Top Theoretical Interview Questions

S.no Question Answer
1 What are different ways to create String Object? View
2 Can we compare String using the == operator? What is the risk? View
3 How to replace a substring with ( from a string ? View
4 What is the difference between String and StringBuffer in java? View
5 How do I convert a string version of a number in an arbitrary base to an integer? View
6 How do you compare two Strings in Java? View
7 What is String in Data Structures?   View
8 What is the difference between Strings vs. Char arrays?   View
9 What is a null-terminated String?   View
10  Reverse a String using Stack View
11 Difference between String, StringBuffer and StringBuilder? View
12 Why String is immutable or final in Java View
13 What Is the String Constant Pool? View
14 Remove Invalid Parentheses View
15 What is the use of the substring() method? View
16 Explain how can I remove the trailing spaces from a String View
17 Explain how can I pad a string to known length View
18 Explain how can you tell whether two string are the same View
19 How to check if the String is empty? View
20 Can we use a string in the switch case in java? View
21 How string concatenation using the + operator works in Java? View
22 What are the different string methods in Java? View
23 What do you mean by StringJoiner? View
24 How to convert string representation of list to a list? View
26 How do I tokenize a string in C++? View
27 Print all permutations of the String ? View
28 How do you reverse a given string in place?  View
29 How to convert a byte array to String? View
30 How to calculate total number of vowels in String? View
31 Write a program to convert a string in lowercase View
32 Write a program to convert a string in uppercase. View
33 Write a C++ program to find the length of the string. View
34 In what way should two whether they are anagrams?strings be compared to determine  View
35 Write a java program to tOGGLE each word in string? View
36 How to convert String to Date in java? View
37 Java Program to reverse a given String with preserving the position of space View
38 Multiply Large Numbers represented as Strings View
39 String “indexOf” Method View

Introduction to Strings – Data Structure and Algorithm Tutorials

Similar Reads

What is String?

Strings are considered a data type in general and are typically represented as arrays of bytes (or words) that store a sequence of characters. Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’...

How String is represented in Memory?

In C, a string can be referred to either using a character pointer or as a character array. When strings are declared as character arrays, they are stored like other types of arrays in C. For example, if str[] is an auto variable then the string is stored in the stack segment, if it’s a global or static variable then stored in the data segment, etc....

How to Declare Strings in various languages?

Below is the representation of strings in various languages:...

General Operations performed on String:

...

1. Concatenation of Strings

...

2. Find in String

...

3. Replace in String

...

4. Finding the Length of String

...

5. Trim a String

...

6. Reverse and Rotation of a String

...

7. Subsequence of a String

Here we are providing you with some must-know concepts of string:...

8. Substring of a String

The process of combining more than one string together is known as Concatenation. String Concatenation is the technique of combining two strings....

9. Binary String

A very basic operation performed on Strings is to find something in the given whole string. Now, this can be to find a given character in a string, or to find a complete string in another string....

10. Palindrome String

Many times, it is very important to make corrections in strings. Replacing a character, word or phrase in a String is another very common operation performed on Strings....

11. Lexicographic Patterns

One of the most general operations on String is to find the length/size of a given string. Length is defined as the number of characters in a string is called the length of that string....

12. Pattern Searching

Spaces or special characters are very common in Strings. So it is important to know how to trim such characters in String....

Top Theoretical Interview Questions

Reverse operation is interchanging the position of characters of a string such that the first becomes the last, the second becomes the second last, and so on....

Top 50 interview coding question

A subsequence is a sequence that can be derived from another sequence by removing zero or more elements, without changing the order of the remaining elements....

Advantages of using String:

A substring is a contiguous part of a string, i.e., a string inside another string....

Disadvantages of String:

A Binary String is a special kind of string made up of only two types of characters, such as 0 and 1.For Example:...

Application of String:

A string is said to be a palindrome if the reverse of the string is the same as the string. For example,...

Frequently asked questions (FAQs) on String

Lexicographical pattern is the pattern based on the ASCII value or can be said in dictionary order. We consider the lexicographic order of characters as their order of ASCII value. Hence the lexicographical order of characters will be...

Conclusion

Pattern searching is searching a given pattern in the string. It is an advanced topic of string. The Pattern Searching algorithms are sometimes also referred to as String Searching Algorithms and are considered as a part of the String algorithms. These algorithms are useful in the case of searching a string within another string....

Contact Us