0% found this document useful (0 votes)
15 views3 pages

Java Coding Questions for 2022 Batch

The document outlines Java coding questions categorized by difficulty level for the 2022 batch applicants of Infosys, Wipro, TCS, Accenture, and Capgemini. It includes easy, medium, and advanced questions, as well as pattern questions specific to certain companies. Additionally, it provides tips on focus areas for each company during interviews.

Uploaded by

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

Java Coding Questions for 2022 Batch

The document outlines Java coding questions categorized by difficulty level for the 2022 batch applicants of Infosys, Wipro, TCS, Accenture, and Capgemini. It includes easy, medium, and advanced questions, as well as pattern questions specific to certain companies. Additionally, it provides tips on focus areas for each company during interviews.

Uploaded by

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

Java Coding Questions for Infosys, Wipro, TCS, Accenture, Capgemini (2022 Batch)

Easy-Level Java Coding Questions

1. Reverse a String:

public static String reverseString(String input) {

return new StringBuilder(input).reverse().toString();

2. Check if a Number is Prime:

public static boolean isPrime(int n) {

if (n <= 1) return false;

for (int i = 2; i <= [Link](n); i++) {

if (n % i == 0) return false;

return true;

3. Fibonacci Series (Iterative & Recursive)

4. Palindrome Number or String

5. Factorial of a Number (Recursive & Loop)

Medium-Level Java Coding Questions

1. Find Duplicate Elements in an Array

2. Sort an Array Without Using Built-in Functions (Bubble/Selection/Insertion)

3. Find the Second Largest Number in an Array

4. Count Vowels and Consonants in a String


Java Coding Questions for Infosys, Wipro, TCS, Accenture, Capgemini (2022 Batch)

5. Check if Two Strings are Anagrams:

public static boolean areAnagrams(String s1, String s2) {

char[] arr1 = [Link]();

char[] arr2 = [Link]();

[Link](arr1);

[Link](arr2);

return [Link](arr1, arr2);

Advanced or Logical Questions

1. Find Missing Number in an Array of 1 to N

2. Find First Non-Repeating Character in a String

3. Find the Leader Elements in an Array

4. Rotate an Array Left/Right by K Elements

5. Implement a Basic Banking System (OOP Concept Test)

Pattern Questions (Infosys, TCS-specific)

- Pyramid patterns

- Right-angle triangle patterns

- Diamond/star patterns

Example:

for(int i=1; i<=5; i++) {

for(int j=1; j<=i; j++) {


Java Coding Questions for Infosys, Wipro, TCS, Accenture, Capgemini (2022 Batch)

[Link]("* ");

[Link]();

Tips by Company

- Infosys: Focus more on logic, patterns, and time complexity.

- Wipro & TCS: Pattern-based, array and string questions.

- Accenture & Capgemini: Expect a mix of logical reasoning + Java basics + OOPs.

- TCS NQT: Questions from arrays, strings, and pseudo code.

You might also like