<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Tech BhaiGiri</title>
	
	<link>http://techbhaigiri.com</link>
	<description>Bhai To The Rescue</description>
	<lastBuildDate>Tue, 30 Nov 2010 12:55:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/techbhai" /><feedburner:info uri="techbhai" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>techbhai</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>How to file the PMP PDUs easily</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/s3g2hWJYarU/</link>
		<comments>http://techbhaigiri.com/2010/11/how-to-file-the-pmp-pdus-easily/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 12:55:48 +0000</pubDate>
		<dc:creator>amreekandesi</dc:creator>
				<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[PMI]]></category>
		<category><![CDATA[PMP]]></category>
		<category><![CDATA[software quality]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=207</guid>
		<description><![CDATA[


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a pretty quick way of registering your PDUs online. If this sentence does not make sense then read on else skips to steps below.<br />
If you  have taken a PMP(Project Management Professional) certification or are planning to take one, then its important to know how to earn PDUs(Professional Development Units). In simple terms its a way the PMI ensures that you keep learning. So over the period of 4 years that your certification is valid, you need to earn 60PDUs or else your certification is not renewed. PDUs are earned by attending conferences/classes on relevant topics &amp; writing papers/articles. For more details, https://ccrs.pmi.org/</p>
<p>Step1: Logon to www.pmi.org. Login with your username and password<br />
Step2: On the Home Page, click View PDU and then click Report PDU.</p>
<p>Step3: Select a PDU category</p>
<p><img class="size-full wp-image-208  alignnone" style="border: 1px solid black;" title="PDU1" src="http://techbhaigiri.com/wp-content/uploads/2010/11/PDU1.jpg" alt="where to file PDUs" width="490" height="344" /></p>
<p>Step4:Fill the dates, name and check the relevant categories.<br />
Step5:Fill the provider details like if QAI hosted the event.<br />
Step6:Mention the number of PDUs you want to claim. There are categories and limits in each category<br />
Step7:Finally check the I agree this claim is accurate and Submit.</p>
<p>You will receive an email saying the PDU have been submitted and another one saying approved. I got the two emails pretty quickly. So kudos to PMI for a neat system for submitting the PDUs.</p>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/bNbGDfw8PqXsWodeoFMGucCt9OA/0/da"><img src="http://feedads.g.doubleclick.net/~a/bNbGDfw8PqXsWodeoFMGucCt9OA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/bNbGDfw8PqXsWodeoFMGucCt9OA/1/da"><img src="http://feedads.g.doubleclick.net/~a/bNbGDfw8PqXsWodeoFMGucCt9OA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/s3g2hWJYarU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2010/11/how-to-file-the-pmp-pdus-easily/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2010/11/how-to-file-the-pmp-pdus-easily/</feedburner:origLink></item>
		<item>
		<title>Thanks Watts Humphrey</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/BUvzeglJwDI/</link>
		<comments>http://techbhaigiri.com/2010/11/thanks-watts-humphrey/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 07:15:04 +0000</pubDate>
		<dc:creator>amreekandesi</dc:creator>
				<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=192</guid>
		<description><![CDATA[The first book I picked on quality was  &#8220;Managing the Software Process&#8221;. The reason I picked it up at my  company&#8217;s library was that it had the maximum number of copies in the  quality section. I did not know then that this book was by Watts  Humphrey who was the founder [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><span style="color: black;">The first book I picked on quality was  &#8220;Managing the Software Process&#8221;. The reason I picked it up at my  company&#8217;s library was that it had the maximum number of copies in the  quality section. I did not know then that this book was by Watts  Humphrey who was the founder of the software process program at the SEI.  Recipient of the National Medal of Technology who people remember  because of the simple way explaining the concepts. </span></p>
<p><img class="alignnone" title="Watts humphrey Goerge W Bush" src="http://www.sei.cmu.edu/watts/images/feature_1.jpg" alt="" width="522" height="282" /></p>
<p><span style="color: black;">Humphrey&#8217;s work  at Software Engineering Institute (SEI) at Carnegie Mellon University later led to  development of the  Capability Maturity Model(SEI-CMM)</p>
<p>Watts Humphrey died few days back at his  home in Sarasota, Florida. He was fighting cancer.<br />
</span></p>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/XDMszmIGiRv15_3Kalo9y--LWN0/0/da"><img src="http://feedads.g.doubleclick.net/~a/XDMszmIGiRv15_3Kalo9y--LWN0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/XDMszmIGiRv15_3Kalo9y--LWN0/1/da"><img src="http://feedads.g.doubleclick.net/~a/XDMszmIGiRv15_3Kalo9y--LWN0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/BUvzeglJwDI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2010/11/thanks-watts-humphrey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2010/11/thanks-watts-humphrey/</feedburner:origLink></item>
		<item>
		<title>How to create a quick Mobile Phone Application for Nokia</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/kjBy4XnJSOI/</link>
		<comments>http://techbhaigiri.com/2010/11/how-to-create-a-quick-mobile-phone-application-for-nokia/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 12:18:54 +0000</pubDate>
		<dc:creator>amreekandesi</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Mobile Application]]></category>
		<category><![CDATA[Nokia]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=189</guid>
		<description><![CDATA[This is for you even if you are not a techie or programmer.
Step1: Sign up at http://appwizard.ovi.com/web_nokia/signIn.jsp
Step 2: Use the wizard (click Get Started&#8221; button) and a simple form appears.
Step 3:Enter the RSS feeds URL and the wizard will create a default layout
Step 4: Upload a picture as your icon
Step  5:Upload a picture as [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is for you even if you are not a techie or programmer.<br />
Step1: Sign up at <a href="http://appwizard.ovi.com/web_nokia/signIn.jsp" target="_blank">http://appwizard.ovi.com/web_nokia/signIn.jsp</a></p>
<p>Step 2: Use the wizard (click Get Started&#8221; button) and a simple form appears.</p>
<p>Step 3:Enter the RSS feeds URL and the wizard will create a default layout</p>
<p>Step 4: Upload a picture as your icon</p>
<p>Step  5:Upload a picture as your logo, this will be displayed in the second  row in your app&#8217;s view. Size limitations do irk but make sense.</p>
<p>Step 6: Enter some meta data(information abt yourself and what site  has). Check checkboxes that ask that this content is your IP(property).</p>
<p>Step 7: Preview in emulator(simulated mobile screen) and you are done.</p>
<p>Step 8: Submit for approval&#8230;.usually takes complete 24hours.</p>
<p>Watch out for the next post on how to create an app for Android in Java</p>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/rSVoT9l2LEBT6MtpSUi9qXbyHh0/0/da"><img src="http://feedads.g.doubleclick.net/~a/rSVoT9l2LEBT6MtpSUi9qXbyHh0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/rSVoT9l2LEBT6MtpSUi9qXbyHh0/1/da"><img src="http://feedads.g.doubleclick.net/~a/rSVoT9l2LEBT6MtpSUi9qXbyHh0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/kjBy4XnJSOI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2010/11/how-to-create-a-quick-mobile-phone-application-for-nokia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2010/11/how-to-create-a-quick-mobile-phone-application-for-nokia/</feedburner:origLink></item>
		<item>
		<title>Techbhai at your service</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/F3GIrcKzK54/</link>
		<comments>http://techbhaigiri.com/2010/11/techbhai-at-your-service/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 11:06:12 +0000</pubDate>
		<dc:creator>techbhai</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Process consulting]]></category>
		<category><![CDATA[SCRUM]]></category>
		<category><![CDATA[SEI CMM]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=186</guid>
		<description><![CDATA[We have been thinking recently that we should utilize our wide and  highly-valued experiences in the process &#38; technology domain for  some good. The high percentage of projects that fail in the software  industry have been the biggest motivation for all the process work and  effort put in by companies world [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>We have been thinking recently that we should utilize our wide and  highly-valued experiences in the process &amp; technology domain for  some good. The high percentage of projects that fail in the software  industry have been the biggest motivation for all the process work and  effort put in by companies world over. So you can take those expensive  trainings or hire experts with tons of years of experiences(like us) and  they will work with you to get things in shape&#8230;OR&#8230;.write to us with  your problem and we will guide you for free on how you can use Agile methodologies, SCRUM model or SEI CMM framework.</p>
<p>mailto: <a href="mailto:techbhaigiri@gmail.com" target="_blank">techbhaigiri@gmail.com</a></p>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/i7752shhZRXGHhZnqt55qbVPMNQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/i7752shhZRXGHhZnqt55qbVPMNQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/i7752shhZRXGHhZnqt55qbVPMNQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/i7752shhZRXGHhZnqt55qbVPMNQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/F3GIrcKzK54" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2010/11/techbhai-at-your-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2010/11/techbhai-at-your-service/</feedburner:origLink></item>
		<item>
		<title>Java: Singleton Implementation</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/TawyKd53AJA/</link>
		<comments>http://techbhaigiri.com/2009/05/java-singleton-implementation/#comments</comments>
		<pubDate>Fri, 08 May 2009 18:03:22 +0000</pubDate>
		<dc:creator>techbhai</dc:creator>
				<category><![CDATA[Interview Questions]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Design Pattern]]></category>
		<category><![CDATA[Double checked locking]]></category>
		<category><![CDATA[Singleton]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=150</guid>
		<description><![CDATA[Q: How would you implement double checked locking paradigm to instantiate a Singleton?
A:
public class MyFactory {
  private static volatile MyFactory instance;
  public static MyFactory getInstance (Connection conn) throws IOException {
    if (instance == null) {
      synchronized (MyFactory.class) {
        [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><span style="color: #008000;">Q: How would you implement double checked locking paradigm to instantiate a Singleton?</span><br />
A:</p>
<pre>public class MyFactory {
  private static volatile MyFactory instance;
  public static MyFactory getInstance (Connection conn) throws IOException {
    if (instance == null) {
      synchronized (MyFactory.class) {
        if (instance == null)
          instance = new MyFactory (conn);
      }
    }
    return instance;
  }
}</pre>
<p style="text-align: justify;">The double checked locking paradigm ensures that only the first call to the getInstance() method will go into the synchronized block. During that call, since the <em>instance</em> object is null, the code will go into the synchronized block and create the object. The second check makes sure that if two clients invoke the method at the same time, they will not end up creating two objects.</p>
<p style="text-align: justify;">Any subsequent calls will simply return the <em>instance </em>object created earlier, without going into the synchronized block.</p>
<p style="text-align: justify;">If the instance variable is not declared volatile, this would not work because the variable&#8217;s value might be cached by a thread, in which case a thread might not know if the variable&#8217;s value has changed.</p>
<p>Also Read:</p>
<p><a href="http://www.javamex.com/tutorials/double_checked_locking_fixing.shtml">Javamex Tutorial<br />
</a></p>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/FicZCVnCSQKiXgwAkBVEXzFfm4M/0/da"><img src="http://feedads.g.doubleclick.net/~a/FicZCVnCSQKiXgwAkBVEXzFfm4M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FicZCVnCSQKiXgwAkBVEXzFfm4M/1/da"><img src="http://feedads.g.doubleclick.net/~a/FicZCVnCSQKiXgwAkBVEXzFfm4M/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/TawyKd53AJA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2009/05/java-singleton-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2009/05/java-singleton-implementation/</feedburner:origLink></item>
		<item>
		<title>Java: NavigableSet Interface</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/BCxN6yHXdcA/</link>
		<comments>http://techbhaigiri.com/2009/05/java-navigableset-interface/#comments</comments>
		<pubDate>Fri, 08 May 2009 18:01:48 +0000</pubDate>
		<dc:creator>techbhai</dc:creator>
				<category><![CDATA[Interview Questions]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Collections]]></category>
		<category><![CDATA[Java API]]></category>
		<category><![CDATA[NagivableSet]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=148</guid>
		<description><![CDATA[Q: What is the NavigableSet interface?
A: NavigableSet extends the SortedSet interface and adds navigation methods for reporting closest matches for given search targets.
TreeSet implements this interface.
1.       headSet() &#8211; Returns a view of the portion of this set whose elements are strictly less than toElement.
2.       tailSet() &#8211;    Returns a view of the portion of this set [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><span style="color: #008000;">Q: What is the NavigableSet interface?</span></p>
<p>A: NavigableSet extends the SortedSet interface and adds navigation methods for reporting closest matches for given search targets.</p>
<p>TreeSet implements this interface.</p>
<p>1.       headSet() &#8211; Returns a view of the portion of this set whose elements are strictly less than <tt>toElement</tt>.<br />
2.       tailSet() &#8211;    Returns a view of the portion of this set whose elements are greater than or equal to <tt>fromElement</tt>.<br />
3.       lower() &#8211; Returns the greatest element in this set strictly less than the given element, or <code>null</code> if there is no such element.<br />
4.       higher() &#8211; Returns the least element in this set strictly greater than the given element, or <code>null</code> if there is no such element.<br />
5.       floor() &#8211;   Returns the greatest element in this set less than or equal to the given element, or <code>null</code> if there is no such element.<br />
6.       ceiling() &#8211; Returns the least element in this set greater than or equal to the given element, or <code>null</code> if there is no such element.<br />
7.       descendingSet() &#8211; Returns a reverse order view of the elements contained in this set.</p>
<p><a href="http://java.sun.com/javase/6/docs/api/java/util/NavigableSet.html">Java API documentation</a></p>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/ZXKHSELJitUJ3MRKdS0JQmf0rms/0/da"><img src="http://feedads.g.doubleclick.net/~a/ZXKHSELJitUJ3MRKdS0JQmf0rms/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ZXKHSELJitUJ3MRKdS0JQmf0rms/1/da"><img src="http://feedads.g.doubleclick.net/~a/ZXKHSELJitUJ3MRKdS0JQmf0rms/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/BCxN6yHXdcA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2009/05/java-navigableset-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2009/05/java-navigableset-interface/</feedburner:origLink></item>
		<item>
		<title>Interview Account – IB1</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/7bPi0UwIVU0/</link>
		<comments>http://techbhaigiri.com/2009/05/interview-account-ib1/#comments</comments>
		<pubDate>Wed, 06 May 2009 05:12:41 +0000</pubDate>
		<dc:creator>techbhai</dc:creator>
				<category><![CDATA[Interview Accounts]]></category>
		<category><![CDATA[Interview Account]]></category>
		<category><![CDATA[java interview]]></category>
		<category><![CDATA[programming interview]]></category>
		<category><![CDATA[RBS]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=114</guid>
		<description><![CDATA[The following questions are from an interview for a Java senior developer position at a prominent Investment bank.
Q: What is the Externalizable interface?
A: Externalizable interface extends the Serializable interface, and is used where we want a custom serialized form. Only the identity of the class of an Externalizable instance is written in the serialization stream [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The following questions are from an interview for a Java senior developer position at a prominent Investment bank.</p>
<p><span style="color: #008000;font-size:1.2em;">Q: What is the Externalizable interface?</span><br />
A: <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Externalizable.html">Externalizable </a>interface extends the Serializable interface, and is used where we want a custom serialized form. Only the identity of the class of an Externalizable instance is written in the serialization stream and it is the responsibility of the class to save and restore the contents of its instances. The writeExternal and readExternal methods of the Externalizable interface are implemented by a class to give the class complete control over the format and contents of the stream for an object and its supertypes.</p>
<p>When an Externalizable object is reconstructed, an instance is created using the public no-arg constructor, and then the readExternal method called.</p>
<p><span style="color: #008000;font-size:1.2em;">Q: What is a weak reference?</span><br />
A: A weak reference that isn&#8217;t strong enough to force an object to remain in memory. In other words, once this object is not being referenced by any other strong references, then it can be garbage collected.</p>
<p><code>WeakReference wr = new WeakReference (myObject);<br />
wr.get ()  // returns the referred object (myObject)<br />
</code></p>
<p>If you use an object as a key in an ordinary <code>HashMap</code>, that object cannot be collected until the mapping is removed from the <code>Map</code>; <code>WeakHashMap</code> allows you to use an object as a <code>Map</code> key without preventing that object from being garbage collected.</p>
<p style="text-align: left;"><a href="http://techbhaigiri.com/2009/04/java-weak-references/">View further details and comments</a></p>
<p><span style="color: #008000;font-size:1.2em;">Q: What is a soft reference?</span><br />
A: Soft references are generally retained if memory is available. If however, the JVM is running short of memory then the soft references can be garbage collected.</p>
<p><a href="http://techbhaigiri.com/2009/04/java-soft-reference/">View further details and comments</a></p>
<p><span id="more-114"></span><span style="color: #008000;font-size:1.2em;">Q: What is a phantom reference?</span><br />
A:  PhantomReference objects are always created associated with a ReferenceQueue. The reference will be enqueued when the collector determines that their referent can be reclaimed. These can now be used to perform pre-mortem activities before the object gets reclaimed actually.</p>
<p><code>WeakReferences</code> are enqueued as soon as the <span style="text-decoration: underline;">object to which they point becomes weakly reachable</span>. This is <em>before</em> finalization or garbage collection has actually happened; in theory the object could even be &#8220;resurrected&#8221; by an unorthodox <code>finalize ()</code> method, but the <code>WeakReference</code> would remain dead.</p>
<p><code>PhantomReferences</code> are enqueued only when <span style="text-decoration: underline;">the object is physically removed from memory</span>, and the <code>get ()</code> method always returns <code>null</code> specifically to prevent you from being able to &#8220;resurrect&#8221; an almost-dead object.</p>
<p style="text-align: left;"><a href="http://techbhaigiri.com/2009/04/java-phantom-reference/">View further details and comments</a></p>
<p><span style="color: #008000;font-size:1.2em;">Q: How can you stop the garbage collector from running?</span><br />
A: You cannot stop the asynchronous garbage collector from running. There used to be a flag called noasyncgc, but it is not supported anymore. [<a href="http://forums.sun.com/thread.jspa?threadID=5275933">link</a>]</p>
<p>Creating a very large heap might help by delaying the garbage collection, but when it runs it will take a long time.</p>
<p><span style="color: #008000;font-size:1.2em;">Q: Given a linked list, how can you find the middle element of the list?</span><br />
A:</p>
<p>1.       Initialize two pointers to the front of the list<br />
2.       In each iteration move one pointer by one element and the other pointer by two elements.<br />
3.       When the second pointer reaches the end of the list, the first pointer will be at the middle element of the list.</p>
<p style="text-align: left;"><a href="http://techbhaigiri.com/2009/04/programming-middle-element-of-list/">View further details and comments</a></p>
<p><span style="color: #008000;font-size:1.2em;">Q: How would you print the contents of a tree in level order?</span><br />
A:</p>
<pre>public void levelOrderTraversal () {
  Queue queue = new LinkedList ();
  queue.add (head);
  while (queue.size () &gt; 0){
    Node node = queue.remove ();
    System.out.print (node.value + " ");
    if (node.left! = null) queue.add (node.left);
    if (node.right! = null) queue.add (node.right);
  }
  System.out.println ("");
}</pre>
<p style="text-align: left;"><a href="http://techbhaigiri.com/2009/04/level-order-treetraversal/">View further details and comments</a></p>
<p><span style="color: #008000;font-size:1.2em;">Q: In a list, a majority element is defined as an element that occurs more than n/2 times. Given an input list, how can you determine the majority element, if present?</span><br />
A:</p>
<pre>/**
* Returns the index of the majority element.
* If no majority element is present, then -1 is returned
*/
public static int majorityElement(int[] input){
  Map lookup = new HashMap();
  for(int i = 0; i &lt; input.length; i++){
    Integer temp = lookup.get(input[i]);
    if (temp == null) temp = 1;
    else temp++;
    lookup.put(input[i], temp);
  }
  for(int i = 0; i &lt; input.length; i++){
    int count = lookup.get(input[i]);
    if (count &gt;= input.length/2 + 1) return i;
  }
  return -1;
}</pre>
<p style="text-align: left;"><a href="http://techbhaigiri.com/2009/04/majority-element-in-list/">View further details and comments</a></p>
<p><span style="color: #008000;font-size:1.2em;">Q: How would you write an equals () method?</span><br />
A:</p>
<p>1.       Compare the parameter object with the this object<br />
2.       Check if the parameter object is of the correct type<br />
3.       Cast the parameter object to the desired type<br />
4.       Compare individual fields</p>
<pre>public boolean equals(Object o) {
  if (o == this) return true;
  if (!(o instanceof PhoneNumber)) return false;
  PhoneNumber pn = (PhoneNumber)o;
  return pn.lineNumber == lineNumber &amp;&amp;
  pn.prefix == prefix &amp;&amp; pn.areaCode ==   areaCode;
}</pre>
<p style="text-align: left;"><a href="http://techbhaigiri.com/2009/04/question-implement-equals/">View further details and comments</a></p>
<p><span style="color: #008000;font-size:1.2em;">Q: Given the following code,</span></p>
<p><span style="color: #008000;"><code>Map map = new HashSet ();<br />
map.put (new MyClass1 ("test"), object1);<br />
map.put (new MyClass1 ("test"), object2);<br />
</code></span></p>
<p><span style="color: #008000;">How many objects will be present in the map after these statements? MyClass1 does not override the equals () and hashcode () method?</span></p>
<p>A: Two. The second object is not equal to the first one, so it will get stored as a different key.</p>
<p><span style="color: #008000;font-size:1.2em;">Q: If you override hashcode (), do you need to override equals () also?</span><br />
A: No. But if you override equals (), you certainly need to override hashcode ()</p>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/RZJ-7YCovVnoQktmqhEl0ebfuWg/0/da"><img src="http://feedads.g.doubleclick.net/~a/RZJ-7YCovVnoQktmqhEl0ebfuWg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/RZJ-7YCovVnoQktmqhEl0ebfuWg/1/da"><img src="http://feedads.g.doubleclick.net/~a/RZJ-7YCovVnoQktmqhEl0ebfuWg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/7bPi0UwIVU0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2009/05/interview-account-ib1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2009/05/interview-account-ib1/</feedburner:origLink></item>
		<item>
		<title>Interview Account – IB2</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/DWyfirFZFKc/</link>
		<comments>http://techbhaigiri.com/2009/05/interview-account-ib2/#comments</comments>
		<pubDate>Wed, 06 May 2009 04:31:33 +0000</pubDate>
		<dc:creator>techbhai</dc:creator>
				<category><![CDATA[Interview Accounts]]></category>
		<category><![CDATA[Interview Account]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[java interview]]></category>
		<category><![CDATA[RBS]]></category>
		<category><![CDATA[technical interview]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=98</guid>
		<description><![CDATA[The following questions for a Java development position.
Q: What are the different ways to create a thread?
A:
1. Extend the Thread class
2. Implement the Runnable interface. Create a Thread object using an object of the Runnable type.
Q: On a machine with a single processor, what advantage would you gain by having a multi-threaded application?
A: If one thread [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The following questions for a Java development position.</p>
<p><span style="color: #008000;font-size:1.2em;">Q: What are the different ways to create a thread?</span><br />
A:</p>
<p>1. Extend the <span style="color: #ff0000;">Thread </span>class<br />
2. Implement the <span style="color: #ff0000;">Runnable </span>interface. Create a Thread object using an object of the Runnable type.</p>
<p><span style="color: #008000;font-size:1.2em;">Q: On a machine with a single processor, what advantage would you gain by having a multi-threaded application?</span><br />
A: If one thread is <span style="color: #ff0000;">waiting </span>for some event like I/O or user input, then other threads can use the CPU. If all threads are computation intensive then having multiple threads might not be that helpful.</p>
<p><span style="color: #008000;font-size:1.2em;">Q: What is the disadvantage of using the Spring framework?</span><br />
A: Since all objects are created at <span style="color: #ff0000;">runtime </span>using the XML config, any errors in the bean definition will only be observed at runtime, and not at compile time.</p>
<p><span style="color: #008000;font-size:1.2em;">Q: Explain the Java memory model?</span><br />
A: Data is stored on the <span style="color: #ff0000;">Heap </span>and the <span style="color: #ff0000;">Stack</span>. There is a common heap for the entire process that is shared by all the threads. Any objects are created on the heap. Each thread gets its own stack, and local variables are created on the stack.<span id="more-98"></span></p>
<p><span style="color: #008000;font-size:1.2em;">Q: Why would you use a distributed cache in your application?</span><br />
A:<br />
1.       In a standard java process on 32bit JVM, each process can only have a <span style="color: #ff0000;">heap of 2 GB</span>. If we want to store more data then it is a problem. By having a distributed cache we can bypass that limitation by being able to store as much data as possible. Now we have a large cloud of data running across multiple machines. This approach is very scalable. As the requirements grow, we just need to add more machines to the cache cluster.<br />
2.       We wanted to store <span style="color: #ff0000;">data inside memory </span>instead of a database, for faster access to the data.</p>
<p><a href="http://techbhaigiri.com/2009/04/java-distributed-caching/">View further details and comments</a></p>
<p><span style="color: #008000;font-size:1.2em;">Q: What are the new changes coming up in Java 7?</span><br />
A:</p>
<p>1.       More <span style="color: #ff0000;">predictable </span>garbage collector. A new garbage collector that promises to achieve lower pause times and better predictability than the current CMS collector (VM-level feature)<br />
2.       VM extensions to support the implementation of <span style="color: #ff0000;">non-Java languages</span> at performance levels near to that of the Java language itself<br />
3.       Project Jigsaw &#8211; An implementation-specific, simple, low-level <span style="color: #ff0000;">module </span>system focused upon the goal of modularizing the JDK, and the application of that system to the JDK itself<br />
4.       <span style="color: #ff0000;">NIO2 </span>- New APIs for filesystem access, scalable asynchronous I/O operations, socket-channel binding and configuration, and multicast datagrams. NIO2 uses operating system specific code to access files, directories and network resources, which leads to several speed improvements as well as extended capabilities which were not possible without NIO2. One of the notable improvements offered by NIO2 is the possibility of asynchronous access of (metadata) of files, enabling for example to execute code when a file is change without having to poll the file regularly for changes.<br />
5.       Improved type inference for <span style="color: #ff0000;">Generics</span>, making it possible to write for example the following:<br />
<code>Map&lt;String , List&lt;String&gt;&gt; myMap = new HashMap&lt;&gt;();</code></p>
<p><a href="http://techbhaigiri.com/2009/04/new-features-in-java-7/">View further details and comments</a><a href="http://tech.puredanger.com/2009/04/11/what-java-7-will-mean-to-you/"></a></p>
<p><span style="color: #008000;font-size:1.2em;">Q: How does garbage collection work?</span><br />
A: The default collector has two <span style="color: #ff0000;">generations </span>- young and tenured. Most allocations are done in the young generation which is optimized for objects that have a shorter lifetime. Objects that survive several collections get moved to the tenured generation, which is collected less often as compared to the young generation.</p>
<p>Young generation &#8211; The collector is a copying collector with an option to collect the generation in parallel.<br />
Tenured generation &#8211; The tenured generation is collected using a mark-sweep-compaction algorithm. There is an option to perform this collection concurrently.</p>
<p><a href="http://techbhaigiri.com/2009/04/java-garbage-collection/">View further details and comments</a></p>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/3VqHF3SMBHqXucRRXxfYHjaHtUI/0/da"><img src="http://feedads.g.doubleclick.net/~a/3VqHF3SMBHqXucRRXxfYHjaHtUI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3VqHF3SMBHqXucRRXxfYHjaHtUI/1/da"><img src="http://feedads.g.doubleclick.net/~a/3VqHF3SMBHqXucRRXxfYHjaHtUI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/DWyfirFZFKc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2009/05/interview-account-ib2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2009/05/interview-account-ib2/</feedburner:origLink></item>
		<item>
		<title>Java: Implement Equals ()</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/ibKYApFMMLA/</link>
		<comments>http://techbhaigiri.com/2009/04/question-implement-equals/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 05:43:28 +0000</pubDate>
		<dc:creator>techbhai</dc:creator>
				<category><![CDATA[Interview Questions]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Java API]]></category>
		<category><![CDATA[object equals implement]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=138</guid>
		<description><![CDATA[Q: How would you write an equals () method?
A:
1.       Compare the parameter object with the this object
2.       Check if the parameter object is of the correct type
3.       Cast the parameter object to the desired type
4.       Compare individual fields
public boolean equals(Object o) {
    if (o == this) return true;
    if [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><span style="color: #008000;">Q: How would you write an equals () method?</span><br />
A:</p>
<p>1.       Compare the parameter object with the this object<br />
2.       Check if the parameter object is of the correct type<br />
3.       Cast the parameter object to the desired type<br />
4.       Compare individual fields</p>
<pre>public boolean equals(Object o) {
    if (o == this) return true;
    if (!(o instanceof PhoneNumber)) return false;
    PhoneNumber pn = (PhoneNumber)o;
    return pn.lineNumber == lineNumber &amp;&amp;
           pn.prefix == prefix &amp;&amp; pn.areaCode == areaCode;
}</pre>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/qwt-MMCB7wYewRkv-g2ibbo8K0Y/0/da"><img src="http://feedads.g.doubleclick.net/~a/qwt-MMCB7wYewRkv-g2ibbo8K0Y/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qwt-MMCB7wYewRkv-g2ibbo8K0Y/1/da"><img src="http://feedads.g.doubleclick.net/~a/qwt-MMCB7wYewRkv-g2ibbo8K0Y/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/ibKYApFMMLA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2009/04/question-implement-equals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2009/04/question-implement-equals/</feedburner:origLink></item>
		<item>
		<title>Programming: Majority Element in List</title>
		<link>http://feedproxy.google.com/~r/techbhai/~3/y8AWL0rm6pg/</link>
		<comments>http://techbhaigiri.com/2009/04/majority-element-in-list/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 05:41:32 +0000</pubDate>
		<dc:creator>techbhai</dc:creator>
				<category><![CDATA[Interview Questions]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[lookup table]]></category>
		<category><![CDATA[majority element in list]]></category>
		<category><![CDATA[programming questions]]></category>

		<guid isPermaLink="false">http://techbhaigiri.com/?p=136</guid>
		<description><![CDATA[Q: In a list, a majority element is defined as an element that occurs more than n/2 times. Given an input list, how can you determine the majority element, if present?
A:
We will use a lookup table to store a count of how many times each element occurs. Once we create this table, we can use [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><span style="color: #008000;">Q: In a list, a majority element is defined as an element that occurs more than n/2 times. Given an input list, how can you determine the majority element, if present?</span><br />
A:</p>
<p style="text-align: justify;">We will use a lookup table to store a count of how many times each element occurs. Once we create this table, we can use the lookup table to determine if any element has a corresponding count of more than (n/2 + 1).</p>
<pre>	/**
	 * Returns the index of the majority element.
	 * If no majority element is present, then -1 is returned
	 * @param input
	 * @return
	 */
	public static int majorityElement(int[] input){
		Map lookup = new HashMap();
		for(int i = 0; i &lt; input.length; i++){
			Integer temp = lookup.get(input[i]);
			if (temp == null) temp = 1;
			else temp++;
			lookup.put(input[i], temp);
		}

		for(int i = 0; i &lt; input.length; i++){
			int count = lookup.get(input[i]);
			if (count &gt;= input.length/2 + 1) return i;
		}
		return -1;
	}</pre>


<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/eSN0cMSuduzvB67O4kVTtjJ4WAc/0/da"><img src="http://feedads.g.doubleclick.net/~a/eSN0cMSuduzvB67O4kVTtjJ4WAc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/eSN0cMSuduzvB67O4kVTtjJ4WAc/1/da"><img src="http://feedads.g.doubleclick.net/~a/eSN0cMSuduzvB67O4kVTtjJ4WAc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/techbhai/~4/y8AWL0rm6pg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techbhaigiri.com/2009/04/majority-element-in-list/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://techbhaigiri.com/2009/04/majority-element-in-list/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.534 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-14 01:21:12 -->

