Interview Questions and Answers for 'Atcs' - 28 question(s) found - Order By Newest Frequently asked question in companies using Hibernate. Q1. What is Lazy Initialization in Hibernate ? Hibernate Admin info@buggybread.com
Ans. It's a feature to lazily initialize dependencies , relationship and associations from the Database. Any related references marked as @OneToMany or @ManyToMany are loaded lazily i.e when they are accessed and not when the parent is loaded. Sample Code for Lazy Initialization Help us improve. Please let us know the company, where you were asked this question : VIDEO Like Discuss Correct / Improve hibernate lazy loading hibernate lazy initialization hibernate architecture overstock.com BridgePoint Technologies Medgate Dex Media Diversant Tieto Oracle Bank of America Merrill LYNCH NEC Japan HCL Technologies Deloitte Accenture Accenture India Infosys Tata Consultancy (TCS) Luxoft Nvidia Cority Kumaran Systems PubMatic Deven Infotech Tavant Casenet Azuga Egen Solutions Photon Infotech Dun & Bradstreet ITHAKA EngineerBabu Atos Zycus CPA Global Zycus Fareportal Saxo Bank NSF International Publicis Sapient Razorfish Pratham Software ATCS Q3 Technologies Metacube Software A3Logics Nagarro Tech Mahindra Patni Computers L&T Infotech Mphasis Mindtree Hexaware Collabera 3i Infotech IGate Kpit Technologies NIIT Technologies Trianz Persistent Systems IT Asset SkillTeam Consulting KenQA Services Career Infosystem Savera IT Solutions Miracle Corporate Solutions MAKWIZ Technologies Global Resources Consulting Nastech Consulting Best Infosystems InnoData India Career Trackers and Consulting BR Raysoft Global Brainwork TechnoSolutions GroupFit Insurance Brokers FlexSin Technologies IRIS Software FIS Global Business Solutions TRH Consultancy Services NexThoughts Software Technologies Basic   frequent Try 2 Question(s) TestVery Frequently asked. Q2. Explain throw, throws , try and catch in Java ? Core Java Admin info@buggybread.com
Ans. throw is used to re throw an exception. throws is used to declare that the method throws the respective exceptions. try block is used to identify if the respective block has thrown any exception. catch is used to catch the exception that has been thrown by the respective try block. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java exception handling throw throws try catch Vidram Solutions Cognizant (CTS) basic   frequent Q3. If you need to consume messages from the queue faster, which approach will you recommend - batching or concurrency ? Design 2017-07-24 13:34:47
Ans. Each has it's own advantages
Batching requires less resources but may result in loosing whole batch in case of failure whereas concurrency even though is little more expensive in terms of resources but would result in minimal loss in case of failure.
In case messages are to be consumed in a particular order, batching them in that order and then consuming them makes better sense.
if incoming messages are not continuous , it makes more sense to do concurrency as we need not wait for all messages to form a batch and flush. Though time sensitivity can be added but that would add unnecessary complexity. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve concurrency vs batching concurrency multithreading batch Q4. How can we make sure that a code segment gets executed even in case of uncatched exceptions ? Anonymous
Ans. By putting it within finally. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java oops exceptions finally uncatched exceptions basic   frequent Q5. Is it necessary that each try block to be followed by catch block ? Core Java Anonymous
Ans. It should be followed by either catch or finally block. Sample Code for Retry in case of exception Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java exceptions exception handling try catch finally Oracle OCA Test Accenture Accenture India Cognizant (CTS) basic   frequent Try 1 Question(s) Test Q6. Can we have try and catch blocks within finally ? Core Java Admin info@buggybread.com
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java exceptions exception handling finally try catch yesno Q7. How does a try statement determine which catch clause should be used to handle an exception? Core Java Anonymous
Ans. When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exception is executed. The remaining catch clauses are ignored. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java exceptions exception handling try catch basic   frequent Q8. Can finally block be used without catch ? Core Java Anonymous
Ans. Yes but should follow "try" block then. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java exceptions exception handling try catch finally yes-no Try 1 Question(s) Test Q9. Will finally be called always if all code has been kept in try block ? Core Java Admin info@buggybread.com
Ans. The only time finally won't be called is if you call System.exit() or if the JVM crashes first. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java exceptions exception handling try catch finally system system.exit Do you think these are the Best Java Frameworks ? OpenXava SPRING MVC Apache Stripes Check everything that is Best in Java Click Here
Q10. Write a Program to check if 2 strings are Anagrams ? Core Java 2016-11-30 20:52:37
Ans. public void checkIfAnagram(String str1,String str2){
boolean anagram = true;
for(char c:str1.toCharArray()){
if(!str2.contains(String.valueOf(c))){
System.out.println("Strings are Anagrams");
anagram = false;
}
if(anagram == true){
System.out.println("Strings are not Anagrams");
}
}
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve check if 2 strings are Anagrams Amazon DataMetica Hewlett Packard (HP) Opera Solutions AirWatch Booking.com JP Morgan Verdantis AppDynamics QSI Healthcare Vistaar Technologies Maventic 5AM Solutions Rare Mile Technologies Shutterfly Fiberlink Veeva Systems Flipkart eHarmony Splunk Zoho Betterment WisdmLabs Adap.tv Spotify Yahoo Wissen Infotech GlobalLogic Infinite Computer Solutions basic   frequent Q11. What's wrong with this code ? public static void main(String[] args) { String regex = "(\\w+)*"; String s = "Java is a programming language."; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(s); while (matcher.next()) { System.out.println("The e-mail id is: " + matcher.group()); } } Core Java Admin info@buggybread.com
Ans. matcher.find() should have been used instead of matcher.next() within while. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java regex pattern.matcher java.util coding code Q12. Which interfaces are implemented by BatchUpdateException? Anonymous
Ans. [Iterable] Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve java BatchUpdateException include Q13. Which of the following is not possible ? a. try block followed by catch b. try block followed by finally c. try block followed by catch block and then finally d. try block without catch or finally block Anonymous
Ans. try block without catch or finally block Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve exceptions java try-catch finally Try 1 Question(s) Test Q14. What is the difference between following code segments
1.
try {
for(int i=0;i<100;i++){
calculate(i);
}
} catch (Exception ex) {
System.out.println("Error while processing")
}
and
2.
for(int i=0;i<100;i++){
try {
calculate(i);
} catch (Exception ex) {
System.out.println("Error while processing")
}
}
Core Java 2016-12-29 15:42:10
Ans. In first case the whole loop will terminate as soon as any exception happens in the method calculate ( assuming calculate method is not handling its exception and those are thrown back at the calling method )
In Second case exception will be caught for individual iteration and hence it wont break the loop and will continue for the next iteration. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve exception handling try catch Tieto Q15. What is the difference between CountingSemaphore and a CountDownLatch? Operating System 2017-05-07 19:31:17
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve CountingSemaphore CountDownLatch Q16. Given a string and index for the opening bracket, find the index of matching closing bracket. Core Java 2017-05-07 20:11:06
This question was recently asked at 'Amazon'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve matching bracket stack Amazon Q17. What is dynamic dispatch in Java ? Core Java 2017-05-29 09:57:31
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve dynamic dispatch runtime polymorphism object oriented programming (oops) oops concepts Ans. We can do it by either going to Elastic Beanstalk -> Respective instance -> Logs
or using CloudWatch -> Logs -> Respective Log Group Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve aws logs cloudwatch logs elastic beanstalk Ans. Amazon CloudWatch is a monitoring service for AWS cloud resources like Beanstalk and DB instances. We can use CloudWatch to monitor the state of resources, collect metrices, set alarms and appropriate response to the alarm state. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve aws cloudwatch amazon cloudwatch aws Do you think these are the Best Java Frameworks ? OpenXava SPRING MVC Apache Stripes Check everything that is Best in Java Click Here
Q20. Write code to sort an array. Algorithm 2018-07-04 16:15:16
This question was recently asked at 'Deloitte,Match,Ebates,Google,Zento,Zillow,UXP Systems,HCL Technologies,Infosys,IDEMIA,Optym,Groupon,Tata Consultancy (TCS),Arbeiten bei Zeus,Accenture,Accenture India'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve array sorting Deloitte Match Ebates Google Zento Zillow UXP Systems HCL Technologies Infosys IDEMIA Optym Groupon Tata Consultancy (TCS) Arbeiten bei Zeus Accenture Accenture India basic   frequent Ans. We can schedule that through CloudWatch. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve lambda function aws lambda aws serverless computing amazon cloud serverless computing amazon lambda function aws cloudwatch amazon cloudwatch Q22. If you have to pull a sub string out of a string, which method would you use - using String methods or Pattern / Matcher ? Design 2019-01-10 09:43:14
Ans. It depends on how complex it is and if in future it would need any sort opf debugging. It's not easy to debug code if it's making heavy use of shortcuts like Lambda , Patterns etc. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve pattern matching String design Ans. AWS CloudWatch Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve aws cloudwatch amazon cloudwatch Ans. CloudWatch Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve aws ec2 aws computing amazon cloud computing amazon ec2 aws cloudwatch amazon cloudwatch Ans. Only Basic not advanced Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve aws cloudwatch amazon cloudwatch Ans. CPU, Disk, Network, Status Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve aws cloudwatch amazon cloudwatch Ans. 5 mins for Standard / Basic
1 min for Detailed / advanced Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve aws cloudwatch amazon cloudwatch Ans. CloudWatch is for monitoring resources whereas CloudTrail is for auditing activity. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve aws cloudwatch amazon cloudwatch aws cloudtrail aws cloudwatch amazon cloudwatch vs aws cloudtrail