Posts

Showing posts from March, 2021

HackerRank Question

 import java.util.*; import java.util.Scanner; // Write your code here. DO NOT use an access modifier in your class declaration. class Solution { public static void main(String[] args) { // Parser parser = new Parser();          Scanner in = new Scanner(System.in); while (in.hasNext()) { System.out.println(isBalanced(in.next())); }          in.close();          // if(args.length!=0){     //   if(isBalanced(args[0])){     //     System.out.println(args[0]);     //     System.out.println(true);     //   }     //   else {     //     System.out.println(false);     //   }     // } }      public static boolean isBalanced(String in){     Stack<Character> stackVal = new Stack<>();   ...

Morgan Stanley

1. Sprint Bean scopes (Default/ Nested bean of different scope) 2. Dependency Injection/IOC => Knows the bookish definition but can’t explain who will create the object  or how it works? 3. Web Server/Application 4. Hibernate (One to Many /Many to Many relationship) How it will be stored in DB side 5. Array List/Linked List (How Array List works internally/ Array List Implementation) 6. HashMap (hashcode/equals)  7.  What is volatile and use case.? 8. Complexity of array List, Linked list and stack.? 9. Merge sort 10. Pythagorean triples 11. How to calculate height of tree.? 12. Array List Sorting based on given criteria.?