This repository will contain all the java, spring, hibernate, mysql, elastic search, thread, related questions.
- Why Streaming?(FileUpload)
- Types of GC
- Explain internal working of GC(Garbage Collector)?
- Allocating max head size for jar?
- Types of classloader and Bootstrap classloader?
- use of transient keyword
- HashMap is on which data structure?
- How ConcurrentHashMap Works Internally in Java?
- Eliminated permGen memory block from java 8, why?
- Optional with stream() can be applied or not?
- How to make class immutable?
- How many different ways to create objects in Java?
- Why string is immutable class?
- Is java a pure object oriented programming language?
- @Bean can be used at class level?
- What is difference between spring and spring boot?
- Types of autowiring in spring
- How to include one package to another package?
- Use of @ComponentScan annotation?
- Can we use @component instead of @service in spring?
- Why spingboot?
- How spring transaction management work?
- What is a transitive Maven dependency?
- Maven Dependency Scopes
- Types of IOC containers in Spring Framework
- What is servlet controller?
- What is sping boot acuator
- What is dev tools in spring? For what purpose it is used?
- What is spring MVC?
- Write spring annotation with cron expression for a job which execute at every 5 min. Is at main class we to annotate any annotaion?If yes then with which?
- When to use Qualifier and Primary in Spring?
http://hibernate.org/orm/documentation/5.4/
- What Is a Second-Level Cache?
- Different annotations in hibernate?
- @OneToMany mapping?
- What is the use of @inheritance?
- How to use super class and subclass as individual entity?
- Where we can use @manyToMany mapping, explain we example?
- What is disadvantage of hibernate?
- What is the "N+1 selects problem" in ORM (Object-Relational Mapping)?
- Self join of same table for username and manager name.
- What is the use of Composite key? - MySql Tuning?
- How to delete only duplicate/copy from employ table?
- How to fetch first and last record from the table?
- Write MySql query to print second highest salary from employee table?
- Best practice for writing naming convention of api URI.
- Difference between PATCH, PUT and POST Method?
- REST API using POST instead of GET
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs.html
- different types of queries
- less than and greater than
- How to fetch total record no. of a query?
- What is token filter(stopwords, tokenizer, etc)?
- What is analyser? How we can use this in ES?
- How to create mapping?
- What are different Http methods use in ES query?
- [Instead of POST when we PUT some record/doc then what will happen?]
- Why double checking in Singleton?
- Singleton real world example.
- What is proxy class?
- How to create proxy design pattern?
- What is abstract design pattern?
- What is Command design pattern? Where we can use this?
- What are the different design pattern use in Spring framework?
- How to prevent Singleton Pattern from Reflection, Serialization and Cloning?
- What is microservice design pattern?
- What is a transitive Maven dependency?
- Dependency scope of maven
- What is main purpose of maven?
- How maven search dependency in your system? Explain.
- How to prevent a network or service failure from cascading to other services?
- How to manage Latency and Fault Tolerance for Distributed Systems?
- Different HTTP types? What is PATCH http method?
- What will be differrent reason when below 2 mb file uploaded and above doesn't through a api?
- Find 2nd lagest number in an array? Input: {23,10,34,23,20} -> output: 23
set arr = [23,10,34,23,20] int lengthOfArray = arr.length(); int max = 0; int secondMax = 0; for(int i=0;i<lengthOfArray;i++){ if(arr[i]>max){ secondMax = max; max= arr[i]; } s.o.p(secondMax); } - Occurance count string = "AAABBCCCDDAACCEE" then ouput : 3A2B3C2D2A2C2E
public class Main { public static void main(String[] args) { String str = "AAABBCCCDDAACCEE"; int strLength = str.length(); char ch = str.charAt(0); int counter = 0; for(int i=0;i<strLength;i++){ if(ch == str.charAt(i)){ counter=counter+1; continue; } else { System.out.print(counter); System.out.print(ch); counter = 1; ch = str.charAt(i); } } System.out.print(counter); System.out.print(ch); } } - all permutation of a string = "ABC" then ouput : ABC, ACB, BAC, BCA, CAB, CBA