0% found this document useful (0 votes)
19 views

Java Array Questions

The document lists common Java array interview questions along with example inputs and outputs. Key topics include combining arrays, finding minimum and maximum values, identifying pairs with a target sum, and handling duplicates. Additional questions cover finding the Kth largest element, the second largest element, and shifting values to the end of the array.

Uploaded by

rakeshlr1996
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)
19 views

Java Array Questions

The document lists common Java array interview questions along with example inputs and outputs. Key topics include combining arrays, finding minimum and maximum values, identifying pairs with a target sum, and handling duplicates. Additional questions cover finding the Kth largest element, the second largest element, and shifting values to the end of the array.

Uploaded by

rakeshlr1996
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
You are on page 1/ 4

Java Array Interview Questions (Most Asked)

1. Combine Two Array


🔸 Input: {1, 2, 3}, {4, 5, 6}
🔸 Output: [1, 2, 3, 4, 5, 6]

2. Find Min and Max in Array


🔸 Input: {3, 6, 9, 5, 20, 43}
🔸 Output: Min: 3, Max: 43
3. Find Pair with Target Sum
🔸 Input: {1, 2, 3, 4, 5}, Target = 5
🔸 Output: 3+2, 4+1

4. Frequency of Each Element


🔸 Input: {1, 2, 2, 3, 1, 4, 5, 1}
🔸 Output: 1 → 3 times, etc
5. Kth Largest Element
🔸 Input: {2, 5, 7, 8, 9, 6}, K = 3
🔸 Output: 7

6. Remove Duplicates
🔸 Input: {4, 2, 3, 2, 4, 1, 5, 3, 5}
🔸 Output: 1 2 3 4 5
7. Find Second Largest Element
🔸 Input: {4, 19, 3, 4, 16}
🔸 Output: 16

8. Shift a Value to End


🔸 Input: {1, 4, 5, 4, 3, 0, 3, 2, 0, 1}, Value = 1
🔸 Output: [4, 5, 4, 3, 0, 3, 2, 0, 1, 1]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy