Priceline | 2 rounds | India | April 2021 | Rejected

Round 1:

  1. What is saga. which are Two types of saga.

  2. What is API gateway: What technology u r using for API gateway. Any specific framework
    - Istio
    - Zuul. What is zuul filter and details

  3. How will you expore your APi end point to outer world ?For exposing your API to external world. We have 2:
    - Consul
    - swagger

  4. What is Load balancers. Can you implement the same in java ? How are you doing load balacing in your application
    Ans: Inside config
    - web-app: microservice
    Dev:
    Stage: < url>
    prod:

  5. What new feature java8 has added to hashmap. I said tree. he asked about what would be worst case complexity and normal complexity

  6. Java8 new features overall

  7. Collection.sort which sort they using internally. what design patterns they use to select which sort to apply.

  8. Java 8 feature: function interface explain

  9. what is Circuit breaker. Have you heard of it ?

Program:  You have Arr<> of size M having -10million to +10 milliion data.
Find Smallest positive int > 0 which is not present in array

Input:
[1,3,6,4,1,2]
Output: 5

[1,2,3]
Output: 4

Time: o(n) -worst case
Space: o(n) - worst case

< My Solution>: Map<arr[i], count>:
mp.put(1, 2);
mp.put(3, 1);
mp.put(6, 1);
mp.put(4, 1);
mp.put(2,1);

if(are!=null || arr.size() == 0) {
	return; //expected
}

for(long I=1; I<LONG.MAX_VALUE; I++) {
	if(!mp.get(I)) {
		return I;
	}
}

- Ques:
int[] = { 1,2,3,4,5}

11)Here how elements are stored in arrayList. Which format.
Answer: In continguous memory location like Ox01, ox02, ox03, ox04, ox05

  1. What is Survivor perm, perm gen, meta data
  2. Difference between permgen space and meta data
  3. What is Circular dependency in spring. How to resolve them (Using setter DI). Why do u use setter DI.
    -Partial DI
    - Setter DI
  4. What is Thread pool and why to use them. Types of thread pool
  5. What is executor service.
  6. what is Cached thread pool , fixed thread pool , fork/join thread pool
  7. What is volatile and atomic. Volatile creates lot if headache for reading and writing to main memory. What is the solution to this? Ans: Atomic
  8. what is Spring milestone
  9. producer, consumer, supplier methid of java8
  10. which version of spring boot u r using
  11. what is release and SNAPSHOT in terms of prod release

Search: 
rxjava, java 14, java 9 for moer knowledge

Round 2:

  1. What is Session
  2. What is Resolver
  3. String builder vs string buffer
  4. What are Class loader in java what are types
  5. Web-INF why your code reside inside inside WEB-INF.
  6. What is Dispatcherservlet and where it reside
  7. Stream with try catch what error occurs
  8. What is Finally
  9. What is Finalize
  10. How to close a file stream. Ans:close()
  11. Multiple inheritance support
  12. Different Annotation in spring boot
  13. What is Propagation and how to define them
  14. Advantages of using Spring data and its feature
  15. Hpow to achieve Pwd encryption during runtime. I told using @Value for pwd inside applicayion.prop files
  16. What is Eks
  17. What are EKS autoscaling worker nodes
  18. How to do use docker registry
  19. What are Docker commands to pull logs
  20. Kubernets commands
  21. Program: Print length of Longest possible Substring:
class Solution {
  public static void main(String[] args) {
    System.out.println("Length of the longest substring: " + findLength("aabccbb"));//abc
    System.out.println("Length of the longest substring: " + findLength("abbbb"));//ab
    System.out.println("Length of the longest substring: " + findLength("abccde"));//abc or cde  
  }
  
 public static int findLength(String s) {
        int start = 0 , len = s.length(),max=0;
        if(len==0 || s==null){
            return 0;
        }else if(len==1){
            return 1;
        }
        HashMap<Character,Integer> map = new HashMap<>();
        for(int end=0;end<len;end++){
            char ch = s.charAt(end);
            if(map.containsKey(ch)){
                start = Math.max(start,map.get(ch)+1);
            }
            map.put(ch,end);
            max = Math.max(max,(end - start + 1));
        }
        return max;
  }
}

22) Can lambda be used only with functional Interface ?
23) What is functional interface in java
24) What is 2 interface has same default method and a class implementing both interface, which method if function gets called
25) Types of Autowiring, when to use which one ?
26) Diff between @restController and controller
27) What all annotations you have used in spring
28) What if stream/ filter throws an error, how to handle them. Ans: through Class E..
29) Difference between SOAP and REST
30) What is RESTFUl web services
Comments (7)