5 MCQs related to different class and object properties of Java.
3 coding questions
a) Check for balance parentheses in an expression
b) Check for lonely prime number in an array
c) Create a HashSet and add employee objects like name and id to it and print the
HashSet.
Also throw exception for bad inputs and generate a unique hash for all the employee
ids before storing it.
Write the Factorial of Numbers?
write a function which gets 2 strings and returns the first occurrence of the
string in the other one.
2. implement a class which implemets setAll in a hashmap in Java in o(1)
complexity.
3. asked me many multi thread questions about the product
) database
2)datastructures
3)java collections
4)generic java programs
5) basic DS programs
interface vs abstract class
-------------------cisco ------
carreer path
tech stack last five projects
what you have done what challenges and how to fix
[Link]
[Link]
set-1/
[Link]
public class HelloWorld {
public static void main(String[] args) {
[Link]("Hello, World!");
String str = "AA aa BB bb CC cc DD d";
char[] ar = [Link]();
String[] temp = new String[[Link]];
int tempIndex = 0; // To keep track of the index in the temp array
for (int i = 0; i < [Link]; i++) {
for (int j = i + 1; j < [Link]; j++) {
if (ar[i] == ar[j] && ) {
temp[tempIndex] = [Link](ar[i]);
tempIndex++;
break; // Break out of the inner loop once a repeated
character is found
}
}
}
for (String st : temp) {
if (st != null) {
[Link](st);
}
}
}
}