tag:blogger.com,1999:blog-8712770457197348465.post5365394614279894728..comments2015-07-07T01:24:29.087-07:00Comments on Javarevisited: Top 30 Programming questions asked in Interview - Java C C++ AnswersJavin Paulhttps://plus.google.com/114528699166048052030noreply@blogger.comBlogger49125tag:blogger.com,1999:blog-8712770457197348465.post-35942309963823110842015-07-06T04:34:03.062-07:002015-07-06T04:34:03.062-07:00can you help me for writing this program
1234321
...can you help me for writing this program<br /> 1234321<br /> 12321<br /> 121 <br /> 1Radha Pollisettihttp://www.blogger.com/profile/03712452027873175344noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-56780642099520289602014-12-10T07:40:50.821-08:002014-12-10T07:40:50.821-08:00For a better solution for question 8, assuming it&...For a better solution for question 8, assuming it's consecutive numbers up to N, return N*(N+1)/2 - sumOfMissingNoArray.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-48656313969966988902014-11-03T05:22:39.598-08:002014-11-03T05:22:39.598-08:00Great collection and thank you for sharing, I must...Great collection and thank you for sharing, I must admit few of these I never encountered.<br />But I must say that I disagree with your statement:<br />"itâ€™s expected that you are familiar with fundamental of programming and can solve problems without taking help of API"<br />With first part I agree, but the second part... doesn't that just sound strange to you?<br />I read it likeMario Zoricahttp://www.blogger.com/profile/06671224876432667555noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-53576878112525619762014-08-19T19:10:51.169-07:002014-08-19T19:10:51.169-07:00@Stanislav Lorents: your solution for the step cou...@Stanislav Lorents: your solution for the step count is wrong. For one step, there's one way (s(1) = 1). For two steps, two ways (s(2) = 2). From the third step, you can choose to go to step 1 or 2. The number of ways is s(1) + s(2). For four steps, you can go to step 3 or 2 (s(3) + s(2) ways). It's Fibonacci again.Scotthttp://www.blogger.com/profile/05511964464437000519noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-3571805442702052082014-08-11T21:17:33.204-07:002014-08-11T21:17:33.204-07:00@Ramesh Kumar
String newString = "";
Str...@Ramesh Kumar<br />String newString = "";<br />String a = "My name is X Y Z";<br /> int n = a.length();<br /> int k = n-1;<br /> int j=0;<br /><br /> for (int i=n-1; i>=0; i--)<br /> {<br /> if (a.charAt(i) == ' ' || i==0)<br /> {<br /><br /> j= (i!=0)?i+1:i;<br /><br /> while(j<=k)<br /> {<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-44489441816364964852014-06-23T10:37:03.740-07:002014-06-23T10:37:03.740-07:00Can any one help me in doing this Program:
Design ...Can any one help me in doing this Program:<br />Design a Java Program to generate a bill for a customer after his order had been taken in any of the Pizza hut outletsAnkita Panditnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-69330799221626870662014-05-30T05:31:06.950-07:002014-05-30T05:31:06.950-07:00How to convert String s=" Hi Hello World"...How to convert String s=" Hi Hello World" into "world hello hi" can you please tell me<br />Ramesh Kumarhttp://www.blogger.com/profile/01390467032024724628noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-86432064211646239192014-05-16T13:47:10.391-07:002014-05-16T13:47:10.391-07:008)Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find w...8)Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.<br /><br />I had just completed intro to java and I don't know anything about hashtables, so I simply created a nested for loop with an IF statement inside to compare every number 1 by 1. This will output a number from the first array that didn't match with the second array. Due to the natureaesixonlinehttp://www.blogger.com/profile/15040244823630502242noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-74076227352943237302014-04-24T22:17:36.541-07:002014-04-24T22:17:36.541-07:00Coding on a whiteboard, without a computer, withou...Coding on a whiteboard, without a computer, without tools to debug or observer your working code, without a search engine, observed and critiqued is really unnatural. What's the point again? To see how good someone is at programming?Buck Swaynehttp://www.blogger.com/profile/12400508468066168422noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-85982888719182486842014-03-21T01:43:14.115-07:002014-03-21T01:43:14.115-07:00why don't you put list of complex programming ...why don't you put list of complex programming questions for interviewAlen Jainhttp://www.blogger.com/profile/15211567207099447748noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-37284958023957663122014-03-03T14:43:00.418-08:002014-03-03T14:43:00.418-08:00Here's one I got:
Given a chessboard one Knig...Here's one I got:<br /><br />Given a chessboard one Knight, determine whether there is a path through the chessboard, starting on any square, which would result in the Knight visiting every square on the board.<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-72599745672639109162014-02-18T23:34:48.058-08:002014-02-18T23:34:48.058-08:00can you add some programming interview questions o...can you add some programming interview questions on multithreading concept?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-69435932318883583352014-02-18T23:33:21.493-08:002014-02-18T23:33:21.493-08:00can you give me the code for
Q)Biggest polidrome i...can you give me the code for<br />Q)Biggest polidrome in a given string?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-1677847712008688172014-02-18T04:18:02.790-08:002014-02-18T04:18:02.790-08:00For computing fibonacci sequence numbers, you can ...For computing fibonacci sequence numbers, you can even manage a O(log(n)) complexity (in time), same for question number 25 (mistakenly written as 35 by the way).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-83142583546265011302014-01-01T09:24:40.281-08:002014-01-01T09:24:40.281-08:00plz give solution using java programmin to find or...plz give solution using java programmin to find or count super palindrome in a string eg.nanded ,,,ie nan is <br />palindrom and ded is another palindrome ..plz mail soln to koolkbh@rediffmail.vomAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-87083475986686346032013-12-01T01:55:24.064-08:002013-12-01T01:55:24.064-08:008)Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find w...8)Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.<br />Because {1,2,3,4,5} is sorted array you can use binary search in it while walk through {2,3,1,0,5}. It is fastest, isn't it?Stanislav Lorentshttp://www.blogger.com/profile/14371581858849848974noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-2308320009380885022013-11-30T23:53:56.105-08:002013-11-30T23:53:56.105-08:005) In an array 1-100 numbers are stored, one numbe...5) In an array 1-100 numbers are stored, one number is missing how do you find it?<br />First decision sort and walk. Fast algorithm formula: result = sum(1..100) - sum(of array numbers). <br />35) You need to write a function to climb n steps you can climb either 1 step at a time or 2 steps a time, write a function to return number of ways to climb a ladder with n step. <br />Enjoy C/C++ http://Stanislav Lorentshttp://www.blogger.com/profile/14371581858849848974noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-70064796644138172882013-11-22T06:22:05.711-08:002013-11-22T06:22:05.711-08:00When trying to solve the question asking "Giv...When trying to solve the question asking "Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array" I see a lot of O(n^2) responses (double loops). I think knowing the API gives a good developer a 'leg up':<br /><br /> Integer[] a = new Integer[]{1,2,3,4,5};<br /> Integer[] b = new Integer[]{2,3,1,0,5};<br /> Set setA = new HashSet<&Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-71916695546543910872013-08-19T00:21:37.023-07:002013-08-19T00:21:37.023-07:00Hello Javin, would you mind to share some Programm...Hello Javin, would you mind to share some Programming Interview questions from Microsoft, Google, Amazon, Twitter and Facebook. I have those companies on my radar and preparing for their job interviews. Since you share some genuine, real questions, I would be glad if you can get something from your network for Microsoft, Amazon and Google. I am specially interested on coding, logic and Gurpeetnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-62172939031439137752013-08-04T22:38:00.382-07:002013-08-04T22:38:00.382-07:00Write the code you can get it on the greatest comm...Write the code you can get it on the greatest common factor.please any one answer this question Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-45229101168898618802013-08-03T04:27:42.833-07:002013-08-03T04:27:42.833-07:00great stuff,, but it would be much better if the a...great stuff,, but it would be much better if the answer were given here.<br />CAN ANYONE SEND ME SOLUTION OF ABOVE GIVEN QUESTION PLEASE,,,, rajnikantmrc@gmail.comAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-79607316042176548642013-05-08T08:43:21.896-07:002013-05-08T08:43:21.896-07:008)Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find w...8)Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.<br /><br />int[] a = { 1, 2, 3, 4, 5, 8 };<br />int[] b = { 2, 3, 1, 0, 5 };<br /><br /> boolean isPresent = false;<br /> for (int i = 0; i < a.length; i++) {<br /> for (int j = 0; j < b.length; j++) {<br /> if (a[i] == b[j]) {<br /> isPresent = true;<br /> }<br /> }<br /> if Sandip Dabhadehttp://www.blogger.com/profile/03212444505612638567noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-48162911216320147432013-01-01T13:24:17.614-08:002013-01-01T13:24:17.614-08:00Most of them are too easy. ...really...just in cla...Most of them are too easy. ...really...just in class 11 but i no most of these...some of them have also been in question paper.sohailhttp://www.blogger.com/profile/05553264458339887584noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-48222789964785601662012-12-29T21:39:02.043-08:002012-12-29T21:39:02.043-08:008)Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find w...8)Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.<br /><br />1. Sort two arrays independently ( O(n*log(n) time).<br />2. Marching two sorted array to find those duplicate numbers. Jacques LIAOhttp://www.blogger.com/profile/06803811431102783468noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-15364855722860080392012-10-26T12:25:37.874-07:002012-10-26T12:25:37.874-07:00Hi Javin,
For question 3, I was able to write a p...Hi Javin,<br /><br />For question 3, I was able to write a program that can do it using recursion, its here http://www.journaldev.com/526/java-program-to-find-all-permutations-of-a-string <br /><br />But I was not able to write a program using iteration, do you have a solution for that?<br /><br />For question 4, I wrote a program that you might want to check at http://www.journaldev.com/530/Pankaj Kumarhttp://www.blogger.com/profile/05601085691545168477noreply@blogger.com