<?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" version="2.0">

<channel>
	<title>Technical Interview Questions</title>
	
	<link>http://www.technicalinterview.info</link>
	<description>Java Interview Questions | IT interview questions | Software Testing Interview questions | .Net Interview Questions | Job Interview Questions &amp; Answers | Tough Interview Questions | Technology Interview Questions | Tech Interview Questions | Testing Interview Questions | SAP Interview Questions | ABAP Interview Questions | Data Warehousing Interview Questions</description>
	<pubDate>Wed, 29 Apr 2009 16:14:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TechnicalInterviewQuestions" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="technicalinterviewquestions" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">TechnicalInterviewQuestions</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Web Services Interview Questions2</title>
		<link>http://www.technicalinterview.info/web-services-interview-questions2/</link>
		<comments>http://www.technicalinterview.info/web-services-interview-questions2/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 08:31:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Web Services Interview Questions2]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/?p=2275</guid>
		<description><![CDATA[Can you debug a Windows Service? How? 
Yes we can debug a Windows Service.
Attach the WinDbg debugger to a service after the service starts
This method is similar to the method that you can use to attach a debugger to a process and then debug a process.  
Use the process ID of the process that [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Can you debug a Windows Service? How? </strong></p>
<p>Yes we can debug a Windows Service.<br />
Attach the WinDbg debugger to a service after the service starts<br />
This method is similar to the method that you can use to attach a debugger to a process and then debug a process.  </p>
<p>Use the process ID of the process that hosts the service that you want to debug   </p>
<p>1. To determine the process ID (PID) of the process that hosts the service that you want to debug, use one of the following methods.  </p>
<p>• Method 1: Use the Task Manager<br />
  a. Right-click the taskbar, and then click Task Manager. The Windows Task Manager dialog box appears.<br />
  b. Click the Processes tab of the Windows Task Manager dialog box.<br />
  c. Under Image Name, click the image name of the process that hosts the service that you want to debug. Note the process ID of this process as specified by the value of the corresponding PID field.</p>
<p>• Method 2: Use the Task List Utility (tlist.exe)<br />
  a. Click Start, and then click Run. The Run dialog box appears.<br />
  b. In the Open box, type cmd, and then click OK.<br />
  c. At the command prompt, change the directory path to reflect the location of the tlist.exe file on your computer.</p>
<p>   Note the tlist.exe file is typically located in the following directory: C:\Program Files\Debugging Tools for Windows<br />
  d. At the command prompt, type tlist to list the image names and the process IDs of all processes that are currently running on your computer.</p>
<p>   Note make a note of the process ID of the process that hosts the service that you want to debug.</p>
<p>2. At a command prompt, change the directory path to reflect the location of the windbg.exe file on your computer.  </p>
<p> Note If a command prompt is not open, follow steps a and b of Method 1. The windbg.exe file is typically located in the following directory: C:\Program Files\Debugging Tools for Windows.  </p>
<p>3. At the command prompt, type windbg –p ProcessID to attach the WinDbg debugger to the process that hosts the service that you want to debug.  </p>
<p>Note ProcessID is a placeholder for the process ID of the process that hosts the service that you want to debug.  </p>
<p>Use the image name of the process that hosts the service that you want to debug</p>
<p>You can use this method only if there is exactly one running instance of the process that hosts the service that you want to run. To do this, follow these steps:<br />
1 Click Start, and then click Run. The Run dialog box appears.<br />
2 In the Open box, type cmd, and then click OK to open a command prompt.<br />
3 At the command prompt, change the directory path to reflect the location of the windbg.exe file on your computer.  </p>
<p> Note The windbg.exe file is typically located in the following directory: C:\Program Files\Debugging Tools for Windows.  </p>
<p>4. At the command prompt, type windbg –pn ImageName to attach the WinDbg debugger to the process that hosts the service that you want to debug.  </p>
<p> NoteImageName is a placeholder for the image name of the process that hosts the service that you want to debug. The &#8220;-pn&#8221; command-line option specifies that the ImageName command-line argument is the image name of a process.<br />
back to the top<br />
Start the WinDbg debugger and attach to the process that hosts the service that you want to debug</p>
<p>1 Start Windows Explorer.<br />
2 Locate the windbg.exe file on your computer.  </p>
<p> Note The windbg.exe file is typically located in the following directory: C:\Program Files\Debugging Tools for Windows<br />
3 Run the windbg.exe file to start the WinDbg debugger.<br />
4 On the File menu, click Attach to a Process to display the Attach to Process dialog box.<br />
5 Click to select the node that corresponds to the process that hosts the service that you want to debug, and then click OK.<br />
6 In the dialog box that appears, click Yes to save base workspace information. Notice that you can now debug the disassembled code of your service.<br />
Configure a service to start with the WinDbg debugger attached   </p>
<p>You can use this method to debug services if you want to troubleshoot service-startup-related problems.<br />
1 Configure the &#8220;Image File Execution&#8221; options. To do this, use one of the following methods:<br />
 • Method 1: Use the Global Flags Editor (gflags.exe)<br />
  a. Start Windows Explorer.<br />
  b. Locate the gflags.exe file on your computer.</p>
<p>Note The gflags.exe file is typically located in the following directory: C:\Program Files\Debugging Tools for Windows.<br />
  c. Run the gflags.exe file to start the Global Flags Editor.<br />
  d. In the Image File Name text box, type the image name of the process that hosts the service that you want to debug. For example, if you want to debug a service that is hosted by a process that has MyService.exe as the image name, type MyService.exe.<br />
  e. Under Destination, click to select the Image File Options option.<br />
  f. Under Image Debugger Options, click to select the Debugger check box.<br />
  g. In the Debugger text box, type the full path of the debugger that you want to use. For example, if you want to use the WinDbg debugger to debug a service, you can type a full path that is similar to the following: C:\Program Files\Debugging Tools for Windows\windbg.exe<br />
  h. Click Apply, and then click OK to quit the Global Flags Editor.<br />
 • Method 2: Use Registry Editor<br />
  a. Click Start, and then click Run. The Run dialog box appears.<br />
  b. In the Open box, type regedit, and then click OK to start Registry Editor.<br />
  c. Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.</p>
<p>   In Registry Editor, locate, and then right-click the following registry subkey:<br />
   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options<br />
  d. Point to New, and then click Key. In the left pane of Registry Editor, notice that New Key #1 (the name of a new registry subkey) is selected for editing.<br />
  e. Type ImageName to replace New Key #1, and then press ENTER.</p>
<p>   Note ImageName is a placeholder for the image name of the process that hosts the service that you want to debug. For example, if you want to debug a service that is hosted by a process that has MyService.exe as the image name, type MyService.exe.<br />
  f. Right-click the registry subkey that you created in step e.<br />
  g. Point to New, and then click String Value. In the right pane of Registry Editor, notice that New Value #1, the name of a new registry entry, is selected for editing.<br />
  h. Replace New Value #1 with Debugger, and then press ENTER.<br />
  i. Right-click the Debugger registry entry that you created in step h, and then click Modify. The Edit String dialog box appears.<br />
  j. In the Value data text box, type DebuggerPath, and then click OK.</p>
<p>   Note DebuggerPath is a placeholder for the full path of the debugger that you want to use. For example, if you want to use the WinDbg debugger to debug a service, you can type a full path that is similar to the following: C:\Program Files\Debugging Tools for Windows\windbg.exe<br />
2 For the debugger window to appear on your desktop, and to interact with the debugger, make your service interactive. If you do not make your service interactive, the debugger will start but you cannot see it and you cannot issue commands. To make your service interactive, use one of the following methods:<br />
 • Method 1: Use the Services console<br />
  a. Click Start, and then point to Programs.<br />
  b. On the Programs menu, point to Administrative Tools, and then click Services. The Services console appears.<br />
  c. In the right pane of the Services console, right-click ServiceName, and then click Properties.</p>
<p>   Note ServiceName is a placeholder for the name of the service that you want to debug.<br />
  d. On the Log On tab, click to select the Allow service to interact with desktop check box under Local System account, and then click OK.<br />
 • Method 2: Use Registry Editor<br />
  a. In Registry Editor, locate, and then click the following registry subkey:<br />
   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceName<br />
   Note Replace ServiceName with the name of the service that you want to debug. For example, if you want to debug a service named MyService, locate and then click the following registry key:<br />
   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService<br />
  b. Under the Name field in the right pane of Registry Editor, right-click Type, and then click Modify. The Edit DWORD Value dialog box appears.<br />
  c. Change the text in the Value data text box to the result of the binary OR operation with the binary value of the current text and the binary value, 0&#215;00000100, as the two operands. The binary value, 0&#215;00000100, corresponds to the SERVICE_INTERACTIVE_PROCESS constant that is defined in the WinNT.h header file on your computer. This constant specifies that a service is interactive in nature.<br />
3 When a service starts, the service communicates to the Service Control Manager how long the service must have to start (the time-out period for the service). If the Service Control Manager does not receive a &#8220;service started&#8221; notice from the service within this time-out period, the Service Control Manager terminates the process that hosts the service. This time-out period is typically less than 30 seconds. If you do not adjust this time-out period, the Service Control Manager ends the process and the attached debugger while you are trying to debug. To adjust this time-out period, follow these steps:<br />
 a. In Registry Editor, locate, and then right-click the following registry subkey:<br />
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control<br />
 b. Point to New, and then click DWORD Value. In the right pane of Registry Editor, notice that New Value #1 (the name of a new registry entry) is selected for editing.<br />
 c. Type ServicesPipeTimeout to replace New Value #1, and then press ENTER.<br />
 d. Right-click the ServicesPipeTimeout registry entry that you created in step c, and then click Modify. The Edit DWORD Value dialog box appears.<br />
 e. In the Value data text box, type TimeoutPeriod, and then click OK </p>
<p>  Note TimeoutPeriod is a placeholder for the value of the time-out period (in milliseconds) that you want to set for the service. For example, if you want to set the time-out period to 24 hours (86400000 milliseconds), type 86400000.<br />
 f. Restart the computer. You must restart the computer for Service Control Manager to apply this change.<br />
4 Start your Windows service. To do this, follow these steps:<br />
 a. Click Start, and then point to Programs.<br />
 b. On the Programs menu, point to Administrative Tools, and then click Services. The Services console appears.<br />
 c. In the right pane of the Services console, right-click ServiceName, and then click Start. </p>
<p>  Note ServiceName is a placeholder for the name of the service that you want to debug. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/web-services-interview-questions2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web Services Interview Questions1</title>
		<link>http://www.technicalinterview.info/web-services-interview-questions1/</link>
		<comments>http://www.technicalinterview.info/web-services-interview-questions1/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 08:27:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Web Services Interview Questions1]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/?p=2274</guid>
		<description><![CDATA[What does AspCompat=&#8221;true&#8221; mean and when should I use it?
AspCompat is an aid in migrating ASP pages to ASPX pages. It defaults to false but should be set to true in any ASPX file that creates apartment-threaded COM objects&#8211;that is, COM objects registered ThreadingModel=Apartment. That includes all COM objects written with  Visual Basic 6.0. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What does AspCompat=&#8221;true&#8221; mean and when should I use it?</strong></p>
<p>AspCompat is an aid in migrating ASP pages to ASPX pages. It defaults to false but should be set to true in any ASPX file that creates apartment-threaded COM objects&#8211;that is, COM objects registered ThreadingModel=Apartment. That includes all COM objects written with  Visual Basic 6.0. AspCompat should also be set to true (regardless of threading  model) if the page creates COM objects that access intrinsic ASP objects such as Request and Response. The following directive sets AspCompat to true:<br />
         <%@ Page AspCompat="true" %>  </p>
<p>Setting AspCompat to true does two things. First, it makes intrinsic ASP objects available to the COM components by placing unmanaged wrappers around the equivalent ASP.NET objects. Second, it improves the performance of calls that the page places to apartment- threaded COM objects by ensuring that the page (actually, the thread that processes the  request for the page) and the COM objects it creates share an apartment. AspCompat=&#8221;true&#8221; forces ASP.NET request threads into single-threaded apartments (STAs). If those threads create COM objects marked ThreadingModel=Apartment, then the objects are created in the same STAs as the threads that created them. Without AspCompat=&#8221;true,&#8221; request threads run in a multithreaded apartment (MTA) and each call to an STA-based COM object incurs a performance hit when it&#8217;s  marshaled across apartment boundaries.<br />
Do not set AspCompat to true if your page uses no COM objects or if it uses COM objects that don&#8217;t access ASP intrinsic objects and that are registered ThreadingModel=Free or  ThreadingModel=Both.</p>
<p><strong>Can two different programming languages be mixed in a single ASMX file? </strong><br />
No.  </p>
<p><strong>What namespaces are imported by default in ASMX files? </strong></p>
<p>The following namespaces are imported by default. Other namespaces must be imported manually.• System, System.Collections,System.ComponentModel,System.Data, System.Diagnostics,System.Web,System.Web.Services  </p>
<p><strong>How do I provide information to the Web Service when the information is required as a SOAP Header? </strong></p>
<p>The key here is the Web Service proxy you created using wsdl.exe or through Visual Studio .NET&#8217;s Add Web Reference menu option. If you happen to download a WSDL file for a Web Service that requires a SOAP header, .NET will create a SoapHeader class in the proxy source file. Using the previous example:<br />
      public class Service1 : System.Web.Services.Protocols.SoapHttpClientProtocol<br />
        {<br />
            public AuthToken AuthTokenValue;        </p>
<p>        [System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.org/", IsNullable=false)]<br />
            public class AuthToken : SoapHeader {        public string Token;    }}   </p>
<p>In this case, when you create an instance of the proxy in your main application file, you&#8217;ll also create an instance of the AuthToken class and assign the string:<br />
     Service1 objSvc = new Service1();<br />
     processingobjSvc.AuthTokenValue = new AuthToken();<br />
     objSvc.AuthTokenValue.Token = <ACTUAL token value>;<br />
     Web Servicestring strResult = objSvc.MyBillableWebMethod();   </p>
<p><strong>What is WSDL?</strong></p>
<p>WSDL is the Web Service Description Language, and it is implemented as a specific XML vocabulary. While it&#8217;s very much more complex than what can be described here, there are two important aspects to WSDL with which you should be aware. First, WSDL provides instructions to consumers of Web Services to describe the layout and contents of the SOAP packets  the Web Service intends to issue. It&#8217;s an interface description document, of sorts. And second, it isn&#8217;t intended that you  read and interpret the WSDL. Rather, WSDL should be processed by machine, typically to generate proxy source code (.NET) or create dynamic proxies on the fly (the SOAP Toolkit or Web Service Behavior).  </p>
<p><strong>What is a Windows Service and how does its lifecycle differ from a &#8220;standard&#8221; EXE?</strong></p>
<p>Windows service is a application that runs in the background. It is equivalent to a NT service.<br />
The executable created is not a Windows application, and hence you can&#8217;t just click and run it . it needs to be installed as a service, VB.Net has a facility where we can add an installer to our program and then use a utility to install the service. Where as this is not the case with standard exe</p>
<p><strong>How can a win service developed in .NET be installed or used in Win98?</strong></p>
<p>Windows service cannot be installed on Win9x machines even though the .NET framework runs on machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/web-services-interview-questions1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web Services Interview Question</title>
		<link>http://www.technicalinterview.info/web-services-interview-question/</link>
		<comments>http://www.technicalinterview.info/web-services-interview-question/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 08:25:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Web Services Interview Question]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/?p=2273</guid>
		<description><![CDATA[Can you give an example of when it would be appropriate to use a web service as opposed to non-serviced .NET component
Web service is one of main component in Service Oriented Architecture. You could use web services when your clients and servers are running on different networks and also different platforms. This provides a loosely [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Can you give an example of when it would be appropriate to use a web service as opposed to non-serviced .NET component</strong><br />
Web service is one of main component in Service Oriented Architecture. You could use web services when your clients and servers are running on different networks and also different platforms. This provides a loosely coupled system. And also if the client is behind the firewall it would be easy to use web service since it runs on port 80 (by default) instead of having some thing else in Service Oriented Architecture applications.</p>
<p><strong>What is the standard you use to wrap up a call to a Web service</strong><br />
&#8220;SOAP&#8221;</p>
<p><strong>What is the transport protocol you use to call a Web service SOAP</strong><br />
HTTP with SOAP</p>
<p><strong>What does WSDL stand for? </strong><br />
&#8220;WSDL stands for Web Services Dsescription Langauge. There is WSDL.exe that creates a .wsdl Files which defines how an XML Web service behaves and instructs clients as to how to interact with the service. eg: wsdl http://LocalHost/WebServiceName.asmx&#8221;</p>
<p><strong>Where on the Internet would you look for Web Services?</strong><br />
www.uddi.org</p>
<p><strong>What does WSDL stand for? </strong><br />
Web Services Description Language</p>
<p><strong>True or False: To test a Web service you must create a windows application or Web application to consume this service?</strong><br />
False.</p>
<p><strong>What are the various ways of accessing a web service?</strong><br />
<strong>1. Asynchronous Call</strong><br />
  Application can make a call to the Web service and then continue to-do whatever it wants to do. When the service is ready it will notify the application. Application can use BEGIN and END method to make asynchronous call to the webmethod.We can use either a Wait Handle or a Delegate object when making asynchronous call.<br />
The Wait Handle class share resources between several objects. It provides several methods which will wait for the resources to become available<br />
The easiest and most powerful way to implement an asynchronous call is using a delegate object. A delegate object wraps up a callback function. The idea is to pass a method in the invocation of the web method. When the web method has finished it will call this callback function to process the result</p>
<p><strong>2. Synchronous Call</strong><br />
Application has to wait until execution has completed. </p>
<p><strong>What are VSDISCO files?</strong><br />
VSDISCO files are DISCO files that support dynamic discovery of Web services. If you place the following VSDISCO file in a directory on your Web server, for example, it returns   references to all ASMX and DISCO files in the host directory and any subdirectories not noted in <EXCLUDE>elements:</p>
<p>                <DYNAMICDISCOVERY<br />
                  xmlns="urn:schemas-dynamicdiscovery:disco.2000-03-17"><br />
                  <EXCLUDE path="_vti_cnf" /><br />
                  <EXCLUDE path="_vti_pvt" /><br />
                  <EXCLUDE path="_vti_log" /><br />
                  <EXCLUDE path="_vti_script" /><br />
                  <EXCLUDE path="_vti_txt" /><br />
                </DYNAMICDISCOVERY>   </p>
<p><strong>How does dynamic discovery work?</strong><br />
ASP.NET maps the file name extension VSDISCO to an HTTP handler that scans the host  directory and subdirectories for ASMX and DISCO files and returns a dynamically generated DISCO document. A client who requests a VSDISCO file gets back what appears to be a static DISCO document.</p>
<p>Note that VSDISCO files are disabled in the release version of ASP.NET. You can reenable them by uncommenting the line   in the <HTTPHANDLERS>section of Machine.config that maps *.vsdisco to System.Web.Services.Discovery.DiscoveryRequestHandler and granting the ASPNET  user account permission to read the IIS metabase. However, Microsoft is actively discouraging the use of VSDISCO files because they could represent a threat to Web server security.</p>
<p><strong>Is it possible to prevent a browser from caching an ASPX page?</strong><br />
Just call SetNoStore on the HttpCachePolicy object exposed through the Response object&#8217;s Cache property, as demonstrated here:</p>
<p>        <%@ Page Language="C#" %>    </p>
<p>            <%<br />
              Response.Cache.SetNoStore ();<br />
              Response.Write (DateTime.Now.ToLongTimeString ());<br />
            %>    </p>
<p>SetNoStore works by returning a Cache-Control: private, no-store header in the HTTP response. In this example, it prevents caching of a Web page that shows the current time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/web-services-interview-question/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Win Forms Frequently Asked Questions</title>
		<link>http://www.technicalinterview.info/win-forms-frequently-asked-questions/</link>
		<comments>http://www.technicalinterview.info/win-forms-frequently-asked-questions/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 07:39:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Win Forms Frequently Asked Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/?p=2272</guid>
		<description><![CDATA[What base class do all Web Forms inherit from? 
System.Windows.Forms.Form
What is the difference between Debug.Write and Trace.Write? When should each be used? 
The Debug.Write call won&#8217;t be compiled when the DEBUGsymbol is not defined (when doing a release build). Trace.Write calls will be compiled. Debug.Write is for information you want only in debug builds, Trace.Write [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What base class do all Web Forms inherit from? </strong><br />
System.Windows.Forms.Form</p>
<p><strong>What is the difference between Debug.Write and Trace.Write? When should each be used? </strong><br />
The Debug.Write call won&#8217;t be compiled when the DEBUGsymbol is not defined (when doing a release build). Trace.Write calls will be compiled. Debug.Write is for information you want only in debug builds, Trace.Write is for when you want it in release build as well.</p>
<p><strong>Difference between Anchor and Dock Properties?</strong><br />
Dock Property->Gets or sets which edge of the parent container a control is docked to. A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container. For example, if you set this property to DockStyle.Left, the left edge of the<br />
control will be docked to the left edge of its parent control. Additionally, the docked edge of  the control is resized to match that of its container<br />
control.<br />
Anchor Property->Gets or sets which edges of the control are anchored to the edges of its container.  A control can be anchored to one or more edges of its parent container. Anchoring a control to its parent ensures that the anchored edges remain in the same position relative to the edges of the parent container when the parent container is resized.</p>
<p><strong>When would you use ErrorProvider control?</strong><br />
ErrorProvider control is used in Windows Forms application. It is like Validation Control for ASP.NET pages. ErrorProvider control is used to provide validations in Windows forms and display user friendly messages to the user if the validation fails.<br />
 E.g<br />
 If we went to validate the textBox1 should be empty, then we can validate as below<br />
 1). You need to place the errorprovide control on the form<br />
 private void textBox1_Validating (object sender, System.ComponentModel.CancelEventArgs e)<br />
{<br />
ValidateName();<br />
}<br />
Private bool ValidateName()<br />
{<br />
bool bStatus = true;<br />
if (textBox1.Text == &#8220;&#8221;)<br />
{<br />
errorProvider1.SetError (textBox1,&#8221;Please enter your Name&#8221;);<br />
bStatus = false;<br />
}<br />
else<br />
errorProvider1.SetError (textBox1,&#8221;");<br />
return bStatus;<br />
}<br />
 it check the textBox1 is empty . If it is empty, then a message Please enter your name is displayed.</p>
<p><strong>Can you write a class without specifying namespace? Which namespace does it belong to by default?</strong><br />
Yes, you can, and then the class belongs to global namespace which has no name. For commercial products, naturally, you wouldn’t want global namespace. </p>
<p><strong>You are designing a GUI application with windows and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What&#8217;s the problem?</strong><br />
One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at the same location when resized. </p>
<p><strong>How can you save the desired properties of Windows Forms application? </strong><br />
.config files in .NET are supported through the API to allow storing and retrieving information. They are nothing more than simple XML files, sort of like what .ini files were before for Win32 apps. </p>
<p><strong>So how do you retrieve the customized properties of a .NET application from XML .config file? </strong><br />
Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable. </p>
<p><strong>Can you automate this process? </strong><br />
In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval. </p>
<p><strong>My progress bar freezes up and dialog window shows blank, when an intensive background process takes over.</strong><br />
Yes, you should&#8217;ve multi-threaded your GUI, with taskbar and main form being one thread, and the background process being the other. </p>
<p><strong>What&#8217;s the safest way to deploy a Windows Forms app?</strong><br />
Web deployment: the user always downloads the latest version of the code, the program runs within security sandbox, properly written app will not require additional security privileges. </p>
<p><strong>Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio?</strong><br />
The designers will likely through it away, most of the code inside InitializeComponent is auto-generated. </p>
<p><strong>What&#8217;s the difference between WindowsDefaultLocation and WindowsDefaultBounds?</strong><br />
WindowsDefaultLocation tells the form to start up at a location selected by OS, but with internally specified size. WindowsDefaultBounds delegates both size and starting position choices to the OS. </p>
<p><strong>What&#8217;s the difference between Move and LocationChanged? Resize and SizeChanged? </strong><br />
Both methods do the same, Move and Resize are the names adopted from VB to ease migration to C#. </p>
<p><strong>How would you create a non-rectangular window, let&#8217;s say an ellipse? </strong><br />
Create a rectangular form, set the TransparencyKey property to the same value as BackColor, which will effectively make the background of the form transparent. Then set the FormBorderStyle to FormBorderStyle.None, which will remove the contour and contents of the form. </p>
<p><strong>How do you create a separator in the Menu Designer? </strong><br />
A hyphen &#8216;-&#8217; would do it. Also, an ampersand &#8216;&#038;\&#8217; would underline the next letter. </p>
<p><strong>How&#8217;s anchoring different from docking? </strong><br />
Anchoring treats the component as having the absolute size and adjusts its location relative to the parent form. Docking treats the component location as absolute and disregards the component size. So if a status bar must always be at the bottom no matter what, use docking. If a button should be on the top right, but change its position with the form being resized, use anchoring. </p>
<p><strong>How do you trigger the Paint event in System.Drawing?</strong><br />
Invalidate the current form; the OS will take care of repainting. The Update method forces the repaint. </p>
<p><strong>With these events, why wouldn&#8217;t Microsoft combine Invalidate and Paint, so that you wouldn&#8217;t have to tell it to repaint, and then to force it to repaint?</strong><br />
Painting is the slowest thing the OS does, so usually telling it to repaint, but not forcing it allows for the process to take place in the background. </p>
<p><strong>How can you assign an RGB color to a System.Drawing.Color object?</strong><br />
Call the static method FromArgb of this class and pass it the RGB values. </p>
<p><strong>What class does Icon derive from? </strong><br />
Isn&#8217;t it just a Bitmap with a wrapper name around it? No, Icon lives in System.Drawing namespace. It&#8217;s not a Bitmap by default, and is treated separately by .NET. However, you can use ToBitmap method to get a valid Bitmap object from a valid Icon object. </p>
<p><strong>Before in my VB app I would just load the icons from DLL. How can I load the icons provided by .NET dynamically? </strong><br />
By using System.Drawing.SystemIcons class, for example System.Drawing.SystemIcons.Warning produces an Icon with a warning sign in it. </p>
<p><strong>When displaying fonts, what&#8217;s the difference between pixels, points and ems? </strong><br />
A pixel is the lowest-resolution dot the computer monitor supports. Its size depends on user&#8217;s settings and monitor size. A point is always 1/72 of an inch. An em is the number of pixels that it takes to display the letter M. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/win-forms-frequently-asked-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Best Interview Questions For Embedded Programmers</title>
		<link>http://www.technicalinterview.info/best-interview-questions-for-embedded-programmers/</link>
		<comments>http://www.technicalinterview.info/best-interview-questions-for-embedded-programmers/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 20:05:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Best Interview Questions For Embedded Programmers]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/?p=2271</guid>
		<description><![CDATA[1. What are static variables?
Variables that have only one copy per class are known as static variables. They are not attached to a particular instance of a class but rather belong to a class as a whole. They are declared by using the static keyword as a modifier. For example:
static type varIdentifier;
where, the name of [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. What are static variables?</strong></p>
<p>Variables that have only one copy per class are known as static variables. They are not attached to a particular instance of a class but rather belong to a class as a whole. They are declared by using the static keyword as a modifier. For example:</p>
<p>static type varIdentifier;</p>
<p>where, the name of the variable is varIdentifier and its data type is specified by type.</p>
<p>Static variables that are not explicitly initialized in the code are automatically initialized with a default value. The default value depends on the data type of the variables. The table given below shows the default values:</p>
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> &lt;!&#8211;  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&#8221;"; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&#8221;Times New Roman&#8221;; 	mso-fareast-font-family:&#8221;Times New Roman&#8221;;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} &#8211;&gt; <!--[if gte mso 10]><br />
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<p> <![endif]--></p>
<table class="MsoNormalTable" border="1" cellpadding="0">
<tbody>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">Data Type</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">Initial Value</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">boolean</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">false</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">byte</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">0</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">short</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">0</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">int</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">0</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">long</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">0L</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">char</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">&#8216;u0000&#8242;</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">float</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">0.0F</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">double</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">0.0D</p>
</td>
</tr>
<tr>
<td style="padding: 0.75pt;">
<p class="MsoNormal">Object reference</p>
</td>
<td style="padding: 0.75pt;">
<p class="MsoNormal">null</p>
</td>
</tr>
</tbody>
</table>
<p><strong>2. What are volatile variables?</strong></p>
<p>A volatile variable is modified asynchronously by concurrently running threads in a Java application.It is not allowed to have a local copy of a variable that is different from the value currently held in &#8220;main&#8221; memory. Effectively, a variable declared volatile must have it&#8217;s data synchronized across all threads, so that whenever you access or update the variable in any thread, all other threads immediately see the same value. Of course, it is likely that volatile variables have a higher access and update overhead than &#8220;plain&#8221; variables, since the reason threads can have their own copy of data is for better efficiency.</p>
<p><strong>3. What do you mean by const keyword?</strong><br />
<strong>4. What is interrupt latency?</strong></p>
<p>Interrupt latency is the time between the generation of an interrupt by a device and the servicing of the device which generated the interrupt. For many operating systems, devices are serviced as soon as the device&#8217;s interrupt handler is executed. Interrupt latency may be affected by interrupt controllers, interrupt masking, and the operating system&#8217;s (OS) interrupt handling methods.</p>
<p><strong>5. How you can optimize it?</strong><br />
<strong>6. What is size of character, integer, integer pointer, character pointer?</strong><br />
<strong>7. What is NULL pointer and what is its use?</strong></p>
<p>A null pointer has a reserved value, often but not necessarily the value zero, indicating that it refers to no object. Null pointers are used routinely, particularly in C and C++ where the compile-time constant NULL is used, to represent conditions such as the lack of a successor to the last element of a linked list, while maintaining a consistent structure for the list nodes.</p>
<p><strong>8. What is void pointer and what is its use?</strong></p>
<p>A special pointer type called the “void pointer” points to an object of unspecified type and cannot be dereferenced. The address can be directly manipulated by casting a pointer to and from an integral type of sufficient size.</p>
<p><strong>9. What is ISR?</strong></p>
<p>Integrated Services Routers (ISRs) are Cisco router product series that integrates many functions into a single device. An example of such devices is a device that acts as both router and switch, and provides other functions as well.</p>
<p><strong>10. What is return type of ISR?</strong></p>
<p>Void</p>
<p><strong>11. Can we use any function inside ISR?</strong><br />
<strong>12. Can we use printf inside ISR?</strong></p>
<p>No we cannot use printf() in ISR because ISRs’ are a part of kernel and kernel is not linked with libaray provided by C,so when we use printf() in ISR it should generate a linkage error.</p>
<p><strong>13. Can we put breakpoint inside ISR?</strong><br />
<strong>14. How to decide whether given processor is using little endian format or big endian format?</strong><br />
<strong>15. What is Top half &#038; bottom half of a kernel?</strong><br />
<strong>16. Difference between RISC and CISC processor.</strong><br />
RISC is designed with the philosophy that simplicity means fast, disregard the esoteric and combinatory cases.</p>
<p>CISC is designed in mind that if a procedure being designed into the CPU it would be faster compare to if it was written as software code.</p>
<p><strong>17. What is RTOS?</strong></p>
<p>A real-time operating system (RTOS) is an operating system that guarantees a certain capability within a specified time constraint. For example, an operating system might be designed to ensure that a certain object was available for a robot on an assembly line. In what is usually called a &#8220;hard&#8221; real-time operating system, if the calculation could not be performed for making the object available at the designated time, the operating system would terminate with a failure. In a &#8220;soft&#8221; real-time operating system, the assembly line would continue to function but the production output might be lower as objects failed to appear at their designated time, causing the robot to be temporarily unproductive. Some real-time operating systems are created for a special application and others are more general purpose. Some existing general purpose operating systems claim to be a real-time operating systems. To some extent, almost any general purpose operating system such as Microsoft&#8217;s Windows 2000 or IBM&#8217;s OS/390 can be evaluated for its real-time operating system qualities. That is, even if an operating system doesn&#8217;t qualify, it may have characteristics that enable it to be considered as a solution to a particular real-time application problem.</p>
<p>In general, real-time operating systems are said to require:</p>
<p>    * multitasking<br />
    * Process threads that can be prioritized<br />
    * A sufficient number of interrupt levels</p>
<p>Real-time operating systems are often required in small embedded operating systems that are packaged as part of micro devices. Some kernels can be considered to meet the requirements of a real-time operating system. However, since other components, such as device drivers, are also usually needed for a particular solution, a real-time operating system is usually larger than just the kernel.</p>
<p><strong>18. What is the difference between hard real-time and soft real-time OS?</strong></p>
<p>A hard real time system guarantees that critical tasks complete on time this goal requires that all delays in the system be bounded from the retrieval of the stored data to the time that it takes the o.s to finish any request made of it.<br />
A soft real time system where a critical real time task gets priority over other tasks and retains that priority until it completes.As in hard real time system kernel delays need to be bounded.</p>
<p><strong>19. What type of scheduling is there in RTOS?</strong><br />
In typical designs, a task has three states: 1) running, 2) ready, 3) blocked. Most tasks are blocked, most of the time. Only one task per CPU is running. In simpler systems, the ready list is usually short, two or three tasks at most.<br />
The real key is designing the scheduler. Usually the data structure of the ready list in the scheduler is designed to minimize the worst-case length of time spent in the scheduler&#8217;s critical section, during which preemption is inhibited, and, in some cases, all interrupts are disabled. But, the choice of data structure depends also on the maximum number of tasks that can be on the ready list.</p>
<p><strong>20. What is priority inversion?</strong></p>
<p>Priority inversion is a situation where in lower priority tasks will run blocking higher priority tasks waiting for resource (mutex). For ex: consider 3 tasks. A, B and C, A being highest priority task and C is lowest. Look at sequence of context swaps </p>
<p>A goes for I/O . unlocks mutex.<br />
C was ready to run. So C starts running. locks mutex<br />
B is ready to run. Swaps out C and takes mutex.<br />
A is ready to run. but A is blocked as mutex is locked by B. but B will never relinqishes the mutex as its higher priority than C.</p>
<p>The solution to priority inversion is Priority inheritance.</p>
<p><strong>21. What is priority inheritance?</strong></p>
<p>Priority inheritance is a method for eliminating priority inversion problems. Using this programming method, a process scheduling algorithm will increase the priority of a process to the maximum priority of any process waiting for any resource on which the process has a resource lock.<br />
The basic idea of the priority inheritance protocol is that when a job blocks one or more high priority jobs, it ignores its original priority assignment and executes its critical section at the highest priority level of all the jobs it blocks. After executing its critical section, the job returns to its original priority level.</p>
<p><strong>22. How many types of IPC mechanism you know?</strong></p>
<p><strong>Local</strong><br />
Local IPC is for communication among process on a single machine. Local IPC is useful for data sharing, signaling, and synchronization.<br />
Mutexes, semaphores, and events can be named, or unnamed (identified by handle) and can be protected by NT permissions.</p>
<p><strong>Atoms</strong><br />
Atoms are globally available strings or integer values identified by a handle. Atoms were typically used for DDE. The global atom table is also limited to 37 strings total. I do not recommend the use of atoms as they seem to be outdated. Instead, other more up to date IPC mechanisms should be used.</p>
<p><strong>Shared Memory</strong><br />
Shared memory is a block o f memory which multiple processes can access. Under Win16 all memory was accessible by any process so pointers could be just passed between processes. Win32 has memory protection mechanisms, and a processes memory is virtually mapped to that process. Win32 however can map a block of memory into multiple processes virtual memory spaces. Even though the shared block of memory may appear to be at different locations to each process, each will point to the same physical location in memory. In addition, this mechanism allows you to control which processes have access to shared memory blocks. Win32 can also map a disk file into virtual memory. Because of this, when shared memory is used, it is called a memory mapped file.<br />
Win32 also does this to the code segment of executables. When multiple instances of an executable are loaded, only one copy of the code is loaded into physical memory, while it is mapped into multiple virtual spaces.</p>
<p><strong>Mutexes</strong><br />
A mutex (Mutual Exclusion) is an object which can be owned, but only owned by a single thread at a time. Any other thread trying to gain ownership, will be blocked and queued in order of requests. Mutexes are used to control exclusive access to any global object, or non reentrant code. Mutexes can be used to control access to shared memory, hardware, or other single access items.</p>
<p><strong>Semaphores</strong><br />
A semaphore is like a mutex, except that a specified number of threads can own a specific semaphore at one time. When the semaphore is created, this number is specified. Semaphores are typically used to limit access to resources. An example of this might be to prevent &#8220;thrashing&#8221; of a resource by setting the maximum number of threads which can concurrently access the object.</p>
<p><strong>Critical Sections</strong><br />
Critical sections are similar to mutexes, however mutexes differ from critical sections in that they can be accessed across processes and threads, while a critical section, can only be access across threads from within the same process. Critical sections are also lighter weight, cannot be named, or have security attributes assigned to them.</p>
<p><strong>Events</strong><br />
An event is an object which threads can wait for to be triggered. Any free thread may then trigger the event, which will then release the other waiting threads. An event can be used to hold threads from accessing something that has not been initialized or ready yet. They can also be used to signal that input is available, or a device is ready to accept more data.</p>
<p><strong>Messages</strong><br />
Messages can be used to send a one way queued instructions/status to a single thread. You can send messages to an existing windows message queue, and filter them as they come in, or create your own queue within a secondary thread. Messages are good for non time critical communications, or to serialize handling. Messages can contain only a limited amount of data however. Each message can contain only one 16 bit integer, and one 32 bit integer. When communicating between threads, pointers may be passed in the 32 bit parameter. However when communicating between processes pointers may not be passed, even when the pointer identifies shared memory as each process may see the shared memory at a different location in it s virtual space. Object handles (Mutexes, semaphores, events) cannot be passed in the message data, however such handles can be duplicated, and the duplicated handles may be passed via the message data. (See DuplicateHandle)</p>
<p><strong>DDE</strong><br />
DDE (Dynamic Data Exchange) was the common way to externally control applications in the 16 bit world. DDE is still used occasionally, however it has been strategically replaced by COM. You should use Com instead of DDE, unless the application you need to communicate with only understands DDE. DDE also tends to be slow, and the built in DDE in Delphi/C++ Builder is &#8220;less than perfect&#8221;.</p>
<p><strong>Clipboard</strong><br />
The clipboard can also be used for IPC, however in most situations it is not advisable as it is a global resource.</p>
<p><strong>OLE/Com</strong><br />
OLE (Object Linking &#038; Embedding) has evolved into COM (Component Object Model). COM allows you to do many things. With COM you can create language independent objects, expose interfaces from applications to allow external control, and much more. COM allows you to expose interfaces. An interface is a defined set of methods and properties which allow you to proxy calls to any code or object that you wish. An interface is like a contract. Any time that the interface is implemented, all of it s members must be implemented.</p>
<p><strong>Network</strong><br />
Network IPC is for communication between processes on different machines.</p>
<p><strong>Network Protocols</strong><br />
Network protocols allow you the most flexibility, however they bind you to a single protocol, and require a lot of extra programming. Most times you do not need this flexibility and it is better to use a higher level protocol. Network protocols are also lighter weight.<br />
Some common protocols used for network communication are IPX/SPX (Novell), NetBEUI (Microsoft), and TCP/IP (Internet).<br />
NetBios is also a protocol, but it is a slightly higher protocol than the others. It abstracts some of the features of the other network protocols while still providing you with most of their advantages. NetBios s main feature is that is does not bin you to a particular protocol which your network configuration and/or hardware may dictate. NetBios commonly runs on top of NetBEUI or TCP/IP.<br />
If you do decide you need to work at the network protocol level, TCP/IP is probably your best bet. It is very flexible, in widespread use (The internet runs on it), works with any operating system, has tons of existing services, and has become the de facto standard.</p>
<p><strong>Mailslots</strong><br />
Mailslots are like messages except that they can be sent across a network. Mailslots also differ from messages in that they are not arbitrarily limited in the amount of data they can contain, and mailslots can be broadcast to a group of receivers. Mailslots however are sent as datagrams, and therefore are not guaranteed to arrive at their destination. Mailslots are similar to TCP/IP s UDP mechanism, but at a slightly higher level. If delivery must be guaranteed, another method should be used.</p>
<p><strong>Pipes</strong><br />
A pipe is a communication channel with two endpoints. Pipes are similar to TCP connections. Pipes however can be optionally named, and contain security attributes. Pipes can also be one or two way. Pipes are used both for network communication, and locally. For example, the console is a pipe. If you want to open a DOS session / command window, you can swap a pipe for it s standard in and standard out, thus giving your application full control of the window.</p>
<p><strong>RPC</strong><br />
RPC (Remote Procedure Calls) allow you to make function/procedure calls in which the code actually executes on another system. RPCs are typically used with older systems, mainframes, or for implementing distributed object systems.</p>
<p><strong>Distributed Objects</strong><br />
Distributed objects are used for communication among objects. These objects can be local or remote. This easily allows you to distribute your programs with complete abstraction of location. The two most common distributed object standards are DCom and Corba.<br />
Without distributed object systems, developers need to implement their own protocols and also decide upon and program for a network transport. In many cases they also tie their protocol to a specific language, and even a platform. Distributed object systems abstract the user from all this and provide a high level interface which is platform independent, language independent, and network protocol independent.</p>
<p><strong>DCom</strong><br />
DCom is just a distributed version of COM (Component Object Model). DCom is controlled by Microsoft and therefore is tied heavily to Win32 and other Microsoft technologies. The specification is available for other platforms, but is rarely used. For all intents and purposes, DCom is for WinTel only. DCom is also heavily tied to NT security. If you have lots of users that do not have NT accounts, this may pose a major headache for you. NT security can be bypassed by using the Midas socket server (I ve been told you do not need a Midas license to merely use this single component).</p>
<p><strong>Corba</strong><br />
Corba (Common Object Request Broker Architecture) is a platform independent distributed object protocol. Corba is also implemented by many vendors including Inprise/Visigenic. This allows you to choose your implementation. The Corba standard is controlled by the OMG (Object Management Group).</p>
<p><strong>23. What is semaphore?</strong></p>
<p>In simple terms a Semaphore is a unit or resource which is used for synchronization between two processes , it is kind of flag (in abstract terms) which every process will check before processing ahead to avoid the deadlock situation</p>
<p><strong>24. What is spin lock?</strong></p>
<p>A spin lock is a lock where the thread simply waits in a loop (&#8221;spins&#8221;) repeatedly checking until the lock becomes available. As the thread remains active but isn&#8217;t performing a useful task, the use of such a lock is a kind of busy waiting. Once acquired, spin locks will usually be held until they are explicitly released, although in some implementations they may be automatically released if the thread blocks, or &#8220;goes to sleep&#8221;.</p>
<p><strong>25. What is difference between binary semaphore and mutex?</strong></p>
<p>The differences are:<br />
1) Mutex can be used only for mutual exclusion, while binary can be used of mutual exclusion as well as synchronisation.<br />
2) Mutex can be given only by the task that took it.<br />
3) Mutex cannot be given from an ISR.<br />
4) Mutual-exclusion semaphores can be taken recursively. This means that the semaphore can be taken more than once by the task that holds it before finally being released.<br />
5) Mutex provides a options for making the task that took it as DELETE_SAFE. This means, that the task cannot be deleted when it holds mutex.</p>
<p><strong>26. What is virtual memory?</strong></p>
<p>Virtual memory is a common part of most operating systems on desktop computers. It has become so common because it provides a big benefit for users at a very low cost.</p>
<p>Most computers today have something like 64 or 128 megabytes of RAM (random-access memory) available for use by the CPU (central processing unit). Often, that amount of RAM is not enough to run all of the programs that most users expect to run at once. For example, if you load the Windows operating system, an e-mail program, a Web browser and word processor into RAM simultaneously, 64 megabytes is not enough to hold it all. If there were no such thing as virtual memory, your computer would have to say, &#8220;Sorry, you cannot load any more applications. Please close an application to load a new one.&#8221; With virtual memory, the computer can look for areas of RAM that have not been used recently and copy them onto the hard disk. This frees up space in RAM to load the new application. Because it does this automatically, you don&#8217;t even know it is happening, and it makes your computer feel like is has unlimited RAM space even though it has only 32 megabytes installed. Because hard-disk space is so much cheaper than RAM chips, virtual memory also provides a nice economic benefit.</p>
<p>The area of the hard disk that stores the RAM image is called a page file. It holds pages of RAM on the hard disk, and the operating system moves data back and forth between the page file and RAM. (On a Windows machine, page files have a .SWP extension.)</p>
<p>Of course, the read/write speed of a hard drive is much slower than RAM, and the technology of a hard drive is not geared toward accessing small pieces of data at a time. If your system has to rely too heavily on virtual memory, you will notice a significant performance drop. The key is to have enough RAM to handle everything you tend to work on simultaneously. Then, the only time you &#8220;feel&#8221; the slowness of virtual memory is in the slight pause that occurs when you change tasks. When you have enough RAM for your needs, virtual memory works beautifully. When you don&#8217;t, the operating system has to constantly swap information back and forth between RAM and the hard disk. This is called thrashing, and it can make your computer feel incredibly slow.</p>
<p><strong>27. What is kernel paging?</strong><br />
<strong>28. Can structures be passed to the functions by value?</strong></p>
<p>Yes structures can be passed to functions by value. Though it has two disadvatanges :</p>
<p>1) The chages by the calling function are not reflected<br />
2) Its slower than the pass by refrence funcion call.</p>
<p><strong>29. Why cannot arrays be passed by values to functions?</strong></p>
<p>When a array is passed to a function, the array is internally changed to a &#8216;pointer&#8217;. And pointers are always passed by reference. </p>
<p><strong>30. Advantages and disadvantages of using macro and inline functions?</strong></p>
<p>A macro is a constant that provides straight textual substitution where used, while an inline function is a procedure that is actually called each time. Macros do have a few advantages over inline functions, but the disadvantages are numerous. For example, type checking and argument validation is not performed in a macro, while they are in functions for the most part.</p>
<p>It is a matter that everyone should decide for themselves, but Bjarne Stroustrup, who created C++, advocates the use of inline functions over macros.<br />
Inline functions are an imperative feature of C++ and are frequently used with classes. These are no different from the normal functions except for the fact that they are never actually called. These functions are, as their name suggests, expanded in line at each point of invocation. All that needs to be done to enable or cause a function to expand at the point of invocation is to add the inline keyword before the function definition.</p>
<p><strong>31. What happens when recursion functions are declared inline?</strong></p>
<p>An inline function replaces the call to the function by the body of the function, thus reducing the overhead of saving the context in stack. This is good for functions which are small in size and called occasionally. A recursive function calls an instance of it and thus can be a deeply nested. In this case if we define the recursive function as inline, it would replace every call to itself with the body of function and thus eating up a lot of code space.</p>
<p><strong>32. #define cat(x,y) x##y concatenates x to y. But cat(cat(1,2),3) does not expand but gives preprocessor warning. Why?</strong></p>
<p>Macro expanding becomes illegal if done recursively</p>
<p>Or</p>
<p>in this case the cat(x,y) is the macro which is defined by using the preprocessor directive , this will be substituted only at the place where it is called in this example it happens like this</p>
<p>cat(1,2)##3 which will once again become 1##2##3<br />
here if we use ## in between we can join or concatenate only two variables that why it gives a preprocessor warning</p>
<p><strong>33. Can you have constant volatile variable? Yes, you can have a volatile pointer?</strong></p>
<p>You can have a constant pointer to a volatile variable but not a constant volatile variable.</p>
<p>Or</p>
<p>YES. We can have a const volatile variable.<br />
a volatile variable is a variable which can be changed by the extrenal events (like an interrput timers will increment the voltile varible. If you dont want you volatile varibale to be changed then declare them as “const volatile”.</p>
<p>Or</p>
<p>It is possible to have “const volatile” declaration. This indicates that the variable defined like this is not possible to change within that context. It can be changed by an external event. const declaraion just says that it will be readonly within the context, that area can be modified by an interrupt routine or another process.</p>
<p><strong>34. ++*ip increments what? it increments what ip points to</strong></p>
<p>I will explain this with an example:<br />
int a = 10;<br />
int *p = &#038;a;<br />
// suppose &#038;a = 4010 (address of a)<br />
Because both ++ and * are unary operators, the are calculated from right to left –> ++ (*p)<br />
++*p will inrement 4010 by 4 (int size) -> ++*p will have the value 4014.</p>
<p><strong>35. Operations involving unsigned and signed — unsigned will be converted to signed</strong></p>
<p>Macro expanding becomes illegal if done recursively</p>
<p><strong>36. Malloc (sizeof(0)) will return — valid pointer</strong></p>
<p>yes. sizeof(0) –> int size and it is 4</p>
<p><strong>37.main() {fork();fork();fork();printf(&#8221;hello world&#8221;); } — will print 8 times.</strong></p>
<p>It will print 8 times. Because, each fork will print twice.<br />
if u flush, (using “fflush”), then it will be printed only once. thats is you need to flush the iostreams.</p>
<p><strong>38. Array of pts to functions</strong> — void (*fptr[10])()</p>
<p><strong>39. Which way of writing infinite loops is more efficient than others? </strong></p>
<p>There are 3ways.</p>
<p><strong>40. Who to know whether system uses big endian or little endian format and how to convert among them?</strong><br />
<strong>41. What are forward reference w.r.t. pointers in c?</strong><br />
<strong>42. How is generic list manipulation function written which accepts elements of any kind?</strong><br />
<strong>43. What is the difference between embedded systems and the system in which RTOS is running?</strong><br />
<strong>44. How can you define a structure with bit field members?</strong></p>
<p>struct abc {<br />
unsigned int a:1;<br />
unisgned int b:2;<br />
};<br />
<strong><br />
45. How do you write a function which takes 2 arguments - a byte and a field in the byte and returns the value of the field in that byte?</strong><br />
<strong>46. Which parameters decide the size of data type for a processor?</strong><br />
<strong>47. What is job of preprocessor, compiler, assembler and linker?</strong><br />
<strong>48. What is the difference between static linking and dynamic linking?</strong><br />
<strong>49. How to implement a WD timer in software?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/best-interview-questions-for-embedded-programmers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sample Networking Informational Interview Questions</title>
		<link>http://www.technicalinterview.info/sample-networking-informational-interview-questions/</link>
		<comments>http://www.technicalinterview.info/sample-networking-informational-interview-questions/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 17:02:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Sample Networking Informational Interview Questions]]></category>

		<category><![CDATA[Networking Informational Interview Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/?p=2270</guid>
		<description><![CDATA[1. I have so many interests. How does one with a liberal arts education and diverse interests plan a career? What positions are good entry-level opportunities?
2. How will a liberal arts degree be an advantage in the world of work?
3. What are the benefits of a liberal arts degree in the short-term and long-term regarding [...]]]></description>
			<content:encoded><![CDATA[<p>1. I have so many interests. How does one with a liberal arts education and diverse interests plan a career? What positions are good entry-level opportunities?</p>
<p>2. How will a liberal arts degree be an advantage in the world of work?</p>
<p>3. What are the benefits of a liberal arts degree in the short-term and long-term regarding career choices and advancement?</p>
<p>4. How does one market a liberal arts degree to employers?</p>
<p>5. How did this type of work interest you and how did you get started?</p>
<p>6. How did you get your first job? What jobs and experiences have led you to your present position?</p>
<p>7. Can you suggest some ways a student could obtain necessary experience?</p>
<p>8. If you could do things all over again, would you choose the same path for yourself? Why? What<br />
would you change?</p>
<p>9. How has your job affected your lifestyle?</p>
<p>10. Would you recommend that I pursue a graduate degree?</p>
<p>11. Does your work relate to any experiences or studies you had in college?</p>
<p>12. How well did your college experience prepare you for your career?</p>
<p>13. What courses and experiences have proven to be the most valuable to you in your work? What would you recommend for me?</p>
<p>14. How important are grades/GPA for obtaining a job in this field?</p>
<p>15.How do you think my university’s reputation is viewed when it comes to hiring?</p>
<p>16. How do you think graduation from a liberal arts university is viewed when it comes to hiring?</p>
<p>17. How did you prepare for this work? If you were entering this career today, would you change your preparation in any way to facilitate entry?</p>
<p>18. What abilities or personal qualities do you believe contribute most to success in this field/job?</p>
<p>19. What are the typical entry-level job titles and functions? What entry level jobs are best for learning as much as possible?</p>
<p>20. Do you have any advice for someone interested in this field/job? Are there any written materials you suggest I read?</p>
<p>21. Which professional journals and organizations would help me learn more about this field?</p>
<p>22. What kinds of experience, paid or unpaid, would you encourage for anybody pursuing a career in this field?</p>
<p>23. What special advice do you have for a student seeking to qualify for this position?</p>
<p>24. What particular skills or talents are most essential to be effective in your job? How did you learn these skills? Did you enter this position through a formal training program? How can I evaluate whether or not I have the necessary skills for a position such as yours?</p>
<p>25. Do you have any special words of encouragement or warnings as a result of your experiences?</p>
<p>26. These are my strongest assets (skills, areas of knowledge, personality traits and<br />
values ) : ___________________________________ . Where would they fit in this field? Where would they be helpful in an organization? Where might they fit in other fields? Where might they be helpful in other organizations?</p>
<p>27. How would you assess the experience I’ve had so far in terms of entering this field?</p>
<p>28. Do you have any other networking advice for me?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/sample-networking-informational-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Classic Job Interview Questions</title>
		<link>http://www.technicalinterview.info/classic-job-interview-questions/</link>
		<comments>http://www.technicalinterview.info/classic-job-interview-questions/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 07:47:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Classic Job Interview Questions]]></category>

		<category><![CDATA[Typical Interview Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/?p=2269</guid>
		<description><![CDATA[There are many typical questions in interview that can trick you up but with the bit of preplanned you can learn to answer with confidence
Here are some Typical Interview Questions
1. What is your biggest weakness?
The braided question which is best handled by picking something you have made protest step to address. For Example
1. Pick something [...]]]></description>
			<content:encoded><![CDATA[<p>There are many typical questions in interview that can trick you up but with the bit of preplanned you can learn to answer with confidence</p>
<p>Here are some Typical Interview Questions</p>
<p><strong>1. What is your biggest weakness?</strong></p>
<p>The braided question which is best handled by picking something you have made protest step to address. For Example</p>
<p>1. Pick something you have regressed<br />
2. Use a recent example<br />
3. Weakness can be viewed as strength.</p>
<p>Note:<br />
Dont say that i dont have any weakness do answer this question and always answer this question</p>
<p><strong>2. Why should we hire you?</strong></p>
<p>Here we need follow some steps</p>
<p>1. First of all, check the job description<br />
2. I have a unique combination of strong technical skills and the ability to build long-term customer relationships.<br />
3. Give a good recent examples.<br />
4. Given the apportunity, i could bring this success to your company.</p>
<p><strong>3. Why do you want the job?</strong></p>
<p>1. Prepare the answer carefully. Give some good points.<br />
2. Do your homework on the company<br />
3. Match your goals to the company goals.</p>
<p><strong>4. Tell me about yourself?</strong><br />
This often asked for everyone who goes to company for an interview. So prepare well for this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/classic-job-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>30 Best Java Interview Questions</title>
		<link>http://www.technicalinterview.info/30-best-java-interview-questions/</link>
		<comments>http://www.technicalinterview.info/30-best-java-interview-questions/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 16:42:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[JAVA Interview Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/?p=2268</guid>
		<description><![CDATA[Q1. How could Java classes direct program messages to the system console, but error messages, say to a file?
A. The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Q1. How could Java classes direct program messages to the system console, but error messages, say to a file?</strong></p>
<p>A. The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed:<br />
Stream st = new Stream(new FileOutputStream(&#8221;output.txt&#8221;)); System.setErr(st); System.setOut(st);</p>
<p><strong>Q2. What&#8217;s the difference between an interface and an abstract class?</strong></p>
<p>A. An abstract class may contain code in method bodies, which is not allowed in an interface. With abstract classes, you have to inherit your class from it and Java does not allow multiple inheritance. On the other hand, you can implement multiple interfaces in your class.</p>
<p><strong>Q3. Why would you use a synchronized block vs. synchronized method?</strong><br />
A. Synchronized blocks place locks for shorter periods than synchronized methods.</p>
<p><strong>Q4. Explain the usage of the keyword transient?</strong></p>
<p>A. This keyword indicates that the value of this member variable does not have to be serialized with the object. When the class will be de-serialized, this variable will be initialized with a default value of its data type (i.e. zero for integers).</p>
<p><strong>Q5. How can you force garbage collection?</strong></p>
<p>A. You can&#8217;t force GC, but could request it by calling System.gc(). JVM does not guarantee that GC will be started immediately.</p>
<p><strong>Q6. How do you know if an explicit object casting is needed?</strong></p>
<p>A. If you assign a superclass object to a variable of a subclass&#8217;s data type, you need to do explicit casting. For example:<br />
Object a; Customer b; b = (Customer) a;<br />
When you assign a subclass to a variable having a supeclass type, the casting is performed automatically.</p>
<p><strong>Q7. What&#8217;s the difference between the methods sleep() and wait()</strong></p>
<p>A. The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.</p>
<p><strong>Q8. Can you write a Java class that could be used both as an applet as well as an application?</strong></p>
<p>A. Yes. Add a main() method to the applet.</p>
<p><strong>Q9. What&#8217;s the difference between constructors and other methods?</strong></p>
<p>A. Constructors must have the same name as the class and can not return a value. They are only called once while regular methods could be called many times.</p>
<p><strong>Q10. Can you call one constructor from another if a class has multiple constructors</strong><br />
A. Yes. Use this() syntax.</p>
<p><strong>Q11. Explain the usage of Java packages.</strong></p>
<p>A. This is a way to organize files when a project consists of multiple modules. It also helps resolve naming conflicts when different packages have classes with the same names. Packages access level also allows you to protect data from being used by the non-authorized classes.</p>
<p><strong>Q12. If a class is located in a package, what do you need to change in the OS environment to be able to use it?</strong></p>
<p>A. You need to add a directory or a jar file that contains the package directories to the CLASSPATH environment variable. Let&#8217;s say a class Employee belongs to a package<br />
com.xyz.hr; and is located in the file c:\dev\com\xyz\hr\Employee.java. In this case, you&#8217;d need to add c:\dev to the variable CLASSPATH. If this class contains the method main(), you could test it from a command prompt window as follows:<br />
c:\>java com.xyz.hr.Employee</p>
<p><strong>Q13. What&#8217;s the difference between J2SDK 1.5 and J2SDK 5.0?</strong></p>
<p>A.There&#8217;s no difference, Sun Microsystems just re-branded this version.</p>
<p><strong>Q14. What would you use to compare two String variables - the operator == or the method equals()?</strong></p>
<p>A. I&#8217;d use the method equals() to compare the values of the Strings and the == to check if two variables point at the same instance of a String object.</p>
<p><strong>Q15. Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?</strong></p>
<p>A. Yes, it does. The FileNoFoundException is inherited from the IOException. Exception&#8217;s subclasses have to be caught first.</p>
<p><strong>Q16. Can an inner class declared inside of a method access local variables of this method?</strong></p>
<p>A. It&#8217;s possible if these variables are final.</p>
<p><strong>Q17. What can go wrong if you replace &#038;&#038; with &#038; in the following code:</strong><br />
String a=null; if (a!=null &#038;&#038; a.length()>10) {&#8230;}</p>
<p>A. A single ampersand here would lead to a NullPointerException.</p>
<p><strong>Q18. What&#8217;s the main difference between a Vector and an ArrayList</strong></p>
<p>A. Java Vector class is internally synchronized and ArrayList is not.</p>
<p><strong>Q19. When should the method invokeLater()be used?</strong></p>
<p>A. This method is used to ensure that Swing components are updated through the event-dispatching thread.</p>
<p><strong>Q20. How can a subclass call a method or a constructor defined in a superclass?</strong></p>
<p>A. Use the following syntax: super.myMethod(); To call a constructor of the superclass, just write super(); in the first line of the subclass&#8217;s constructor.</p>
<p>For senior-level developers:<br />
<strong>Q21. What&#8217;s the difference between a queue and a stack?</strong></p>
<p>A. Stacks works by last-in-first-out rule (LIFO), while queues use the FIFO rule</p>
<p><strong>Q22. You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?</strong></p>
<p>A. Sometimes. But your class may be a descendant of another class and in this case the interface is your only option.</p>
<p><strong>Q23. What comes to mind when you hear about a young generation in Java?</strong></p>
<p>A. Garbage collection.</p>
<p><strong>Q24. What comes to mind when someone mentions a shallow copy in Java?</strong></p>
<p>A. Object cloning.</p>
<p><strong>Q25. If you&#8217;re overriding the method equals() of an object, which other method you might also consider?</strong></p>
<p>A. hashCode()</p>
<p><strong>Q26. You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use:ArrayList or LinkedList?</strong></p>
<p>A. ArrayList</p>
<p><strong>Q27. How would you make a copy of an entire Java object with its state?</strong></p>
<p>A. Have this class implement Cloneable interface and call its method clone().</p>
<p><strong>Q28. How can you minimize the need of garbage collection and make the memory use more effective?</strong></p>
<p>A. Use object pooling and weak object references.<br />
<strong><br />
Q29. There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it?</strong></p>
<p>A. If these classes are threads I&#8217;d consider notify() or notifyAll(). For regular classes you can use the Observer interface.</p>
<p><strong>Q30. What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access it?</strong></p>
<p>A. You do not need to specify any access level, and Java will use a default package access level.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/30-best-java-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cobol Interview Questions</title>
		<link>http://www.technicalinterview.info/cobol-interview-questions-3/</link>
		<comments>http://www.technicalinterview.info/cobol-interview-questions-3/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 15:25:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[COBOL Interview Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/cobol-interview-questions-3/</guid>
		<description><![CDATA[1. When would you use in-line perform?
When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM para [...]]]></description>
			<content:encoded><![CDATA[<p>1. When would you use in-line perform?</p>
<p>When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM para name rather than in-line perform.</p>
<p>2. What is the difference between CONTINUE &#038; NEXT SENTENCE ?</p>
<p>CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period)</p>
<p>3. What does EXIT do ?</p>
<p>Does nothing ! If used, must be the only sentence within a paragraph.</p>
<p>4. Can I redefine an X(100) field with a field of X(200)?</p>
<p>Yes. Redefines just causes both fields to start at the same location. For example:<br />
01 WS-TOP PIC X(1)<br />
01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).<br />
If you MOVE &#8216;12&#8242; to WS-TOP-RED,<br />
DISPLAY WS-TOP will show 1 while<br />
DISPLAY WS-TOP-RED will show 12.</p>
<p>5. Can I redefine an X(200) field with a field of X(100) ?</p>
<p>Yes.</p>
<p>6. What do you do to resolve SOC-7 error?</p>
<p>Basically you need to correcting the offending data.<br />
Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first.<br />
Many installations provide you a dump for run time abends ( it can be generated also by calling some subroutines or OS services through assembly language). These dumps provide the offset of the last instruction at which the abend occurred. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc ) in the JCL.<br />
If none of these are helpful, use judgment and DISPLAY to localize the source of error.<br />
Some installation might have batch program debugging tools. Use them.</p>
<p>7. How is sign stored in Packed Decimal fields and Zoned Decimal fields?</p>
<p>Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage. Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite.</p>
<p>8. How is sign stored in a comp-3 field?</p>
<p>It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc&#8230;</p>
<p>9. How is sign stored in a COMP field ?</p>
<p>In the most significant bit. Bit is on if -ve, off if +ve.</p>
<p>10. What is the difference between COMP &#038; COMP-3 ?</p>
<p>COMP is a binary storage format while COMP-3 is packed decimal format.</p>
<p>11. What is COMP-1? COMP-2?</p>
<p>COMP-1 - Single precision floating point. Uses 4 bytes.<br />
COMP-2 - Double precision floating point. Uses 8 bytes.</p>
<p>12. How do you define a variable of COMP-1? COMP-2?</p>
<p>No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.</p>
<p>13. How many bytes does a S9(7) COMP-3 field occupy ?</p>
<p>Will take 4 bytes. Sign is stored as hex value in the last nibble.<br />
General formula is INT((n/2) + 1)), where n=7 in this example.</p>
<p>14. How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?</p>
<p>Will occupy 8 bytes (one extra byte for sign).</p>
<p>15. How many bytes will a S9(8) COMP field occupy ?</p>
<p>4 bytes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/cobol-interview-questions-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cobol Interview Questions</title>
		<link>http://www.technicalinterview.info/cobol-interview-questions-2/</link>
		<comments>http://www.technicalinterview.info/cobol-interview-questions-2/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 15:22:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[COBOL Interview Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/cobol-interview-questions-2/</guid>
		<description><![CDATA[1. How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.
Syntax:
SORT file-1 ON ASCENDING/DESCENDING KEY key&#8230;.
USING file-2
GIVING file-3.
USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2
GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.
file-1 is the sort workfile and must be described using SD [...]]]></description>
			<content:encoded><![CDATA[<p>1. How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.</p>
<p>Syntax:<br />
SORT file-1 ON ASCENDING/DESCENDING KEY key&#8230;.<br />
USING file-2<br />
GIVING file-3.<br />
USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2<br />
GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.<br />
file-1 is the sort workfile and must be described using SD entry in FILE SECTION.<br />
file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.<br />
file-3 is the outfile from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.<br />
file-1, file-2 &#038; file-3 should not be opened explicitly.<br />
INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure.<br />
OUTPUT PROCEDURE is executed after all records have been sorted. Records from the sort work file must be RETURNed one at a time to the output procedure.</p>
<p>2.How do you define a sort file in JCL that runs the COBOL program?</p>
<p>Use the SORTWK01, SORTWK02,&#8230;.. dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required.</p>
<p>3.What are the two ways of doing sorting in a COBOL program? Give the formats.</p>
<p>Use the SORTWK01, SORTWK02</p>
<p>4.Give the format of USING and GIVING in SORT statement. What are the restrictions with it?</p>
<p>Restrictions - Cannot massage records, cannot select records to be sorted.</p>
<p>5. What is the difference between performing a SECTION and a PARAGRAPH?</p>
<p>Performing a SECTION will cause all the paragraphs that are part of the section, to be performed.<br />
Performing a PARAGRAPH will cause only that paragraph to be performed.</p>
<p>6.What is the use of EVALUATE statement?</p>
<p>Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no &#8216;break&#8217; is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made.</p>
<p>7. What are the different forms of EVALUATE statement?<br />
EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS<br />
WHEN A=B AND C=D WHEN 100 ALSO &#8216;00&#8242;<br />
imperative statement imperative statement<br />
WHEN (D+X)/Y = 4 WHEN -305 ALSO &#8216;32&#8242;<br />
imperative statement imperative statement<br />
WHEN OTHER WHEN OTHER<br />
imperative statement imperative statement<br />
END-EVALUATE END-EVALUATE<br />
EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE<br />
WHEN 100 ALSO TRUE WHEN 100 ALSO A=B<br />
imperative statement imperative statement<br />
WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)<br />
imperative statement imperative statement<br />
END-EVALUATE END-EVALUATE</p>
<p>8. How do you come out of an EVALUATE statement?</p>
<p>After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code.</p>
<p>9.In an EVALUATE statement, can I give a complex condition on a when clause?</p>
<p>Yes.</p>
<p>10. What is a scope terminator? Give examples.</p>
<p>Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.</p>
<p>11. How do you do in-line PERFORM?</p>
<p>PERFORM &#8230; &#8230;<br />
END PERFORM</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/cobol-interview-questions-2/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
