5 Java String Coding Interview questions and answers part 2

preview_player
Показать описание
java coding interview questions strings,
common java coding interview questions,
java coding interview questions,
java coding interview questions and answers,
java small coding interview questions,
java string coding interview questions and answers,
java technical coding interview questions,
java string coding questions and answers,
java string coding questions for interview,
coding interview string questions,
java coding interview questions string,
string java coding interview questions,
string coding questions in java for interview,
java coding interview questions on strings,
common java coding questions,
oops coding interview questions in java,
java string coding problems,
java coding interview questions for qa,
r interview coding questions,
string java programs asked in interview,
is java coding hard,
java interview coding challenges,
java coding interview questions with solutions,
java string coding interview questions,
string java interview coding questions,
java string coding interview questions for 5 years experience,
java tricky coding interview questions,
java 7 coding interview questions,
java 8 interview coding question,
java 8 programming coding questions,
java 8 string interview questions,
java coding interview questions strings,
java technical coding interview questions,
java programs on strings for interview,
string java coding interview questions,
java coding interview questions,
java coding mock interview,
java string program interview questions and answers,
java string coding interview questions and answers,
interview coding questions in java,
java interview algorithm questions and answers,
java c c++ interview questions,
coding interview questions in java,
c++ interview coding questions,
coding interview for java,
java string coding interview questions,
java stream coding interview questions,
java live coding interview questions,
frequently asked java coding interview questions,
string java program interview questions,
string code interview questions in java,
javascript technical coding interview questions,
java coding interview preparation,
coding questions for interviews java,
interview coding questions javascript,
karat coding interview questions,
java tricky coding interview questions,
java algorithm interview questions,
java for technical interviews,
testing coding interview questions,
java interview questions and answers on strings,
sample coding interview questions,
most asked java coding interview questions,
top interview coding questions in java,
java interview coding challenge,
string questions in java for interview,
most asked coding questions in java,
java live coding interview,
string interview program questions in java,
interview asked programs in java
Рекомендации по теме
Комментарии
Автор

String reversal is not space efficient, everytime a new string object will be created whenever we append the result

rohitkasture
Автор

If original array contains same more than 2 remove elements....???? Sorry sir but this code not work properly in every scenario

ronakparjapati
Автор

boolean isPalindorme(String str ) {
for (int i = 0; i < str.length()/2; i++) {
if (str.charAt(i) != && i!=str.length()/2) {
return false;
}
}
return true;
}

sivasankarkuna
Автор

The value while debugging at 48s showed wrong because by mistake you had modified code and it was not saved after changing back

manasanayak
Автор

In palindrome check, you've used empty string, since strings are immutable it is inefficient code, we can use stringBuffer instead

shikhasoni
Автор

Finding Non repeted chars from string best approach:

public static void main(String[] args) {
String s = "aaabbbccdee";
char[] array = s.toCharArray();
for(int i = 0;i<s.length();i++) {
char temp = array[i];
int count = 1;

for(int j =i+1;j<s.length();j++) {
if(array[i]==array[j]) {


}
}
if(count==1) {

break;
}

}

}

amolpatil
Автор

Sir i am not getting the output for non repeated charecter in string program could you send the code for me

rachamallidorasrivignesh
Автор

public class Program
{
static void Main(string[] args)
{
string str = "aabbdef";
var result = from obj in str
group obj by obj.ToString()
into egroup
select new
{
uniqueChar = egroup,
count = egroup.Count()
};
foreach(var res in result)
{
if(res.count == 1)
{
= "+res.uniqueChar.Key + " " + "count = "+ res.count );
break;
}
}
}
}

sainath
Автор

In first program sandeep output gives sandep how the 'e' removed

PrashanthArjun
Автор

// abcdaebc // Non repeated first character
char nonReapeatedFirstChar(char[] str, int index) {
char c = str[index];
int count = 0;
for (int i=0;i<str.length;i++) {
if (c==str[i]) {
count++;
if (count>1) {

nonReapeatedFirstChar(str, index);

}
}
}
return c;
}

sivasankarkuna
Автор

removeDuplicateString

void removeDuplicateString(String s) {
String duplicateRemoved="";
for (int i = 0; i <s.length() ; i++) {
if

}
}

}

xbpfrym
Автор

JAVA 11
static String eliminerDoublons(String mot) {

String motsTraite = mot.chars()
.mapToObj(c -> String.valueOf((char) c))
.distinct()


return motsTraite;
}

sohaibelbokhari