All Questions
44 questions
4
votes
6
answers
1k
views
Reverse string with identical spaces as in original String using Java
This is interview question
Reverse string with identical spaces as in original String using Java
For example
Original String :
best in the world and is greatest and is making sure the world goes
well
...
7
votes
4
answers
3k
views
How can I efficiently manipulate digits in a string without using RegEx in Java?
I am reading a book with different quizzes about coding interviews.
Please implement a function that increments a string based on the rules below:
It should take the string of unknown length and ...
4
votes
3
answers
720
views
Checking if a string contains all unique characters
I am currently reviewing CTCI(Cracking the Coding Interview)
The question is asking me to implement an algorithm which checks whether the characters in a string are all unique however they do not want ...
6
votes
3
answers
384
views
Leetcode - First Unique Character in a String
Given a string, find the first non-repeating character in it and
return its index. If it doesn't exist, return -1.
Examples:
...
2
votes
1
answer
263
views
Simple pattern matching between two string inputs using Java (Google interview challenge)
The interview question is:
Write a function isMatch (without using java.util.Regex) that takes two strings as arguments:
...
3
votes
1
answer
252
views
Map Character to Characters Most Frequently Found With it (in list of strings)
For an interview, I was tasked with writing a program that consumes a list of strings, and produces a mapping between every character in the list, and the characters found most frequently with it (let'...
1
vote
2
answers
496
views
Balanced parenthesis, with backslash escaping
Given a Balanced Parenthesis problem.
"Balanced Parenthesis
Create a program that checks if in a given string expression all the parenthesis are balanced.
For Example:
(test) - valid
...
1
vote
2
answers
5k
views
Check if a string is a valid english word, and convert to a valid english word
This is an interview question.
For the purpose of the question, a valid English word is a string that begins with an uppercase English letter, and the rest of the string contains only lowercase ...
0
votes
1
answer
909
views
Reversing the vowels in a String
Given a string, reverse only the vowels present in it and print the
resulting string.
Input:
First line of the input file contains an integer T denoting the
number of test ...
2
votes
1
answer
184
views
Anagram checking implementation
Given two strings, check whether two given strings are anagram of each
other or not. An anagram of a string is another string that contains
same characters, only the order of characters can be ...
2
votes
2
answers
353
views
Naive string compression
Description:
Implement a method to perform basic compression using counts of repeated characters. If the compressed string is not smaller then return the original string.
Code:
...
3
votes
1
answer
689
views
Check if two strings are permutations of each other
Description:
Given two strings check if those two are permutation of each other. Its expected that input string can contain ASCII characters.
Code:
...
3
votes
2
answers
3k
views
Check if the given string has duplicates
Description:
Given a string find if it contains duplicate characters. The string contains only ASCII characters.
Code:
...
1
vote
4
answers
2k
views
Reversing the words order of a string
A couple of weeks I had a coding interview and the problem to solve was very simple: reverse the words order of a string. What did I do wrong here?
...
1
vote
2
answers
4k
views
Finding occurrence of a given character in a String?
I came up with this simple solution:
...