In this page you get Important Core Java interview questions for Vyomlabs Interview Preparation. Tutorial Diary provides you plenty of Core Java interview questions. All scholars, freshers can down load Core Java quiz questions with solutions as PDF files and eBooks very soon.

Here is the list of java interview questions important for vyomlabs interview preparation, these questions are more commonly requested by way of the recruiters.Java questions can also be asked from any core java subject .


On this website we speak about all the main interview questions which is very important for those students preparing for the placements in Vyomlabs.

Java-questions is collection of core java interview questions masking quite a lot of areas akin to Collections, OOPs, Multithreading etc.


Explain OOPS with example.

Explain why there is need of collection in java?

How can you describe different ways to declare and use objects in java?

Are you familiar with rest API ?

difference between API and jar?

Why create objects?


·         What is Polymorphism?

What is pointer in java ?  

Explain Multithreading with the help of example.

Explain Exception Handling in Java.

Write a program that will find the GCD of two numbers.

What is GCD?

GCD is the acronym for Greatest Common Divisor. It is also called as HCF which is the acronym for Highest Common Factor. GCD of any two numbers is the largest number that divides both of the numbers
To find GCD we find any largest number which can divide both the given number.

Examples:

For example: To find GCD/ HCF of 20 and 30.
Both number 20 and 30 are divisible by 1, 2,5,10.
The GCD is 10.

Solution: C

//A program to find the GCD of two numbers
//Important question for Vyom Labs Interview Preparation

#include <stdio.h>
 
long findGcd(long, long);
 
int main() {
  long x, y, gcd;
 
  printf("Enter two integers\n");
  scanf("%ld%ld", &x, &y);
 
  gcd = findGcd(x, y);
 
  printf("Greatest common divisor of %ld and %ld = %ld\n", x, y, gcd);
  
  return 0;
}
 
long findGcd(long a1, long a2) {
  if (a2 == 0) {
    return a;
  }
  else {
    return findGcd(a2, a1 % a2);
  } 
} 

How can we write a program which will print all possible sub strings of  the given string

Example:

Input: abcdefgab

Output:
a
b
c
d
e
f
g
a
b
ab
bc
cd
de
ef
fg
ga
ab
abc
bcd
cde
def
efg
fga
gab
abcd
bcde
cdef
defg
efga
fgab
abcde
bcdef
cdefg
defga
efgab
abcdef
bcdefg
cdefga
defgab
abcdefg
bcdefga
cdefgab
abcdefga
bcdefgab
abcdefgab

Solution: C 

#include <stdio.h>

void printstr(char arr[], int start, int end)
{
    int i;
    for(i=start;i<=end;i++)
    {
        printf("%c",arr[i]);
    }
    printf("\n");
}


void substrings(char arr[], int n)
{
    int loop,j,start,end;
    int no_of_strings = n-1;

    for(loop=0;loop<n;loop++)
    {
        start = 0;
        end = start+loop;
        for(j=no_of_strings;j>=0;j--)
        {
            printstr(arr,start, end);
            start++;
            end = start+loop;
        }
        no_of_strings--;
    }

}

int main()
{   
    char str[] = "abcdefgab";
    substrings(str,9);
    return 0;
}



What is prime Number?
A prime number is a positive integer which is divisible only by 1 and itself only.

Examples of Prime Numbers:

 2, 3, 5, 7, 11, 13 etc.

The following program tells you how to check whether the number is prime or not?

Solution :C


// A C program to check whether the number is prime or not
// Important question to prepare for Vyomlabs Interview Preparation
#include <stdio.h>
void prime(int n);
int main()
{
    int n;

    printf("Enter a positive integer: ");
    scanf("%d",&n);

    prime(n);
    return 0;
}

void prime (int n) {
int i, flag = 0;

for(i=2; i<=n/2; ++i)
    {
        // condition for nonprime number
        if(n%i==0)
        {
            flag=1;
            break;
        }
    }

    if (flag==0)
        printf("%d is a prime number.",n);
    else
        printf("%d is not a prime number.",n);
   
}

Question: Write a program to find Fibonacci Series

Fibonacci Series: Numbers in a Fibonacci sequence is termed as Fibonacci numbers. Leave first two terms in sequence and after them every other term is the sum of the two previous ones.

Example: 0 1 1 2 3 5 8 etc

Testcase:
Input: 5
Output: 0 1 1 2 3

Solution: C Program: 

// A C program to print the Fibonacci Series
// Coding Question important for Vyom Labs Interview Prepaartion

#include<stdio.h>

int Fibonacci(int);

main()
{
   int n, i = 0, c;

   scanf("%d",&n);

   printf("Fibonacci series\n");

   for ( c = 1 ; c <= n ; c++ )
   {
      printf("%d\n", Fibonacci(i));
      i++;
   }

   return 0;
}

int Fibonacci(int n)
{
   if ( n == 0 )
      return 0;
   else if ( n == 1 )
      return 1;
   else
      return ( Fibonacci(n-1) + Fibonacci(n-2) );

Vyom Labs is the chief in IT carrier administration and Automation. Vyom Labs specializes in IT Infrastructure and Cloud administration powered via Automation. Vyom Labs is also into training & BMC trade carrier management.

Vyom Labs is as an organization which is combination of:

• quality of breed IT management and Automation solutions
• fine of breed IT Infrastructure and Cloud management offerings powered by Automation
• proper dimension solutions and offerings for large, Medium and Small businesses

Vyom Labs has delivered ITSM BSM offerings in 5 continents in the IT provider administration house.

Official Website: www.vyomlabs.com

Latest Awards:

  • Vyom Labs has received the celebrated award for “The first-class associate of the year for Asia Pacific region” within BMC Ecosystem.
  • BMC recognised Vyom Labs abilities & certifications, income and offerings capabilities and more than a few initiatives taken through Vyom Labs in BMC world like establishing MarketZone, Product- AutomationEdge.

Question: Write a program to find the frequency of Characters in a given String

Example: If the given String is: Vyom Labs Interview Preparation and we need to find the frequency of a in the string then the frequency of a will be 3.

Test case:
Input1: Tutorial Diary
Input 2: a
Output: The number of a in the Tutorial Diary string is 2


Solution: C program
// A c program based on string
//Important for Vyom labs Coding question for Vyom labs Interview Preparation
// A C program to find the Frequency of Characters
#include <stdio.h>

int main(void) {
char ch1[100], ch2;
int i, count=0;

printf("Enter your string \n");
gets(ch1);
printf("Enter the character which you want frequency of: \n");
scanf("%c", &ch2);

for(i=0;ch1[i]!='\0';++i) {
if(ch1[i]==ch2)
++count;
}

printf("The number of %c in the %s string is %d", ch2, ch1, count );

return 0;
}


HR Interview

Technical Interview

Important Tips