Interview Questions and Answers for 'Zoho' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Zoho' - 4 question(s) found - Order By Rating

 Q1. Write a Program to check number of occurrences of one string within another ? Core Java
Ans. public class Class{
   public static void main(String[] args){
      String string1 = "Hello I am Jack. I live in United States. I live in california state.";

      String string2 = "I live in";

      int startIndex = 0;
      int endIndex = string1.length()-1;

      int countNoOfOccurences = 0;

      String remainingString = string1;

      while(startIndex < endIndex){
         if(remainingString.indexOf(string2) != -1){
            countNoOfOccurences++;
            startIndex = remainingString.indexOf(string2) + string2.length();
            remainingString = remainingString.substring(startIndex);
         } else {
            break;
         }
      }

      System.out.println(countNoOfOccurences);
   }
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     string  code  coding     Asked in 2 Companies


  Q2. Write a Program to check if 2 strings are Anagrams ?Core Java
Ans. public void checkIfAnagram(String str1,String str2){
boolean anagram = true;
for(char c:str1.toCharArray()){
if(!str2.contains(String.valueOf(c))){
System.out.println("Strings are Anagrams");
anagram = false;
}

if(anagram == true){
System.out.println("Strings are not Anagrams");
}
}
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve      check if 2 strings are Anagrams     Asked in 30 Companies      basic        frequent


  Q3. Difference between Vector and ArrayList ?Core Java
Ans. Vectors are synchronized whereas Array lists are not.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   basic interview question   vector   arraylist   collections   synchronization   vector vs arraylist     Asked in 35 Companies      basic        frequent


Frequently asked in face to face interviews.
  Q4. Write a program to print fibonacci series.Core Java
Ans. int count = 15;
int[] fibonacci = new int[count];
fibonacci[0] = 0;
fibonacci[1] = 1;
for(int x=2; x < count; x++){
fibonacci[x] = fibonacci[x-1] + fibonacci[x-2];
}

for(int x=0; x< count; x++){
System.out.print(fibonacci[x] + " ");
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     ebay   fibonacci series     Asked in 66 Companies      basic        frequent



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: