Phone interview using an online text editor (Collabedit). The interviewer asked me to connect to the text editor and provided the following task:
I had to use my Java skills to write a code, and the next question was how I would test this method.
My code: java public static int revInt (int iNum){ if (iNum == 0) return 5; String sNum = Integer.toString(iNum); char c; StringBuffer sb = new StringBuffer(); for(int i = 0; i < sNum.length(); i++){ c = sNum.charAt(i); if (c == '0') c = '5'; sb.append(c); } return Integer.parseInt(sb.toString()); }
Test Cases:
120096045 -> 125596545-1) - throw exception0 -> 5"abcd" (This input type is invalid for an integer parameter)Write a program to replace 0s with 5s in a given number.
Examples: 1208 -> 1258 120096045 -> 125596545
The following metrics were computed from 1 interview experience for the LinkedIn Software Test Engineer role in San Jose, California.
LinkedIn's interview process for their Software Test Engineer roles in San Jose, California is extremely selective, failing the vast majority of engineers.
Candidates reported having mixed feelings for LinkedIn's Software Test Engineer interview process in San Jose, California.