## FINATEL FRESHER INTERVIEW QUESTIONS WITH ANSWERS

### This blog explains about FINATEL FRESHER INTERVIEW QUESTIONS WITH ANSWERS and is given below :

_______________________________________________________________________________

1. ### Write a method to convert single dimension array to 2 Dimension array in java programming .

package com.javajee.Utils;

public class CopyArray {

int[] arr1={1,2,3,4,5,6,7,8,9,10,11,12};
int rowSize=3;
int columnSize=4;
int[][] arr2=new int[rowSize][columnSize];

public static void main(String[] args) {
CopyArray CA=new CopyArray();
CA.copyElems(CA.arr1);
CA.printElem(CA.arr2);

}

public void copyElems(int[] A){
int k=0;
for(int i=0;i<rowSize;i++){
for(int j=0;j<columnSize;j++){
arr2[i][j]=A[k];
k++;
}
}

}

public void printElem(int[][] B){
for(int i=0;i<rowSize;i++){
for(int j=0;j<columnSize;j++){
System.out.print(B[i][j]+” “);
}
System.out.println();
}
}

}
_______________________________________________________________________________

### Pattern 1:

package com.javainterviewpoint;

import java.util.Scanner;

public class Pattern1

{

public static void main(String[] args)

{

// Create a new Scanner object

Scanner scanner = new Scanner(System.in);

// Get the number of rows from the user

System.out.println(“Enter the number of rows to print the pattern “);

int rows = scanner.nextInt();

System.out.println(“** Printing the pattern… **”);

for (int i = 1; i <= rows; i++)

{

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

{

System.out.print(j + ” “);

}

System.out.println();

}

}

### Output

Enter the number of rows to print the pattern

5

** Printing the pattern… **

1

1 2

1 2 3

1 2 3 4

### Pattern 2:

package com.javainterviewpoint;

import java.util.Scanner;

public class Pattern2

{

public static void main(String[] args)

{

// Create a new Scanner object

Scanner scanner = new Scanner(System.in);

// Get the number of rows from the user

System.out.println(“Enter the number of rows to print the pattern “);

int rows = scanner.nextInt();

System.out.println(“** Printing the pattern… **”);

for (int i = 1; i <= rows; i++)

{

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

{

System.out.print(i + ” “);

}

System.out.println();

}

}

### Output

Enter the number of rows to print the pattern

5

** Printing the pattern… **

1

2 2

3 3 3

4 4 4 4

5 5 5 5 5

_______________________________________________________________________________

### 3 . Write a method to find the count of even digits and sum

// Java program to find n-th

// Good number.

class GFG

{

// Function to find kth good number.

static int findKthGoodNo(int n)

{

// Find the last digit of n.

int lastDig = n % 10;

// If last digit is between

// 0 to 4 then return 2*n.

if (lastDig >= 0 && lastDig <= 4)

return n << 1;

// If last digit is between

// 5 to 9 then return 2*n + 1.

else

return (n << 1) + 1;

}

// Driver code

public static void main(String[] args)

{

int n = 10;

System.out.println(findKthGoodNo(n));

}

### Output:

20

Time Complexity: O(1)
Auxiliary Space: O(1)

### REFERENCES :

https://javajee.com/content/copy-an-array-from-1d-to-2d

https://www.javainterviewpoint.com/number-pattern-programs-in-java/

https://www.geeksforgeeks.org/number-even-sum-digits/

http://www.anyforum.in/question/corejava/programming/WAP-to-calculate-sum-of-even-digits-present-in-an-Integer/603