tag:blogger.com,1999:blog-8712770457197348465.post871993298052404892..comments2024-03-28T02:47:19.159-07:00Comments on Javarevisited: Top 20 Core Java Interview Questions and Answers from Investment Banksjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger71125tag:blogger.com,1999:blog-8712770457197348465.post-38534038892175671602016-05-21T19:48:42.017-07:002016-05-21T19:48:42.017-07:00@Aniket, that comment was with respect to HashMap ...@Aniket, that comment was with respect to HashMap and LinkedHashMap as they are using binary tree instead of linked list to store collided elements in the bucket. Please see my post <a href="http://javarevisited.blogspot.com/2016/01/how-does-java-hashmap-or-linkedhahsmap-handles.html" rel="nofollow">How HashMap and LinkedHahsMap handles collision in Java</a>javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-59607882127760361162016-05-21T08:12:01.323-07:002016-05-21T08:12:01.323-07:00When you say
"From Java 8 onwards though col...When you say <br />"From Java 8 onwards though collision will not impact performance as much as it does in earlier versions because after a threshold the linked list will be replaced by the binary tree, which will give you O(logN) performance in the worst case as compared to O(n) of linked list.<br />"<br /><br />I hope you mean binary search tree. Not sure how else it can be O(logN).Aniket Thakurhttps://www.blogger.com/profile/07553743551249736583noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-51814864646659699552015-11-24T03:44:08.972-08:002015-11-24T03:44:08.972-08:00For question number 5 regarding Singleton, I reall...For question number 5 regarding Singleton, I really don't understand why there is no private constructor defined as the class can still be instantiated using default constructor?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-73860963765098866742015-10-21T19:37:05.734-07:002015-10-21T19:37:05.734-07:00Simple but useful questions, for more Java intervi...Simple but useful questions, for more Java interview questions from last 5 years, see this list of <a href="http://javarevisited.blogspot.com/2015/10/133-java-interview-questions-answers-from-last-5-years.html" rel="nofollow">133+ Java questions wiht answers</a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-24010822349706049402015-10-06T21:58:17.844-07:002015-10-06T21:58:17.844-07:00Recently I appeared for some service based compani...Recently I appeared for some service based companies like Sapient, Cognizant, Infosys and Mindtree for a senior Java developer role, soem of the question I could reemember from those interviews are :<br />Explain JVM architecutre?<br />Difference between interface and abstract class?<br />How Garbage collector works?<br />How HashMap works?<br />Does Java support multiple inheritance?<br />Akshaynoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-44736095456275711992015-09-30T00:42:10.730-07:002015-09-30T00:42:10.730-07:00Here is another good list of curated core Java int...Here is another good list of curated <a href="http://java67.blogspot.co.uk/2015/03/top-40-core-java-interview-questions-answers-telephonic-round.html" rel="nofollow">core Java interview questions</a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-86173581848953326652015-09-29T02:48:27.264-07:002015-09-29T02:48:27.264-07:00Hi ,
I have doubt regarding question no : 3
Does...Hi , <br />I have doubt regarding question no : 3 <br />Does all property of Immutable Object needs to be final?<br /><br />What if we write main method in the class itself. Here we can access the private member of that class by creating object of the class. In this case it is not immutable class.akshaytankhttps://www.blogger.com/profile/03767980172504302453noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-59539526727300715572015-05-16T03:51:26.510-07:002015-05-16T03:51:26.510-07:00Question nineteen : time can be computed by system...Question nineteen : time can be computed by system.nanoTime() if milliseconds returned are zero<br />remember that if the time taken for execution is too small, it might show that it is taking zero milliseconds for execution. Try it on a method which is big enough, in the sense the one which is doing considerable amount of processing<br /><br /><br />chaitunoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-24596268841234806012014-12-12T08:59:17.584-08:002014-12-12T08:59:17.584-08:00Thanks Guys, You may also like to see my list of 5...Thanks Guys, You may also like to see <a href="http://javarevisited.blogspot.de/2014/07/top-50-java-multithreading-interview-questions-answers.html" rel="nofollow">my list of 50 multithreading questions</a>, let me know if you find it good. CheersJavinhttp://java67.blogspot.comnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-59107109022778984242014-11-17T22:23:40.548-08:002014-11-17T22:23:40.548-08:00hey @Javin - Sting pool is in method area and not ...hey @Javin - Sting pool is in method area and not in permgen space...<br />Thanks,<br />Pramod pAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-79456389064047869482014-11-15T17:46:02.005-08:002014-11-15T17:46:02.005-08:00Can someone tell me, why does collection use objec...Can someone tell me, why does collection use objects not primitive types. While objects take more space to work.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-91070240851892098602014-05-21T03:42:23.854-07:002014-05-21T03:42:23.854-07:00Hi all
i have an interview in RAK bank for the pos...Hi all<br />i have an interview in RAK bank for the post java developer..if anyone know about the interview questions please helpAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-71292540398226897802014-03-28T12:34:29.479-07:002014-03-28T12:34:29.479-07:00Method submit extends base method Executor.execute...Method submit extends base method Executor.execute(java.lang.Runnable) by creating and returning a Future that can be used to cancel execution and/or wait for completion. Methods invokeAny and invokeAll perform the most commonly useful forms of bulk execution, executing a collection of tasks and then waiting for at least one, or all, to complete. (Class ExecutorCompletionService can be used to Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-34773934143418598682014-03-22T08:19:27.181-07:002014-03-22T08:19:27.181-07:00First of all, thank you so much for putting this p...First of all, thank you so much for putting this page together. It is a great starting point to refresh some concepts before going into an interview. I would also recommend that everyone study the book 'Effective Java' too. I wanted to bring up a point that JCIP discusses in Chapter 16.<br /><br />"Double checked locking is an anti-pattern..." -Java Concurrency in Practice p.cbphttps://www.blogger.com/profile/09250070918595174519noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-29438781915573627092014-02-19T02:00:26.162-08:002014-02-19T02:00:26.162-08:00Hi,
The Answer to 3. question is wrong. When crea...Hi,<br /><br />The Answer to 3. question is wrong. When creating string using new will create two copies one in heap and another in string pool. And the object reference will be initially in heap. Inorder to make the object reference to string pool we need to call intern() on the string. Surendarnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-53792925765786683432013-10-20T09:47:19.022-07:002013-10-20T09:47:19.022-07:00Hi Javin,
I'd like to thank you for putting h...Hi Javin,<br /><br />I'd like to thank you for putting huge effort in creating such nice collection.<br /><br />Kindly update following in your blog:<br />Regarding Question-3. you wrote:<br /><br />String s = new String("Test"); does not put the object in String pool<br /><br />This is not correct. using new will create two objects one in normal heap and another in Pool and s will jituhttps://www.blogger.com/profile/18129305397171594074noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-9485167001583337632013-09-16T01:57:50.845-07:002013-09-16T01:57:50.845-07:00These questions and answers are ok, but they look ...These questions and answers are ok, but they look more suited for junior developers than senior engineers to me.<br /><br />Just few quick remarks from me:<br /><br />1. Immutability in Java is not that easy to achieve, as long as we have reflexion. Of course, in theory, reflexion can be disabled from a security provider. But in practice, a Java application uses several technologies that rely on Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-23260098959843630502013-08-26T19:41:20.558-07:002013-08-26T19:41:20.558-07:00I agree with Xhotery, this questions are from 2012...I agree with Xhotery, this questions are from 2012 and 2011 years, now it's 2013. In order to crack Java interview today, you need to focus extensively on JVM internals, deeper knowledge of Java Concurrency, sophisticated open source library and good knowledge of frameworks like Spring, Hibernate, Maven, and even bit of functional programming knowledge is required. In recent Java interviews, Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-57110668612141373882013-08-14T19:33:57.319-07:002013-08-14T19:33:57.319-07:00These questions are quite basic and only useful fo...These questions are quite basic and only useful for freshers or beginners Java developers. I wouldn't say, you can expect this question as Senior Java developer. Everyone knows answers, there is nothing special about it. definitely not TOP questions in my opinion.Xhoterynoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-5399120370643099362013-06-09T03:24:02.503-07:002013-06-09T03:24:02.503-07:00@Javin,
I read it in SCJP for Java 6 book by Kath...@Javin,<br /><br />I read it in SCJP for Java 6 book by Kathy Sierra page 434. I am copying and pasting same here..<br /><br />----------------------<br />String s = "abc"; <br /><br />// creates one String object and one reference variable. In this simple case, "abc" will go in the pool and s will refer to it.<br /><br /><br />String s = new String("abc"); <br /><brRavihttps://www.blogger.com/profile/05615043582944872845noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-8915990427843154862013-06-01T08:55:18.606-07:002013-06-01T08:55:18.606-07:00Nikhil: Question 19 To find out time taken by meth...Nikhil: Question 19 To find out time taken by method to execute <br />System.currentTimeInMillis() will not be accurate as it will also include time for which current thread waited due to context switch. Below approach should be used:<br /><br />ThreadMXBean threadMX = ManagementFactory.getThreadMXBean();<br /><br />long start = threadMX.getCurrentThreadUserTime();<br />// time-consuming Nikhilnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-18619676840820267522013-05-29T05:30:00.087-07:002013-05-29T05:30:00.087-07:00@supriya, JVM is platform dependent, only bytecode...@supriya, JVM is platform dependent, only bytecode is platform independent.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-78067987056214555142013-05-24T06:28:23.030-07:002013-05-24T06:28:23.030-07:00one question commonly asked is why JVM or why is ...one question commonly asked is why JVM or why is jvm platform independentAnonymoushttps://www.blogger.com/profile/17761934124555962060noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-61817631231250214842013-05-01T19:18:20.487-07:002013-05-01T19:18:20.487-07:00@Anonymous, are you asking for Citigroup Java deve...@Anonymous, are you asking for Citigroup Java developer position or Citibank?Gautamnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-23683635035299604712013-04-29T23:41:07.677-07:002013-04-29T23:41:07.677-07:00hi Javin, Can you please share some Citibank Java ...hi Javin, Can you please share some Citibank Java Interview questions? I have an interview with Citibank Singapore for Algorithmic trading developer position, and expecting few Java questions? Would be great if you could share some questions from Citibank, Credit Suisse, UBS or ANZ, these are my target companies. CheersAnonymousnoreply@blogger.com