0% found this document useful (0 votes)
14 views2 pages

Java MCQs and Coding Challenges Guide

The document outlines various coding and theoretical questions related to Java, including multiple-choice questions on class and object properties, coding tasks for checking balanced parentheses and lonely prime numbers, and creating a HashSet for employee objects. It also discusses the implementation of functions for factorial calculation and string occurrence, as well as multi-threading questions. Additionally, it references resources for algorithm and data structure interview questions, and includes a sample Java code for identifying repeated characters in a string.

Uploaded by

devendar pila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Java MCQs and Coding Challenges Guide

The document outlines various coding and theoretical questions related to Java, including multiple-choice questions on class and object properties, coding tasks for checking balanced parentheses and lonely prime numbers, and creating a HashSet for employee objects. It also discusses the implementation of functions for factorial calculation and string occurrence, as well as multi-threading questions. Additionally, it references resources for algorithm and data structure interview questions, and includes a sample Java code for identifying repeated characters in a string.

Uploaded by

devendar pila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

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] && ![Link](ar[i])) {
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);
}
}
}
}

You might also like