Can we use stream to solve second highest? List<Integer>numbers=Arrays.asList(10,5,20,15,25); int secondHighest=numbers.stream().sorted(Collectors.reverseOrder()).limit(2).skip(1).get()
They asked about services & he explained whole flow of microservice architecture then put 1-2 services name quitely & quickly . That was clever i think.
@@user-vf7cb5ni4tit is not easy but not too difficult if someone has a good understanding of concepts they will easily give the answer and confidence matters ... Here the interviewee had confidence even he gave one incorrect answer i.e. StringBuffer is not thread safe.... But in actual StringBuffer is synchronised and thread safe but StringBuilder not
Here is the simplest way public class StringQuestion { public static void main(String[] args) { String str="Capgemini Coding Interview Questions Capgemini Coding Interview Questions"; String upper=str.substring(str.length()/2,str.length()).toUpperCase(); String lower=str.substring(0,str.length()/2).toLowerCase(); System.out.println("The final output is "+lower +" " +upper); } }