RealTimeQns&Ans




Qn: How you will improve performance of an Application in production Environment ?

Ans:
1. i will change showSql=true in hibernate configuration file so that i can verify criteria queries(sql) in console.
I will try to optimise the query based in scenario.

2. after discussion with my team if we feel that creating of indexes are giving fast retrieval records then we raise production ticket to implement that.

Qn: from a given string, write a java program to find count of each character occurrence ?

Ans:
ex :  String str = "this is about the program fundamentals";

Ans-1)
1. convert string to character array
2. for loop the charcters and put into hashmap <character, integer>
3. put key as character and value is 1  at starting point.
4. if key is duplicate in hashmap, it returns false, if condition checks duplicate key, if so get value from map and increment by 1 and update value to hashmap.

Ans-2)
1. sort the string and convert into char array.
2.take temp array which contains all character(ex: 26 characters),
3. for loop the temp array and find out next character index from sorted string.
4. then answer is each character count calculated as ending index-starting idex+1

Qn. there is a menu names and submenu's names (may it contains duplicate names) stored in db and retrieving from db. how you will design the code?

<<<<<Please Answer in comments>>>>>>>>>>>>

Qn: how you will design Car ?
Ans:

Qn: how you will design Car factory?


No comments:

Post a Comment

JAVA NOTES

  click here  👉  Interview  Preparation : complete notes sql queries notes ============================================================ Con...