Question d’entretien chez Visa Inc.

Round 4 F2F: Problem Solving 1. Let's talk about Exceptions. What are exceptions and which exceptions you've actively used so far? 2. An ArrayIndexOutOfBound Exception has happened. How would you solve it? 3. If you're not allowed to touch the '<=' operator for ArrayIndexOutOfBound, what will you do to solve it? 4. What are checked and unchecked exceptions? 5. Given an array arr[] = {6, 0, -4, 4, 8}. Irrespective of the signs for the given integers. Find the count of unique values. The array may grow further. Ans: public static void main(String[] args) { int arr[] = {-6, 0, -4, 4, 8}; int len = arr.length; Set<Integer> mySet = new HashSet<Integer>(); for(int i=0; i<len; i++) { mySet.add(Math.abs(arr[i])); } System.out.println(mySet.size()); } 6. Why Visa?