1.Write a Program to find the frequency of a number in a two-dimesnsional array?
2.Write a Program to find the sum of diagonal elements using one variable?
3.Tell me about your project?
This Question is asked in each Technical Interview.Prepare these question self:-
A.Disadvantage of old System.
B.Advantage of new System.
C.Requirement Specification.
D.Process implemented in project
E.Tables Used(Database).
4.Other Questions:-
A:-Sudoku
B:-bugs in any Real world applications like Facebook/Whatsapp
C:-Second Highest salary (SQL Query)
D:-Merging of Two binary Search tree
E:-Manipulation of Strings(like remove kth character from a String)
All The Best Guys!
Keep Calm & NeverGiveUp
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
import java.util.Scanner;
class FindFrequency {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int value[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
};
int flag[] = new int[10];
System.out.println("Enter the value of n:");
int n = sc.nextInt();
int arr[][] = new int[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
arr[i][j] = sc.nextInt();
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
Inner: for (int k = 0; k < 10; k++) {
if (arr[i][j] == value[k]) {
flag[k]++;
break Inner;
}
}
}
}
for (int k = 0; k < 10; k++)
System.out.println("value of" + k + "is" + flag[k]);
}
}
2.Write a Program to find the sum of diagonal elements using one variable?
import java.util.Scanner;
class Sum {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int arr[][] = new int[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
arr[i][j] = sc.nextInt();
}
}
int sum = 0;
for (int i = 0; i < n; i++) {
sum = sum + arr[i][i];
}
System.out.println(sum);
}
}
3.Tell me about your project?
This Question is asked in each Technical Interview.Prepare these question self:-
A.Disadvantage of old System.
B.Advantage of new System.
C.Requirement Specification.
D.Process implemented in project
E.Tables Used(Database).
4.Other Questions:-
A:-Sudoku
B:-bugs in any Real world applications like Facebook/Whatsapp
C:-Second Highest salary (SQL Query)
D:-Merging of Two binary Search tree
E:-Manipulation of Strings(like remove kth character from a String)
All The Best Guys!
Keep Calm & NeverGiveUp
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
great insight
ReplyDelete