Strings & Text Processing MCQs

Topic-wise practice questions for Programming (C++ / Java / Python). Test your knowledge, check solutions on demand, and pace your preparation.

Zero-leak answer engine • Rate-limited explanations
Practice in Timed Mode
Q1easy
What is the result of the "Interning" process in string management?
Q2easy
Trace the output of this Python-style snippet:

text = "Graduate"
print(text[1:4])
Q3easy
Which of the following is true about a "Null" string versus an "Empty" string?
Q4easy
What is the output?

String val = "10";
val += 20;
print(val);
Q5medium
A developer is processing a CSV file. For each line, they need to extract the "Name" which is between the first and second comma. Which function combination is most logical?
Q6medium
A developer is checking if a user entered the correct password:

if (input_pass == "admin123") { ... }
Why is this logic flawed in languages like Java?
Q7medium
You need to validate if a string is a valid email address. Which tool is best for this pattern matching task?
Q8easy
What is the primary reason why Strings are designed to be Immutable in many high-level languages?
Q9hard
If an algorithm to reverse a string of length N uses a simple loop to swap characters, what is its Time Complexity?
Q10medium
Trace the value of s1 and s2 in this Java/C# snippet:

String s1 = "Hello";
String s2 = s1;
s1 = s1 + " World";
print(s2);