Tip 1 : Focus on your communication skills.
Tip 2 : Command on any coding language.
Tip 1: Have some projects on resume.
Tip 2: Mention your certifications.
It was a MCQ round with questions of aptitude, English vocabulary and coding MCQs.
Which of these can not be used for a variable name in Java?
a) identifier
b) keyword
c) identifier & keyword
d) none of the mentioned
Ans :- b) Keyword
Which of the following is not an OOPS concept in Java?
a) Polymorphism
b) Inheritance
c) Compilation
d) Encapsulation
Ans:- c) Compilation
Which environment variable is used to set java path?
a) JAVA
b) JAVA_HOME
c) CLASSPATH
d) MAVEN_HOME
Ans:- b) JAVA_HOME is used to store a path to the java installation
Which exception is thrown when java is out of memory?
a) MemoryFullException
b) MemoryOutOfBoundsException
c) OutOfMemoryError
d) MemoryError
Ans:- c) OutOfMemoryError
Which of these are selection statements in Java?
a) break
b) continue
c) for()
d) if()
Ans:- d) if()
Find the sum two numbers, whose product is 200 and difference is minimum.
a) 30
b) 27
c) 35
d) 33
Ans:- a) 30
What is the output of the following code snippet?
int x = 5;
int y = 10;
System.out.println(x + y + "Hello");
a) 15Hello
b) Hello15
c) 510Hello
d) 5Hello10
In Java, when the + operator is used with a combination of numbers and strings, it performs addition for numbers and concatenation for strings. The expression x + y evaluates to 15, and then "Hello" is concatenated to it. Therefore, the final output is a) 15Hello.
What is the output of the following code snippet?
public class Main{
public static void main(String []args){
String str1 = "Hello";
String str2 = new String("Hello");
System.out.println(str1 == str2);
}
}
The == operator compares the object references. In this case, str1 and str2 refer to different objects, even though they contain the same string value. Therefore, the output is false.
What is the output of the following code snippet?
int[] arr = {1, 2, 3, 4, 5};
System.out.println(arr.length);
a) 1
b) 2
c) 3
d) 5
The length property of an array in Java returns the number of elements in the array. In this case, the array arr has 5 elements, so the output is d) 5.
What is the output of the following Java program?
public class Main{
public static void main(String []args){
for (int i = 0; i < 5; i++) {
System.out.print(i + " ");
if (i == 2)
break;
}
}
}
The for loop iterates from 0 to 4. When i becomes 2, the if condition i == 2 is true, and the break statement is executed, terminating the loop. Therefore, the output is "0 1 2".
This round was a technical interview where the interviewer asked questions about java, sql and about projects.
Write a program to sort array without the use of a sort function
We can solve it using sorting algorithms like bubble sort, selection sort, insertion sort, merge sort and quick sort.
Write a program to print prime numbers from 1 to 50.
First, take the number 50 as input.
Then use a for loop to iterate the numbers from 1 to 50
Then check for each number to be a prime number. If it is a prime number, print it.
Write a program to reverse string without loop or predefined function(like reverse).
Like: var name =”shirsh”
after reverse: var name =”hsrihs”
Use XOR for swapping the variable
Asked about database and sql commands.
What’s the difference between CHAR and VARCHAR?
How do you insert data into a MySQL table?
How do you update data in MySQL?
This was an HR interview where the interviewer tested my communication skills.
What are your strengths and weaknesses?
Location preference?
Favourite subject and why?
Why this company?
Tip 1: Be confident.
Tip 2: Focus on your communication skills.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which array operation has O(n) worst-case time complexity?