employer cover photo
employer logo
employer logo

Raja Software Labs

Is this your company?

Raja Software Labs Interview Question

2 basic code ...find smallest element

Interview Answer

Anonymous

Apr 7, 2026

class Main { public static void main(String[] args) { int[] arr = {5, 2, 9, 1, 7}; int smallest = arr[0]; for (int i = 1; i < arr.length; i++) { if (arr[i] < smallest) { smallest = arr[i]; } } System.out.println("Smallest element: " + smallest); } }