Cognizant Java Coding Interview Question Answers

preview_player
Показать описание
In this video, we solved Java Coding Interview Question which was asked in Cognizant Interview. The candidate had 2.3 Years of Experience working as a Java Developer, He solved the problem and got selected with CTC of 8 LPA.

#leetcode
#java
#interview
#javaprogramming
#javacoding
#javainterviewquestions
#CognizantInterviewQuestions

For Complete Java Interview Preparation Watch this Playlist:
Рекомендации по теме
Комментарии
Автор

Hi CloudTech, this question interview asked for experience
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20

how to like this print can you upload this video 20, 16, 12, 8, 4, 3, 2, 1, 5, 9, 13, 17, 18, 19, 15, 11, 7, 6, 10, 14

dineshchowdary-gvbm
Автор

Do they really ask such easy questions!? I am only in third month of learning DSA and I could solve this with easier approach without taking any variables.

lonestoryteller
Автор

Hi bro, can we consider the below program as one of the solutions to this problem stmt?

public class MyClass {
@SuppressWarnings("unused")
public static void main(String args[]) {
int x[] = { 9, 10, -18, 20, -27, 30, -36, 40, 45, 50 };
if(x != null)

else
System.out.println("The Array is Empty");
}

private static void x) {
int i = 0, j = x.length - 1;
for (; i < j;) {
if (x[i] < 0 && x[j] > 0) {
int t = x[i];
x[i++] = x[j];
x[j--] = t;
} else {
if (x[i] >= 0 && x[j] >= 0) {
(x[i] >= 0 && i < j)

(i < j) {
t = x[i];
= x[j];
= t;

} else if (x[i] < 0 && x[j] < 0) {
(x[j] < 0 && j > i)

(i < j) {
t = x[j];
= x[i];
= t;

} else {


}
}
}
int positiveNoCount = i == x.length-1 ? ++i : i;
int negativeNoCount = x.length - i;
Numbers in the Array: " + positiveNoCount);
Numbers in the Array: " + negativeNoCount);
System.out.println("Total Numbers of Elements in the Array: " + x.length);
Array Elements");
for (int index$1 = 0; index$1 < positiveNoCount; index$1++)
+ " ");
Array Elements");
for (int index$2 = positiveNoCount; index$2 < x.length; index$2++)
+ " ");
}
}

Output:
Positive Numbers in the Array: 7
Negative Numbers in the Array: 3
Total Numbers of Elements in the Array: 10

Positive Array Elements
9 10 50 20 45 30 40

Negative Array Elements
-36 -27 -18

jeckrazi
Автор

🥳🥳🥳🥳 finally same approach I too thought 😁😁😁

hemasundarkasturi
Автор

create list instead, push respectively, return length
- no extra space
- no extra variable
8 LPA for this ??? 🤣

Sayan_Shankhari