<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3969207528823773602</id><updated>2012-02-17T01:27:34.058+05:30</updated><category term='Exam Result'/><title type='text'>Discover Your Talent</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-415479217736658162</id><published>2009-02-07T16:33:00.001+05:30</published><updated>2009-02-07T16:36:15.725+05:30</updated><title type='text'>Linked List</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Linked List Concepts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Printing Linked list without traversing the list:&lt;br /&gt;&lt;br /&gt;void printreverse(Node *node)&lt;br /&gt;{&lt;br /&gt;  if (node)&lt;br /&gt;  {&lt;br /&gt;    printreverse(node-&gt;next);&lt;br /&gt;    printf("%d -&gt; ",node-&gt;info);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reversing the list using stack:&lt;br /&gt;Push all the nodes, pop one by one and print them… Here is the program for this..&lt;br /&gt;&lt;br /&gt;void printreverse(Node* node)&lt;br /&gt;{&lt;br /&gt;  Node *tmpnode; &lt;br /&gt;  Stack *stack = CreateStack();&lt;br /&gt;  while(node)&lt;br /&gt;  {&lt;br /&gt;    Push(stack, node);&lt;br /&gt;    node = node-&gt;next;&lt;br /&gt;  }&lt;br /&gt;  tmpnode = Pop(stack);&lt;br /&gt;  while(tmpnode)&lt;br /&gt;  {&lt;br /&gt;    tmpnode = Pop(stack);&lt;br /&gt;    printf("%d -&gt; ", tmpnode-&gt;info);&lt;br /&gt;  }&lt;br /&gt;  DestroyStack(stack);&lt;br /&gt;}&lt;br /&gt;Reverse linked list using pointers &lt;br /&gt;Reversing a single list can achieved using a stack very easily. however this can be done without using stack, and by simply using three additional pointers. Let us say we are using curr, next, result pointers, curr points to current node, next obviously points to the next node, result points to the new reversed linked list.&lt;br /&gt;here is the pictorial representation of this operation for better understanding…&lt;br /&gt; &lt;br /&gt;now result holds one reversed node, and curr points to the rest of the linked list..&lt;br /&gt; &lt;br /&gt;now result holds a pointer to the reversed linked list (reversed two pointers already)…. curr holds rest of the list&lt;br /&gt; &lt;br /&gt;we reversed successfully….&lt;br /&gt; &lt;br /&gt;here is the routine for doing this…..&lt;br /&gt;void reverse_single_linked_list(struct node** headRef)&lt;br /&gt;{&lt;br /&gt;  struct node* result = NULL;&lt;br /&gt;  struct node* current = *headRef;&lt;br /&gt;  struct node* next;&lt;br /&gt;  while (current != NULL)&lt;br /&gt;  {&lt;br /&gt;    next = current-&gt;next; // tricky: note the next node&lt;br /&gt;    current-&gt;next = result; // move the node onto the result&lt;br /&gt;    result = current;&lt;br /&gt;    current = next;&lt;br /&gt;  }&lt;br /&gt;  *headRef = result;&lt;br /&gt;Question: How could you determine if a linked list contains a cycle in it, and, at what node the cycle starts? &lt;br /&gt;Answer: There are a number of approaches. The approach I shared is in time N (where N is the number of nodes in your linked list). Assume that the node definition contains a boolean flag, bVisited. &lt;br /&gt;// error checking and checking for NULL at end of list omitted&lt;br /&gt;p1 = p2 = head;&lt;br /&gt;&lt;br /&gt;do {&lt;br /&gt; p1 = p1-&gt;next;&lt;br /&gt; p2 = p2-&gt;next-&gt;next;&lt;br /&gt;} while (p1 != p2);&lt;br /&gt;p2 is moving through the list twice as fast as p1. If the list is circular, (i.e. a cycle exists) it will eventually get around to that sluggard, p1. &lt;br /&gt;&lt;br /&gt;Question: How would you reverse a doubly-linked list?&lt;br /&gt;Answer: This problem isn't too hard. You just need to start at the head of the list, and iterate to the end. At each node, swap the values of pNext and pPrev. Finally, set pHead to the last node in the list. &lt;br /&gt;Node * pCurrent = pHead, *pTemp;&lt;br /&gt;while (pCurrent)&lt;br /&gt;{&lt;br /&gt;  pTemp = pCurrent-&gt;pNext;&lt;br /&gt;  pCurrent-&gt;pNext = pCurrent-&gt;pPrev;&lt;br /&gt;  pCurrent-&gt;pPrev = temp;&lt;br /&gt;  &lt;br /&gt;  pHead = pCurrent;&lt;br /&gt;&lt;br /&gt;  pCurrent = temp;&lt;br /&gt;}&lt;br /&gt;________________________________________&lt;br /&gt;Question: Assume you have an array that contains a number of  strings (perhaps char * a[100]). Each string is a word from the dictionary. Your task, described in high-level terms, is to devise a way to determine and display all of the anagrams within the array (two words are anagrams if they contain the same characters; for example, tales and slate are anagrams.) &lt;br /&gt;Answer: Begin by sorting each element in the array in alphabetical order. So, if one element of your array was slate, it would be rearranged to form aelst (use some mechanism to know that the particular instance of aelst maps to slate). At this point, you slate and tales would be identical: aelst.&lt;br /&gt;Next, sort the entire array of these modified dictionary words. Now, all of the anagrams are grouped together. Finally, step through the array and display duplicate terms, mapping the sorted letters (aelst) back to the word (slate or tales). &lt;br /&gt;________________________________________&lt;br /&gt;Question: Given the following prototype: &lt;br /&gt;int compact(int * p, int size); &lt;br /&gt;write a function that will take a sorted array, possibly with duplicates, and compact the array, returning the new length of the array. That is, if p points to an array containing: 1, 3, 7, 7, 8, 9, 9, 9, 10, when the function returns, the contents of p should be: 1, 3, 7, 8, 9, 10, with a length of 5 returned. &lt;br /&gt;Answer: A single loop will accomplish this.&lt;br /&gt;int compact(int * p, int size)&lt;br /&gt;{&lt;br /&gt;  int current, insert = 1;&lt;br /&gt;  for (current=1; current &lt; size; current++)&lt;br /&gt;    if (p[current] != p[insert-1])&lt;br /&gt;    {&lt;br /&gt;      p[insert] = p[current];&lt;br /&gt;      current++;&lt;br /&gt;      insert++;&lt;br /&gt;    } else&lt;br /&gt;      current++;&lt;br /&gt;}&lt;br /&gt;Happy Programming! &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RE: write a c program to reverse the string without us... &lt;br /&gt;________________________________________ &lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;#include&lt;string.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt; char str[50],revstr[50];&lt;br /&gt; int i=0,j=0;&lt;br /&gt; printf("Enter the string to be reversed : ");&lt;br /&gt; scanf("%s",str);&lt;br /&gt; for(i=strlen(str)-1;i&gt;=0;i--)&lt;br /&gt; {&lt;br /&gt; revstr[j]=str[i];&lt;br /&gt; j++;&lt;br /&gt; }&lt;br /&gt; revstr[j]='\0';&lt;br /&gt; printf("Input String : %s",str);&lt;br /&gt; printf("\nOutput String : %s",revstr);&lt;br /&gt; getch();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;write a c program to find whether a stack is  &lt;br /&gt;progressing in forward or reverse direction.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt; &lt;br /&gt; &lt;br /&gt;void show_stack_dir(int * p) { &lt;br /&gt;  printf("%s\n", p &lt; (int*)(&amp;p) ? "up" : "down"); &lt;br /&gt;} &lt;br /&gt; &lt;br /&gt;int main(int argc, char ** argv) { &lt;br /&gt;  show_stack_dir(&amp;argc); &lt;br /&gt;  return 0; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Given a number, how can u determine using C, whether it is divisible by 3, without using *, /, % operators. &lt;br /&gt; &lt;br /&gt;You may assume that itoa() function is available.&lt;br /&gt;convert  the number to the string using itoa(); &lt;br /&gt;  &lt;br /&gt;add up all the digits   &lt;br /&gt;checkDivisibility(int num){ &lt;br /&gt;char *str=itoa(num) &lt;br /&gt;  &lt;br /&gt;while (1) &lt;br /&gt;{ &lt;br /&gt;for (i =0 ; i &lt; strlen(str);i++) &lt;br /&gt;sum= sum + (str[i] - "0"); &lt;br /&gt;  &lt;br /&gt;if (sum &gt; 10) &lt;br /&gt;str=itoa(sum);   &lt;br /&gt;else &lt;br /&gt;break; &lt;br /&gt;} &lt;br /&gt;  &lt;br /&gt;if(sum == 3 || sum == 6 || sum == 9) &lt;br /&gt;printf("Number divisible by 3"); &lt;br /&gt;else &lt;br /&gt;printf("Number not divisible by 3"); &lt;br /&gt;  &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Re: Hexadecimal Conversion  &lt;br /&gt;« Reply #6 on: Jul 26th, 2007, 1:02am »  Quote  Modify &lt;br /&gt;&lt;br /&gt;________________________________________&lt;br /&gt;We can change this to...  &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; if( ch &gt;= '0' &amp;&amp; ch &lt;='9')   &lt;br /&gt;index=ch-'0';   &lt;br /&gt;else if(ch &gt;= 'A' &amp;&amp; ch &lt;= 'F')   &lt;br /&gt;index=10+ch-'A';   &lt;br /&gt;else if(ch &gt;='a' &amp;&amp; ch &lt;= 'f')   &lt;br /&gt;index=10+ch-'a';  &lt;br /&gt;&lt;br /&gt;Re: Find the Repeated Number  &lt;br /&gt;« Reply #5 on: Aug 1st, 2007, 3:20am »  Quote  Modify &lt;br /&gt;&lt;br /&gt;________________________________________&lt;br /&gt;&lt;br /&gt;Try and debug thru this code with an appropriate example &lt;br /&gt; &lt;br /&gt;int findRepeated(int *arr,int length) &lt;br /&gt;{ &lt;br /&gt;int counter=0; &lt;br /&gt;int current=arr[0]; &lt;br /&gt;for(i=0;i&lt;length;i++) &lt;br /&gt;{ &lt;br /&gt;if(counter==0) &lt;br /&gt;{ &lt;br /&gt;counter++; &lt;br /&gt;current=arr [ i ]; &lt;br /&gt;} &lt;br /&gt;if(counter &gt; 0) &lt;br /&gt;{ &lt;br /&gt;if(current == arr [ i ]) &lt;br /&gt;{ &lt;br /&gt;counter++; &lt;br /&gt;else &lt;br /&gt;counter--; &lt;br /&gt;} &lt;br /&gt;} &lt;br /&gt; &lt;br /&gt;return current; &lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Function for finding greatest of three numbers:&lt;br /&gt;    int maxof3(int a, int b, int c)&lt;br /&gt;    {&lt;br /&gt; return (a + b + c * 2 + abs(a - b) + abs(a + b - c * 2 + abs(a - b))) / 4;&lt;br /&gt;    }&lt;br /&gt;Function for finding greatest of four numbers:&lt;br /&gt;    int maxof4(int a, int b, int c, int d)&lt;br /&gt;    {&lt;br /&gt;    return (a + b + c + d + abs (b - a) + abs(d - c) + abs(a + b - c - d + abs( b - a) - abs(d - c)))/ 4;&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-415479217736658162?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/415479217736658162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=415479217736658162' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/415479217736658162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/415479217736658162'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/linked-list.html' title='Linked List'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-8074421025183288066</id><published>2009-02-07T16:27:00.000+05:30</published><updated>2009-02-07T16:32:14.352+05:30</updated><title type='text'>GOOGLE CHROME - THE BEST WEB BROWSER</title><content type='html'>GOOGLE CHROME&lt;br /&gt;&lt;br /&gt;Google Chrome is a web browser developed by Google and based on the WebKit layout engine and application framework. In December 2008, it had a share of 1.04% of the browser market.[1] It was first released as a beta version for Microsoft Windows on September 2, 2008. The name is derived from the graphical user interface frame, or "chrome", of web browsers. The public stable release was on December 11, 2008.&lt;br /&gt;• Chromium is the open source project behind Google Chrome.[2] The Google-authored portion of it is released under the BSD license, with other parts being subject to a variety of different permissive open-source licenses, including the MIT License, the LGPL, the Microsoft Permissive License and a MPL/GPL/LGPL tri-license.[3] It implements the same feature set as Chrome, but has a slightly different logo.&lt;br /&gt;History&lt;br /&gt;Announcement&lt;br /&gt;The release announcement was originally scheduled for September 3, 2008, and a comic by Scott McCloud was to be sent to journalists and bloggers explaining the features of and motivations for the new browser.[5] Copies intended for Europe were shipped early and German blogger Philipp Lenssen of Google Blogoscoped[6] made a scanned copy of the 38-page comic available on his website after receiving it on September 1, 2008.[7] Google subsequently made the comic available on Google Books and their site[8] and mentioned it on its official blog along with an explanation for the early release.[9]&lt;br /&gt;Public release&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Chromium Test Shell on Linux&lt;br /&gt;The browser was first publicly released for Microsoft Windows (XP and later only) on September 2, 2008 in 43 languages, officially a beta version.[10] Chrome quickly gained about 1% market share. Mac OS X and Linux versions are under development.[11][12][13][14] Recently, in the Chromium project's developer wiki[15] a message was placed that a "test shell" is available to build on Linux. Some have tried this shell, which apparently lacks many features, but appears to function quite well in rendering web sites (including JavaScript).[16][17]&lt;br /&gt;On September 2, a CNET news item[18] drew attention to a passage in the terms of service for the initial beta release, which seemed to grant to Google a license to all content transferred via the Chrome browser. The passage in question was inherited from the general Google terms of service.[19] On the same day, Google responded to this criticism by stating that the language used was borrowed from other products, and removed the passage in question from the Terms of Service.[20] Google noted that this change would "apply retroactively to all users who have downloaded Google Chrome."[21] There were subsequent concern and confusion about whether and what information the program communicates back to Google. The company stated[22] that usage metrics are only sent when users opt in by checking the option "help make Google Chrome better by automatically sending usage statistics and crash reports to Google" when the browser is installed.[23]&lt;br /&gt;The first release of Google Chrome passed the Acid1 and Acid2 tests. It also passed 79 out of the 100 subtests of the Acid3, higher than both Internet Explorer 7 (14) and Firefox 3 (71), but lower than Opera (83)[vague].[24] When compared with development builds of Firefox, Internet Explorer, Opera, and Safari, Chrome scored lower than Firefox 3.1 Beta 1 (85), Opera (100), and Safari 4 (Developer Preview) (100),[24] but still higher than Internet Explorer (21)[citation needed].&lt;br /&gt;On January 9, 2009, CNET reports that Google plans to release versions for Mac OS X and Linux by the first half of the year.[25]&lt;br /&gt;Unofficial Chromium releases&lt;br /&gt;• On September 15, 2008, CodeWeavers released an unofficial bundle of a Wine derivative and Chromium Developer Build 21 for Linux and Mac OS X, which they dubbed CrossOver Chromium.[26][27]&lt;br /&gt;• SRWare Iron is a release of Chromium software that explicitly disables the collection and transmission of usage information to Google which is optional within Chrome.[28]&lt;br /&gt;Development&lt;br /&gt;Primary design goals were improvements in security, speed, and stability compared to existing browsers. There also were extensive changes in the user interface.[8] Chrome was assembled from 26 different code libraries from Google and others from third parties such as Netscape.[29]&lt;br /&gt;Security&lt;br /&gt;Chrome periodically downloads updates of two blacklists (one for phishing and one for malware), and warns users when they attempt to visit a harmful site. This service is also made available for use by others via a free public API called "Google Safe Browsing API". Google notifies the owners of listed sites who may not be aware of the presence of the harmful software.[8]&lt;br /&gt;Chrome will typically allocate each tab to fit into its own process to "prevent malware from installing itself" or "using what happens in one tab to affect what happens in another", however the actual process allocation model is more complex.[30] Following the principle of least privilege, each process is stripped of its rights and can compute, but can not write files or read from sensitive areas (e.g. documents, desktop)—this is similar to the "Protected Mode" that is used by Internet Explorer 7 on Windows Vista. The Sandbox Team is said to have "taken this existing process boundary and made it into a jail";[31] for example, malicious software running in one tab is unable to sniff credit card numbers, interact with the mouse, or tell "Windows to run an executable on start-up" and it will be terminated when the tab is closed. This enforces a simple computer security model whereby there are two levels of multilevel security (user and sandbox) and the sandbox can only respond to communication requests initiated by the user.[32]&lt;br /&gt;Typically, plugins such as Adobe Flash Player are not standardized and as such, cannot be sandboxed as tabs can be. These often need to run at, or above, the security level of the browser itself. To reduce exposure to attack, plugins are run in separate processes that communicate with the renderer, itself operating at "very low privileges" in dedicated per-tab processes. Plugins will need to be modified to operate within this software architecture while following the principle of least privilege.[8] Chrome supports the Netscape Plugin Application Programming Interface (NPAPI),[33][34] but does not support the embedding of ActiveX controls.[34] Also, Chrome does not have an extension system such as Mozilla's XPInstall architecture.[35] Java applets support is available in Chrome as part of Java 6 update 11, which currently is the latest stable version.[36][37]&lt;br /&gt;A private browsing feature called Incognito mode is provided that prevents the browser from storing any history information or cookies from the websites visited. This feature has been referred to as a porn mode similar to the private browsing feature available in Apple's Safari and the latest beta version of Internet Explorer 8.[38]&lt;br /&gt;A denial-of-service vulnerability was found that allowed a malicious web page to crash the whole web browser.[39][40] However, Google Chrome developers confirmed the flaw, and it was fixed in the 0.2.149.29 release.[41]&lt;br /&gt;Speed&lt;br /&gt;The JavaScript virtual machine was considered a sufficiently important project to be split off (as was Adobe/Mozilla's Tamarin) and handled by a separate team in Denmark. According to Google, existing implementations were designed "for small programs, where the performance and interactivity of the system weren't that important," but web applications such as Gmail "are using the web browser to the fullest when it comes to DOM manipulations and Javascript." The resulting V8 JavaScript engine has features such as hidden class transitions, dynamic code generation, and precise garbage collection.[8] Tests by Google showed that V8 was about twice as fast as Firefox 3.0 and the Safari 4 beta.[42]&lt;br /&gt;Several websites performed benchmark tests using the SunSpider JavaScript Benchmark[43] tool as well as Google's own set of computationally intense benchmarks, which includes ray tracing and constraint solving.[44] They unanimously reported that Chrome performed much faster than all competitors against which it had been tested, including Safari, Firefox 3.0, Internet Explorer 7, and Internet Explorer 8.[45][46][47][48] While Opera had not been compared to Chrome in those comparisons, in previous tests, it had been shown to be slightly slower than Firefox 3.0, which in turn, was slower than Chrome.[49][50] Another blog post by Mozilla developer Brendan Eich compared Chrome's V8 engine to his own TraceMonkey Javascript engine which was introduced in Firefox 3.1alpha, stating that some tests were faster in one engine and some were faster in the other, with Firefox 3.1a faster overall.[51] John Resig, Mozilla's JavaScript evangelist, further commented on the performance of different browsers on Google's own suite, finding Chrome "decimating" other browsers, but he questions whether Google's suite is representative of real programs. He stated that Firefox 3.0 performed poorly on recursion intensive benchmarks, such as those of Google, because the Mozilla team had not implemented recursion-tracing yet.[52]&lt;br /&gt;Chrome also uses DNS prefetching to speed up website lookups.[53]&lt;br /&gt;Stability&lt;br /&gt;The Gears team was considering a multithreaded browser (noting that a problem with existing web browser implementations was that they are inherently single-threaded) and Chrome implemented this concept with a multi-process architecture,[54] similar to Loosely Coupled Internet Explorer (LCIE) recently implemented by Internet Explorer 8.[55] By default, a separate process is allocated to each site instance and plugin.[56] This prevents tasks from interfering with each other, which is good for security and stability; an attacker successfully gaining access to one application does not gain access to all, and failure in one application results in a Sad Tab screen of death, similar to the well-known Sad Mac, except only one single tab crashes instead of the whole application. This strategy exacts a fixed per-process cost up front, but results in less memory bloat overall as fragmentation is confined to each process and no longer results in further memory allocations.[57]&lt;br /&gt;Chrome features a process management utility called the Task Manager which allows the user to "see what sites are using the most memory, downloading the most bytes and abusing [their] CPU" (as well as the plugins which run in separate processes) and terminate them.[8] Some users have reported a conflict with Internet Explorer, often resulting in the blue screen error on Windows.[58]&lt;br /&gt;User interface&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When Chrome is maximized, the title bar becomes hidden and instead, the tab bar is displayed at the top. Also, when the mouse is moved over a link, the URL of the link is displayed in a status bar at the bottom left. Otherwise, the status bar is invisible.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When Chrome is not maximized, the title bar is shown on top of the tab bar.&lt;br /&gt;The main user interface includes back, forward, refresh, bookmark, go, and cancel options. The options are similar to Safari, while the location of the settings is similar to versions of Internet Explorer starting with version 7. The design of the window is based on Windows Vista.&lt;br /&gt;When the window is not maximized, the tab bar appears directly under the title bar. When maximized, the title bar disappears, and instead, the tab bar is shown at the very top of the window. Unlike other browsers such as Internet Explorer or Firefox which also have a full-screen mode that hides the operating system's interface completely, Chrome can only be maximized like a standard Windows application. Therefore, the Windows task bar, notification area, and start menu link still take space at all times unless they have been configured to hide at all times.&lt;br /&gt;Chrome includes Gears, which adds features for web developers typically relating to the building of web applications (including offline support).[8]&lt;br /&gt;Chrome replaces the browser home page which is displayed when a new tab is created with a New Tab Page. This shows[59] thumbnails of the nine most visited web sites along with the sites most often searched, recent bookmarks, and recently closed tabs.[8]&lt;br /&gt;The Omnibox is the URL box at the top of each tab, which combines the functionalities of both URL box and search box. It includes autocomplete functionality, but only will autocomplete URLs that were manually entered (rather than all links), search suggestions, top pages (previously visited), popular pages (unvisited), and text search over history. Search engines also can be captured by the browser when used via the native user interface by pressing Tab.[8]&lt;br /&gt;Popup windows "are scoped to the tab they came from" and will not appear outside the tab unless the user explicitly drags them out.[8]&lt;br /&gt;Chrome uses the WebKit rendering engine to display web pages, on advice from the Android team.[8] Like most browsers, Chrome was extensively tested internally before release with unit testing, "automated user interface testing of scripted user actions" and fuzz testing, as well as WebKit's layout tests (99% of which Chrome is claimed to have passed). New browser builds are automatically tested against tens of thousands of commonly accessed websites inside of the Google index within 20-30 minutes.[8]&lt;br /&gt;Tabs are the primary component of Chrome's user interface and as such, have been moved to the top of the window rather than below the controls. This subtle change contrasts with many existing tabbed browsers which are based on windows and contain tabs. Tabs (including their state) can be transferred seamlessly between window containers by dragging. Each tab has its own set of controls, including the Omnibox.[8]&lt;br /&gt;Chrome allows users to make local desktop shortcuts that open web applications in the browser. The browser, when opened in this way, contains none of the regular interface except for the title bar, so as not to "interrupt anything the user is trying to do." This allows web applications to run alongside local software (similar to Mozilla Prism and Fluid).[8]&lt;br /&gt;By default, the status bar is hidden whenever it is not being used. However, it appears at the bottom left corner whenever a page is loading and when a hyperlink is hovered over.&lt;br /&gt;For web developers, Chrome features an element inspector similar to the one in Firebug.[53]&lt;br /&gt;Usage tracking&lt;br /&gt;Usage tracking is an option presented to the user during the software's installation. Once accepted, it is possible to disable the transmission of this information by modifying Chrome's "Under the Hood" options.[60] Freeware programs such as UnChrome can remove the unique ID without having to change the browser.[61] Unofficial builds, such as SRWare Iron, seek to remove these features from the browser altogether.[62]&lt;br /&gt;Extensions&lt;br /&gt;As of October 2008, Google Chrome does not support 3rd party extensions.[63][64]&lt;br /&gt;As of version 3499, Google Chrome has rudimentary Greasemonkey support. This feature is off by default, and may be turned on by launching the application with a specific command-line argument. &lt;br /&gt;Google Chrome extensions: Not yet, but later. "We don't have that in the beta today, but we definitely plan an extension API," or application programming interface, Sundar Pichai, a Google vice president of product management, said at the Chrome launch event here Tuesday. "It is one of the things we will get to next."&lt;br /&gt;—CNet News&lt;br /&gt;Stable, Beta and Dev Releases&lt;br /&gt;On January 08, 2009 Google introduced a new release channels system, whereby now there are three distinct release channels: Stable channel, Beta channel, and Developer preview channel. Before this change, there were only two channels: Beta channel and Developer preview channel. All previous Dev channel users were moved to Beta channel, the reason is that now the new Dev channel builds will be less stable and polished than what Dev channel users have been getting during Google Chrome's Beta period. Now the stable channel will be updated with features and fixes once they have been thoroughly tested in the Beta channel, and the Beta channel will be updated roughly monthly with stable and complete features from the Dev channel. The Dev channel is where ideas get tested (and sometimes fail), and it can be very unstable at times. [67][68] See http://googlechromereleases.blogspot.com/ for more information on specific releases.&lt;br /&gt;Reception&lt;br /&gt;The Daily Telegraph's Matthew Moore summarizes the verdict of early reviewers: "Google Chrome is attractive, fast and has some impressive new features, but may not—yet—be a threat to its Microsoft rival."[69]&lt;br /&gt;Microsoft reportedly "played down the threat from Chrome" and "predicted that most people will embrace Internet Explorer 8." Opera Software said that "Chrome will strengthen the Web as the biggest application platform in the world."[70] Mozilla said that Chrome's introduction into the web browser market comes as "no real surprise", that "Chrome is not aimed at competing with Firefox", and furthermore that it should not affect Google's financing of Firefox.[71][72]&lt;br /&gt;Chrome’s design bridges the gap between desktop and so-called “cloud computing.” At the touch of a button, Chrome lets you make a desktop, Start menu, or Quick Launch shortcut to any Web page or Web application, blurring the line between what’s online and what’s inside your PC. For example, I created a desktop shortcut for Google Maps. When you create a shortcut for a Web application, Chrome strips away all of the toolbars and tabs from the window, leaving you with something that feels much more like a desktop application than like a Web application or page.&lt;br /&gt;—PC World[73]&lt;br /&gt;On September 9, 2008, when Chrome still had been in beta, the German Federal Office for Information Security (BSI) issued a statement about their first examination of Chrome, expressing a concern over the prominent download links on Google's German web page, because "beta versions should not be employed for general use applications" and browser manufacturers should provide appropriate instructions regarding the use of pre-released software. They did, however, praise the browser's technical contribution to improving security on the web.[74]&lt;br /&gt;Concern about Chrome's optional usage collection and tracking have been noted in several publications.[75][76]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-8074421025183288066?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/8074421025183288066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=8074421025183288066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/8074421025183288066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/8074421025183288066'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/google-chrome-best-web-browser.html' title='GOOGLE CHROME - THE BEST WEB BROWSER'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-2945009653980538921</id><published>2009-02-07T16:25:00.000+05:30</published><updated>2009-02-07T16:27:05.899+05:30</updated><title type='text'>Java Interview Questions</title><content type='html'>Java Interview Questions &lt;br /&gt;&lt;br /&gt;Question: What is the difference between an Interface and an Abstract class? &lt;br /&gt;&lt;br /&gt;  Question: What is the purpose of garbage collection in Java, and when is it used?  &lt;br /&gt;&lt;br /&gt;Question:  Describe synchronization in respect to multithreading.&lt;br /&gt;&lt;br /&gt;Question:  Explain different way of using thread?  &lt;br /&gt;&lt;br /&gt;Question:  What are pass by reference and passby value? &lt;br /&gt;&lt;br /&gt;Question:  What is HashMap and Map?&lt;br /&gt;&lt;br /&gt;Question:  Difference between HashMap and HashTable?&lt;br /&gt;&lt;br /&gt;Question: Difference between Vector and ArrayList?&lt;br /&gt;&lt;br /&gt;Question:  Difference between Swing and Awt?&lt;br /&gt;&lt;br /&gt;Question:  What is the difference between a constructor and a method? &lt;br /&gt;&lt;br /&gt;Question:  What is an Iterator?&lt;br /&gt;&lt;br /&gt;Question:  State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.&lt;br /&gt;&lt;br /&gt;Question: What is an abstract class?&lt;br /&gt;&lt;br /&gt;Question: What is static in java? &lt;br /&gt;&lt;br /&gt;Question: What is final? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between an Interface and an Abstract class? &lt;br /&gt;A: An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.&lt;br /&gt;. &lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the purpose of garbage collection in Java, and when is it used?&lt;br /&gt;A: The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used. &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Q: Describe synchronization in respect to multithreading.&lt;br /&gt;A: With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.  &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Explain different way of using thread? &lt;br /&gt;A: The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritance..the only interface can help.&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are pass by reference and passby value? &lt;br /&gt;A: Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed. &lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is HashMap and Map?&lt;br /&gt;A: Map is Interface and Hashmap is class that implements that.&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Difference between HashMap and HashTable?&lt;br /&gt;A: The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is synchronized. &lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Difference between Vector and ArrayList?&lt;br /&gt;A: Vector is synchronized whereas arraylist is not.&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Difference between Swing and Awt?&lt;br /&gt;A: AWT are heavy-weight componenets. Swings are light-weight components. Hence swing works faster than AWT.&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between a constructor and a method? &lt;br /&gt;A: A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator.&lt;br /&gt;A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator.&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is an Iterator?&lt;br /&gt;A: Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator.&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.&lt;br /&gt;A: public : Public class is visible in other packages, field is visible everywhere (class must be public too)&lt;br /&gt;private : Private variables or methods may be used only by an instance of the same class that declares the variable or method, A private feature may only be accessed by the class that owns the feature.&lt;br /&gt;protected : Is available to all classes in the same package and also available to all subclasses of the class that owns the protected feature.This access is provided even to subclasses that reside in a different package from the class that owns the protected feature.&lt;br /&gt;default :What you get by default ie, without any access modifier (ie, public private or protected).It means that it is visible to all within a particular package.&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Q: What is an abstract class?&lt;br /&gt;A: Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is automatically abstract itself, and must be declared as such.&lt;br /&gt;A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Q: What is static in java?&lt;br /&gt;A: Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. A static method in a superclass can be shadowed by another static method in a subclass, as long as the original method was not declared final. However, you can't override a static method with a nonstatic method. In other words, you can't change a static method into an instance method in a subclass.&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Q: What is final?&lt;br /&gt;A: A final class can't be extended ie., final class may not be subclassed. A final method can't be overridden when its class is inherited. You can't change value of a final variable (is a constant).&lt;br /&gt;Java Interview Questions        &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Question: What if the main method is declared as private? &lt;br /&gt;&lt;br /&gt;Question: What if the static modifier is removed from the signature of the main method? &lt;br /&gt;&lt;br /&gt;Question: What if I write static public void instead of public static void?&lt;br /&gt;&lt;br /&gt;Question: What if I do not provide the String array as the argument to the method?  &lt;br /&gt;&lt;br /&gt;Question: What is the first argument of the String array in main method? &lt;br /&gt;&lt;br /&gt;Question: If I do not provide any arguments on the command line, then the String array of Main method will be empty or null?&lt;br /&gt;&lt;br /&gt;Question: How can one prove that the array is not null but empty using one line of code?&lt;br /&gt;&lt;br /&gt;Question: What environment variables do I need to set on my machine in order to be able to run Java programs?&lt;br /&gt;&lt;br /&gt;Question: Can an application have multiple classes having main method?&lt;br /&gt;&lt;br /&gt;Question: Can I have multiple main methods in the same class? &lt;br /&gt;&lt;br /&gt;Question: Do I need to import java.lang package any time? Why ?&lt;br /&gt;&lt;br /&gt;Question: Can I import same package/class twice? Will the JVM load the package twice at runtime?&lt;br /&gt;&lt;br /&gt;Question: What are Checked and UnChecked Exception?&lt;br /&gt;&lt;br /&gt;Question: What is Overriding? &lt;br /&gt;&lt;br /&gt;Question: What are different types of inner classes? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What if the main method is declared as private?&lt;br /&gt;A: The program compiles properly but at runtime it will give "Main method not public." message.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What if the static modifier is removed from the signature of the main method?&lt;br /&gt;A: Program compiles. But at runtime throws an error "NoSuchMethodError". &lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What if I write static public void instead of public static void?&lt;br /&gt;A: Program compiles and runs properly. &lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What if I do not provide the String array as the argument to the method?&lt;br /&gt;A: Program compiles but throws a runtime error "NoSuchMethodError". &lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the first argument of the String array in main method?&lt;br /&gt;A: The String array is empty. It does not have any element. This is unlike C/C++ where the first element by default is the program name.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: If I do not provide any arguments on the command line, then the String array of Main method will be empty or null?&lt;br /&gt;A: It is empty. But not null.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How can one prove that the array is not null but empty using one line of code?&lt;br /&gt;A: Print args.length. It will print 0. That means it is empty. But if it would have been null then it would have thrown a NullPointerException on attempting to print args.length.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What environment variables do I need to set on my machine in order to be able to run Java programs?&lt;br /&gt;A: CLASSPATH and PATH are the two variables.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can an application have multiple classes having main method?&lt;br /&gt;A: Yes it is possible. While starting the application we mention the class name to be run. The JVM will look for the Main method only in the class whose name you have mentioned. Hence there is not conflict amongst the multiple classes having main method.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can I have multiple main methods in the same class?&lt;br /&gt;A: No the program fails to compile. The compiler says that the main method is already defined in the class.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Do I need to import java.lang package any time? Why ?&lt;br /&gt;A: No. It is by default loaded internally by the JVM.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can I import same package/class twice? Will the JVM load the package twice at runtime?&lt;br /&gt;A: One can import the same package or same class multiple times. Neither compiler nor JVM complains abt it. And the JVM will internally load the class only once no matter how many times you import the same class.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are Checked and UnChecked Exception?&lt;br /&gt;A: A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses.&lt;br /&gt;Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown. eg, IOException thrown by java.io.FileInputStream's read() method•&lt;br /&gt;Unchecked exceptions are RuntimeException and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesn't force client programmers either to catch the&lt;br /&gt;exception or declare it in a throws clause. In fact, client programmers may not even know that the exception could be thrown. eg, StringIndexOutOfBoundsException thrown by String's charAt() method• Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be.&lt;br /&gt;     &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is Overriding?&lt;br /&gt;A: When a class defines a method using the same name, return type, and arguments as a method in its superclass, the method in the class overrides the method in the superclass.&lt;br /&gt;When the method is invoked for an object of the class, it is the new definition of the method that is called, and not the method definition from superclass. Methods may be overridden to be more public, not more private. &lt;br /&gt;     &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are different types of inner classes?&lt;br /&gt;A: Nested  -level classes, Member classes, Local classes, Anonymous classes&lt;br /&gt;Nested  -level classes- If you declare a class within a class and specify the static modifier, the compiler treats the class just like any other  -level class.&lt;br /&gt;Any class outside the declaring class accesses the nested class with the declaring class name acting similarly to a package. eg, outer.inner.  -level inner classes implicitly have access only to static variables.There can also be inner interfaces. All of these are of the nested  -level variety.&lt;br /&gt;&lt;br /&gt;Member classes - Member inner classes are just like other member methods and member variables and access to the member class is restricted, just like methods and variables. This means a public member class acts similarly to a nested  -level class. The primary difference between member classes and nested  -level classes is that member classes have access to the specific instance of the enclosing class.&lt;br /&gt;&lt;br /&gt;Local classes - Local classes are like local variables, specific to a block of code. Their visibility is only within the block of their declaration. In order for the class to be useful beyond the declaration block, it would need to implement a&lt;br /&gt;more publicly available interface.Because local classes are not members, the modifiers public, protected, private, and static are not usable.&lt;br /&gt;&lt;br /&gt;Anonymous classes - Anonymous inner classes extend local inner classes one level further. As anonymous classes have no name, you cannot provide a constructor.&lt;br /&gt;&lt;br /&gt;Java Interview Questions        &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Question: Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.ABCD compile?&lt;br /&gt;&lt;br /&gt;Question: Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*? &lt;br /&gt;&lt;br /&gt;Question: What is the difference between declaring a variable and defining a variable?&lt;br /&gt;&lt;br /&gt;Question: What is the default value of an object reference declared as an instance variable?  &lt;br /&gt;&lt;br /&gt;Question: Can a   level class be private or protected? &lt;br /&gt;&lt;br /&gt;Question: What type of parameter passing does Java support?&lt;br /&gt;&lt;br /&gt;Question: Primitive data types are passed by reference or pass by value?&lt;br /&gt;&lt;br /&gt;Question: Objects are passed by value or by reference?&lt;br /&gt;&lt;br /&gt;Question: What is serialization?&lt;br /&gt;&lt;br /&gt;Question: How do I serialize an object to a file?&lt;br /&gt;&lt;br /&gt;Question: Which methods of Serializable interface should I implement?&lt;br /&gt;&lt;br /&gt;Question: How can I customize the seralization process? i.e. how can one have a control over the serialization process?&lt;br /&gt;&lt;br /&gt;Question: What is the common usage of serialization?&lt;br /&gt;&lt;br /&gt;Question: What is Externalizable interface?&lt;br /&gt;&lt;br /&gt;Question: When you serialize an object, what happens to the object references included in the object?&lt;br /&gt;&lt;br /&gt;Question: What one should take care of while serializing the object?&lt;br /&gt;&lt;br /&gt;Question: What happens to the static fields of a class during serialization?&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;Q: Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.ABCD compile?&lt;br /&gt;A: Yes the imports are checked for the semantic validity at compile time. The code containing above line of import will not compile. It will throw an error saying,can not resolve symbol&lt;br /&gt;symbol : class ABCD&lt;br /&gt;location: package io&lt;br /&gt;import java.io.ABCD; &lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?&lt;br /&gt;A: No you will have to import the subpackages explicitly. Importing com.MyTest.* will import classes in the package MyTest only. It will not import any class in any of it's subpackage.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between declaring a variable and defining a variable?&lt;br /&gt;A: In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization.&lt;br /&gt;e.g String s; is just a declaration while String s = new String ("abcd"); Or String s = "abcd"; are both definitions.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the default value of an object reference declared as an instance variable?&lt;br /&gt;A: null unless we define it explicitly.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can a   level class be private or protected?&lt;br /&gt;A: No. A   level class can not be private or protected. It can have either "public" or no modifier. If it does not have a modifier it is supposed to have a default access.If a   level class is declared as private the compiler will complain that the "modifier private is not allowed here". This means that a   level class can not be private. Same is the case with protected.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What type of parameter passing does Java support?&lt;br /&gt;A: In Java the arguments are always passed by value .&lt;br /&gt;  [ Update from Eki and Jyothish Venu]    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Primitive data types are passed by reference or pass by value?&lt;br /&gt;A: Primitive data types are passed by value.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Objects are passed by value or by reference?&lt;br /&gt;A: Java only supports pass by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object .&lt;br /&gt;  [ Update from Eki and Jyothish Venu]    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is serialization?&lt;br /&gt;A: Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How do I serialize an object to a file?&lt;br /&gt;A: The class whose instances are to be serialized should implement an interface Serializable. Then you pass the instance to the ObjectOutputStream which is connected to a fileoutputstream. This will save the object to a file.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Which methods of Serializable interface should I implement?&lt;br /&gt;A: The serializable interface is an empty interface, it does not contain any methods. So we do not implement any methods.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How can I customize the seralization process? i.e. how can one have a control over the serialization process?&lt;br /&gt;A: Yes it is possible to have control over serialization process. The class should implement Externalizable interface. This interface contains two methods namely readExternal and writeExternal. You should implement these methods and write the logic for customizing the serialization process.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the common usage of serialization?&lt;br /&gt;A: Whenever an object is to be sent over the network, objects need to be serialized. Moreover if the state of an object is to be saved, objects need to be serilazed.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is Externalizable interface?&lt;br /&gt;A: Externalizable is an interface which contains two methods readExternal and writeExternal. These methods give you a control over the serialization mechanism. Thus if your class implements this interface, you can customize the serialization process by implementing these methods.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: When you serialize an object, what happens to the object references included in the object?&lt;br /&gt;A: The serialization mechanism generates an object graph for serialization. Thus it determines whether the included object references are serializable or not. This is a recursive process. Thus when an object is serialized, all the included objects are also serialized alongwith the original obect.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What one should take care of while serializing the object?&lt;br /&gt;A: One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a NotSerializableException.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What happens to the static fields of a class during serialization? &lt;br /&gt;A: There are three exceptions in which serialization doesnot necessarily read and write to the stream. These are&lt;br /&gt;1. Serialization ignores static fields, because they are not part of ay particular state state.&lt;br /&gt;2. Base class fields are only hendled if the base class itself is serializable.&lt;br /&gt;3. Transient fields. &lt;br /&gt;  [ Received from Sandesh Sadhale Modified after P.John David comments.]    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  Java Interview Questions        &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Question: Does Java provide any construct to find out the size of an object?&lt;br /&gt;&lt;br /&gt;Question: Give a simplest way to find out the time a method takes for execution without using any profiling tool? &lt;br /&gt;&lt;br /&gt;Question: What are wrapper classes?&lt;br /&gt;&lt;br /&gt;Question: Why do we need wrapper classes?  &lt;br /&gt;&lt;br /&gt;Question: What are checked exceptions? &lt;br /&gt;&lt;br /&gt;Question: What are runtime exceptions?&lt;br /&gt;&lt;br /&gt;Question: What is the difference between error and an exception??&lt;br /&gt;&lt;br /&gt;Question: How to create custom exceptions?&lt;br /&gt;&lt;br /&gt;Question: If I want an object of my class to be thrown as an exception object, what should I do?&lt;br /&gt;&lt;br /&gt;Question: If my class already extends from some other class what should I do if I want an instance of my class to be thrown as an exception object?&lt;br /&gt;&lt;br /&gt;Question: How does an exception permeate through the code?&lt;br /&gt;&lt;br /&gt;Question: What are the different ways to handle exceptions?&lt;br /&gt;&lt;br /&gt;Question: What is the basic difference between the 2 approaches to exception handling...1&gt; try catch block and 2&gt; specifying the candidate exceptions in the throws clause?&lt;br /&gt;When should you use which approach?&lt;br /&gt;&lt;br /&gt;Question: Is it necessary that each try block must be followed by a catch block?&lt;br /&gt;&lt;br /&gt;Question: If I write return at the end of the try block, will the finally block still execute?&lt;br /&gt;&lt;br /&gt;Question: If I write System.exit (0); at the end of the try block, will the finally block still execute?&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;Q: Does Java provide any construct to find out the size of an object?&lt;br /&gt;A: No there is not sizeof operator in Java. So there is not direct way to determine the size of an object directly in Java.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Give a simplest way to find out the time a method takes for execution without using any profiling tool?&lt;br /&gt;A: Read the system time just before the method is invoked and immediately after method returns. Take the time difference, which will give you the time taken by a method for execution. &lt;br /&gt;To put it in code...&lt;br /&gt;long start = System.currentTimeMillis ();&lt;br /&gt;method ();&lt;br /&gt;long end = System.currentTimeMillis ();&lt;br /&gt;System.out.println ("Time taken for execution is " + (end - start));&lt;br /&gt;Remember that if the time taken for execution is too small, it might show that it is taking zero milliseconds for execution. Try it on a method which is big enough, in the sense the one which is doing considerable amout of processing.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are wrapper classes?&lt;br /&gt;A: Java provides specialized classes corresponding to each of the primitive data types. These are called wrapper classes. They are e.g. Integer, Character, Double etc.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Why do we need wrapper classes?&lt;br /&gt;A: It is sometimes easier to deal with primitives as objects. Moreover most of the collection classes store objects and not primitive data types. And also the wrapper classes provide many utility methods also. Because of these resons we need wrapper classes. And since we create instances of these classes we can store them in any of the collection classes and pass them around as a collection. Also we can pass them around as method parameters where a method expects an object.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are checked exceptions?&lt;br /&gt;A: Checked exception are those which the Java compiler forces you to catch. e.g. IOException are checked Exceptions.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are runtime exceptions?&lt;br /&gt;A: Runtime exceptions are those exceptions that are thrown at runtime because of either wrong input data or because of wrong business logic etc. These are not checked by the compiler at compile time.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between error and an exception?&lt;br /&gt;A: An error is an irrecoverable condition occurring at runtime. Such as OutOfMemory error. These JVM errors and you can not repair them at runtime. While exceptions are conditions that occur because of bad input etc. e.g. FileNotFoundException will be thrown if the specified file does not exist. Or a NullPointerException will take place if you try using a null reference. In most of the cases it is possible to recover from an exception (probably by giving user a feedback for entering proper values etc.).&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How to create custom exceptions?&lt;br /&gt;A: Your class should extend class Exception, or some more specific type thereof.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: If I want an object of my class to be thrown as an exception object, what should I do?&lt;br /&gt;A: The class should extend from Exception class. Or you can extend your class from some more precise exception type also.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: If my class already extends from some other class what should I do if I want an instance of my class to be thrown as an exception object?&lt;br /&gt;A: One can not do anytihng in this scenarion. Because Java does not allow multiple inheritance and does not provide any exception interface as well.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How does an exception permeate through the code?&lt;br /&gt;A: An unhandled exception moves up the method stack in search of a matching When an exception is thrown from a code which is wrapped in a try block followed by one or more catch blocks, a search is made for matching catch block. If a matching type is found then that block will be invoked. If a matching type is not found then the exception moves up the method stack and reaches the caller method. Same procedure is repeated if the caller method is included in a try catch block. This process continues until a catch block handling the appropriate type of exception is found. If it does not find such a block then finally the program terminates.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are the different ways to handle exceptions?&lt;br /&gt;A: There are two ways to handle exceptions, &lt;br /&gt;1. By wrapping the desired code in a try block followed by a catch block to catch the exceptions. and &lt;br /&gt;2. List the desired exceptions in the throws clause of the method and let the caller of the method hadle those exceptions.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the basic difference between the 2 approaches to exception handling.&lt;br /&gt;1&gt; try catch block and &lt;br /&gt;2&gt; specifying the candidate exceptions in the throws clause?&lt;br /&gt;When should you use which approach?&lt;br /&gt;A: In the first approach as a programmer of the method, you urself are dealing with the exception. This is fine if you are in a best position to decide should be done in case of an exception. Whereas if it is not the responsibility of the method to deal with it's own exceptions, then do not use this approach. In this case use the second approach. In the second approach we are forcing the caller of the method to catch the exceptions, that the method is likely to throw. This is often the approach library creators use. They list the exception in the throws clause and we must catch them. You will find the same approach throughout the java libraries we use.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Is it necessary that each try block must be followed by a catch block?&lt;br /&gt;A: It is not necessary that each try block must be followed by a catch block. It should be followed by either a catch block OR a finally block. And whatever exceptions are likely to be thrown should be declared in the throws clause of the method.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: If I write return at the end of the try block, will the finally block still execute?&lt;br /&gt;A: Yes even if you write return as the last statement in the try block and no exception occurs, the finally block will execute. The finally block will execute and then the control return.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: If I write System.exit (0); at the end of the try block, will the finally block still execute?&lt;br /&gt;A: No in this case the finally block will not execute because when you say System.exit (0); the control immediately goes out of the program, and thus finally never executes.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Java Interview Questions        &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Question: How are Observer and Observable used?&lt;br /&gt;&lt;br /&gt;Question: What is synchronization and why is it important? &lt;br /&gt;&lt;br /&gt;Question: How does Java handle integer overflows and underflows?&lt;br /&gt;&lt;br /&gt;Question: Does garbage collection guarantee that a program will not run out of&lt;br /&gt;memory?  &lt;br /&gt;&lt;br /&gt;Question: What is the difference between preemptive scheduling and time slicing? &lt;br /&gt;&lt;br /&gt;Question: When a thread is created and started, what is its initial state?&lt;br /&gt;&lt;br /&gt;Question: What is the purpose of finalization?&lt;br /&gt;&lt;br /&gt;Question: What is the Locale class?&lt;br /&gt;&lt;br /&gt;Question: What is the difference between a while statement and a do statement?&lt;br /&gt;&lt;br /&gt;Question: What is the difference between static and non-static variables?&lt;br /&gt;&lt;br /&gt;Question: How are this() and super() used with constructors?&lt;br /&gt;&lt;br /&gt;Question: What are synchronized methods and synchronized statements?&lt;br /&gt;&lt;br /&gt;Question: What is daemon thread and which method is used to create the daemon thread?&lt;br /&gt;&lt;br /&gt;Question: Can applets communicate with each other?&lt;br /&gt;&lt;br /&gt;Question: What are the steps in the JDBC connection?&lt;br /&gt;&lt;br /&gt;Question: How does a try statement determine which catch clause should be used to handle an exception?&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;Q: How are Observer and Observable used?&lt;br /&gt;A: Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.&lt;br /&gt;  [Received from Venkateswara Manam] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is synchronization and why is it important?&lt;br /&gt;A: With respect to multithreading, synchronization is the capability to control&lt;br /&gt;the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.&lt;br /&gt;  [ Received from Venkateswara Manam] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How does Java handle integer overflows and underflows?&lt;br /&gt;A: It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Does garbage collection guarantee that a program will not run out of memory?&lt;br /&gt;A: Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection&lt;br /&gt;.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between preemptive scheduling and time slicing?&lt;br /&gt;A: Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: When a thread is created and started, what is its initial state?&lt;br /&gt;A: A thread is in the ready state after it has been created and started.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the purpose of finalization?&lt;br /&gt;A: The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the Locale class?&lt;br /&gt;A: The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between a while statement and a do statement?&lt;br /&gt;A: A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between static and non-static variables?&lt;br /&gt;A: A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How are this() and super() used with constructors?&lt;br /&gt;A: This() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are synchronized methods and synchronized statements?&lt;br /&gt;A: Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.&lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is daemon thread and which method is used to create the daemon thread?&lt;br /&gt;A: Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system. setDaemon method is used to create a daemon thread.&lt;br /&gt;  [ Received from Shipra Kamra]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can applets communicate with each other?&lt;br /&gt;A: At this point in time applets may communicate with other applets running in the same virtual machine. If the applets are of the same class, they can communicate via shared static variables. If the applets are of different classes, then each will need a reference to the same class with static variables. In any case the basic idea is to pass the information back and forth through a static variable. &lt;br /&gt;&lt;br /&gt;An applet can also get references to all other applets on the same page using the getApplets() method of java.applet.AppletContext. Once you get the reference to an applet, you can communicate with it by using its public members. &lt;br /&gt;&lt;br /&gt;It is conceivable to have applets in different virtual machines that talk to a server somewhere on the Internet and store any data that needs to be serialized there. Then, when another applet needs this data, it could connect to this same server. Implementing this is non-trivial. &lt;br /&gt;  [ Received from Krishna Kumar ]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are the steps in the JDBC connection?&lt;br /&gt;A:   While making a JDBC connection we go through the following steps : &lt;br /&gt;&lt;br /&gt;Step 1 : Register the database driver by using : &lt;br /&gt;Class.forName(\" driver classs for that specific database\" );&lt;br /&gt;Step 2 : Now create a database connection using :&lt;br /&gt;Connection con = DriverManager.getConnection(url,username,password);&lt;br /&gt;Step 3: Now Create a query using :&lt;br /&gt;Statement stmt = Connection.Statement(\"select * from TABLE NAME\");&lt;br /&gt;Step 4 : Exceute the query :&lt;br /&gt;stmt.exceuteUpdate();&lt;br /&gt;  [ Received from Shri Prakash Kunwar]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How does a try statement determine which catch clause should be used to handle an exception?&lt;br /&gt;A: When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exceptionis executed. The remaining catch clauses are ignored.&lt;br /&gt;  [ Received from P Rajesh]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Java Interview Questions        &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Question: Can an unreachable object become reachable again? &lt;br /&gt;&lt;br /&gt;Question: What method must be implemented by all threads? &lt;br /&gt;&lt;br /&gt;Question: What are synchronized methods and synchronized statements?&lt;br /&gt;&lt;br /&gt;Question: What is Externalizable?  &lt;br /&gt;&lt;br /&gt;Question: What modifiers are allowed for methods in an Interface? &lt;br /&gt;&lt;br /&gt;Question: What are some alternatives to inheritance?&lt;br /&gt;&lt;br /&gt;Question: What does it mean that a method or field is "static"? ?&lt;br /&gt;&lt;br /&gt;Question: What is the difference between preemptive scheduling and time slicing?&lt;br /&gt;&lt;br /&gt;Question: What is the catch or declare rule for method declarations? &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;Q: Can an unreachable object become reachable again?&lt;br /&gt;A: An unreachable object may become reachable again. This can happen when the object's finalize() method is invoked and the object performs an operation which causes it to become accessible to reachable objects.&lt;br /&gt;  [Received from P Rajesh] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What method must be implemented by all threads?&lt;br /&gt;A: All tasks must implement the run() method, whether they are a subclass of Thread or implement the Runnable interface.&lt;br /&gt;  [ Received from P Rajesh] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are synchronized methods and synchronized statements?&lt;br /&gt;A: Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.&lt;br /&gt;  [ Received from P Rajesh]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is Externalizable? &lt;br /&gt;A: Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out) and readExternal(ObjectInput in) &lt;br /&gt;  [ Received from Venkateswara Manam]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What modifiers are allowed for methods in an Interface?&lt;br /&gt;A: Only public and abstract modifiers are allowed for methods in interfaces. &lt;br /&gt;  [ Received from P Rajesh]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are some alternatives to inheritance?&lt;br /&gt;A: Delegation is an alternative to inheritance. Delegation means that you include an instance of another class as an instance variable, and forward messages to the instance. It is often safer than inheritance because it forces you to think about each message you forward, because the instance is of a known class, rather than a new class, and because it doesn't force you to accept all the methods of the super class: you can provide only the methods that really make sense. On the other hand, it makes you write more code, and it is harder to re-use (because it is not a subclass).&lt;br /&gt;  [ Received from P Rajesh]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What does it mean that a method or field is "static"? &lt;br /&gt;A: Static variables and methods are instantiated only once per class. In other words they are class variables, not instance variables. If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class. &lt;br /&gt;Static methods can be referenced with the name of the class rather than the name of a particular object of the class (though that works too). That's how library methods like System.out.println() work out is a static field in the java.lang.System class. &lt;br /&gt;  [ Received from P Rajesh]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between preemptive scheduling and time slicing?&lt;br /&gt;A: Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors. &lt;br /&gt;  [ Received from P Rajesh]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the catch or declare rule for method declarations? &lt;br /&gt;A: If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause. &lt;br /&gt;  [ Received from P Rajesh]&lt;br /&gt;&lt;br /&gt;Java Interview Questions        &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Question: Is Empty .java file a valid source file? &lt;br /&gt;&lt;br /&gt;Question: Can a .java file contain more than one java classes? &lt;br /&gt;&lt;br /&gt;Question: Is String a primitive data type in Java?&lt;br /&gt;&lt;br /&gt;Question: Is main a keyword in Java?  &lt;br /&gt;&lt;br /&gt;Question: Is next a keyword in Java? &lt;br /&gt;&lt;br /&gt;Question: Is delete a keyword in Java?&lt;br /&gt;&lt;br /&gt;Question: Is exit a keyword in Java?&lt;br /&gt;&lt;br /&gt;Question: What happens if you dont initialize an instance variable of any of the primitive types in Java?&lt;br /&gt;&lt;br /&gt;Question: What will be the initial value of an object reference which is defined as an instance variable? &lt;br /&gt;&lt;br /&gt;Question: What are the different scopes for Java variables? &lt;br /&gt;&lt;br /&gt;Question: What is the default value of the local variables? &lt;br /&gt;&lt;br /&gt;Question: How many objects are created in the following piece of code?&lt;br /&gt;MyClass c1, c2, c3;&lt;br /&gt;c1 = new MyClass ();&lt;br /&gt;c3 = new MyClass (); &lt;br /&gt;&lt;br /&gt;Question: Can a public class MyClass be defined in a source file named YourClass.java? &lt;br /&gt;&lt;br /&gt;Question: Can main method be declared final? &lt;br /&gt;&lt;br /&gt;Question: What will be the output of the following statement?&lt;br /&gt;System.out.println ("1" + 3); &lt;br /&gt;&lt;br /&gt;Question: What will be the default values of all the elements of an array defined as an instance variable? &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;Q: Is Empty .java file a valid source file?&lt;br /&gt;A: Yes, an empty .java file is a perfectly valid source file.&lt;br /&gt;  [Received from Sandesh Sadhale]    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can a .java file contain more than one java classes?&lt;br /&gt;A: Yes, a .java file contain more than one java classes, provided at the most one of them is a public class.&lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Is String a primitive data type in Java?&lt;br /&gt;A: No String is not a primitive data type in Java, even though it is one of the most extensively used object. Strings in Java are instances of String class defined in java.lang package.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Is main a keyword in Java? &lt;br /&gt;A: No, main is not a keyword in Java. &lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Is next a keyword in Java?&lt;br /&gt;A: No, next is not a keyword. &lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Is delete a keyword in Java?&lt;br /&gt;A: No, delete is not a keyword in Java. Java does not make use of explicit destructors the way C++ does.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Is exit a keyword in Java? &lt;br /&gt;A: No. To exit a program explicitly you use exit method in System object.&lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What happens if you dont initialize an instance variable of any of the primitive types in Java?&lt;br /&gt;A: Java by default initializes it to the default value for that primitive type. Thus an int will be initialized to 0, a boolean will be initialized to false. &lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What will be the initial value of an object reference which is defined as an instance variable? &lt;br /&gt;A: The object references are all initialized to null in Java. However in order to do anything useful with these references, you must set them to a valid object, else you will get NullPointerExceptions everywhere you try to use such default initialized references.&lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are the different scopes for Java variables? &lt;br /&gt;A: The scope of a Java variable is determined by the context in which the variable is declared. Thus a java variable can have one of the three scopes at any given point in time.&lt;br /&gt;1. Instance : - These are typical object level variables, they are initialized to default values at the time of creation of object, and remain accessible as long as the object accessible.&lt;br /&gt;2. Local : - These are the variables that are defined within a method. They remain accessbile only during the course of method excecution. When the method finishes execution, these variables fall out of scope.&lt;br /&gt;3. Static: - These are the class level variables. They are initialized when the class is loaded in JVM for the first time and remain there as long as the class remains loaded. They are not tied to any particular object instance.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the default value of the local variables? &lt;br /&gt;A: The local variables are not initialized to any default value, neither primitives nor object references. If you try to use these variables without initializing them explicitly, the java compiler will not compile the code. It will complain abt the local varaible not being initilized..&lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How many objects are created in the following piece of code?&lt;br /&gt;MyClass c1, c2, c3;&lt;br /&gt;c1 = new MyClass ();&lt;br /&gt;c3 = new MyClass ();&lt;br /&gt;A: Only 2 objects are created, c1 and c3. The reference c2 is only declared and not initialized.&lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can a public class MyClass be defined in a source file named YourClass.java? &lt;br /&gt;A: No the source file name, if it contains a public class, must be the same as the public class name itself with a .java extension.&lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can main method be declared final? &lt;br /&gt;A: Yes, the main method can be declared final, in addition to being public static.&lt;br /&gt;  [ Received fromSandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What will be the output of the following statement?&lt;br /&gt;System.out.println ("1" + 3); &lt;br /&gt;A: It will print 13.&lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What will be the default values of all the elements of an array defined as an instance variable? &lt;br /&gt;A: If the array is an array of primitive types, then all the elements of the array will be initialized to the default value corresponding to that primitive type. e.g. All the elements of an array of int will be initialized to 0, while that of boolean type will be initialized to false. Whereas if the array is an array of references (of any type), all the elements will be initialized to null. &lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Java Collection Interview Questions &lt;br /&gt;&lt;br /&gt;Question: What is the Collections API? &lt;br /&gt;&lt;br /&gt; Question: What is the List interface?  &lt;br /&gt;&lt;br /&gt;Question:  What is the Vector class?&lt;br /&gt;&lt;br /&gt;Question:  What is an Iterator interface?  &lt;br /&gt;&lt;br /&gt;Question:  Which java.util classes and interfaces support event handling? &lt;br /&gt;&lt;br /&gt;Question:  What is the GregorianCalendar class? &lt;br /&gt;&lt;br /&gt;Question:  What is the Locale class? &lt;br /&gt;&lt;br /&gt;Question: What is the SimpleTimeZone class?&lt;br /&gt;&lt;br /&gt;Question:  What is the Map interface? &lt;br /&gt;&lt;br /&gt;Question:  What is the highest-level event class of the event-delegation model? &lt;br /&gt;&lt;br /&gt;Question:  What is the Collection interface? &lt;br /&gt;&lt;br /&gt;Question:  What is the Set interface? &lt;br /&gt;&lt;br /&gt;Question: What is the typical use of Hashtable?&lt;br /&gt;&lt;br /&gt;Question: I am trying to store an object using a key in a Hashtable. And some other object already exists in that location, then what will happen? The existing object will be overwritten? Or the new object will be stored elsewhere? &lt;br /&gt;&lt;br /&gt;Question: What is the difference between the size and capacity of a Vector?&lt;br /&gt;&lt;br /&gt;Question: Can a vector contain heterogenous objects?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the Collections API? &lt;br /&gt;A: The Collections API is a set of classes and interfaces that support operations on collections of objects.&lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the List interface?&lt;br /&gt;A: The List interface provides support for ordered collections of objects. &lt;br /&gt;  [ Received from SPrasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the Vector class?&lt;br /&gt;A: The Vector class provides the capability to implement a growable array of objects.  &lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is an Iterator interface? &lt;br /&gt;A: The Iterator interface is used to step through the elements of a Collection .&lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Which java.util classes and interfaces support event handling? &lt;br /&gt;A: The EventObject class and the EventListener interface support event processing.&lt;br /&gt;  [ Received from Prasanna Inamanamelluri]&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the GregorianCalendar class? &lt;br /&gt;A: The GregorianCalendar provides support for traditional Western calendars &lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the Locale class? &lt;br /&gt;A: The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region .&lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the SimpleTimeZone class?&lt;br /&gt;A: The SimpleTimeZone class provides support for a Gregorian calendar .&lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the Map interface? &lt;br /&gt;A: The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys with values.&lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the highest-level event class of the event-delegation model?&lt;br /&gt;A: The java.util.EventObject class is the highest-level class in the event-delegation class hierarchy.&lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the Collection interface? &lt;br /&gt;A: The Collection interface provides support for the implementation of a mathematical bag - an unordered collection of objects that may contain duplicates.&lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the Set interface? &lt;br /&gt;A: The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements. &lt;br /&gt;  [ Received from Prasanna Inamanamelluri] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the typical use of Hashtable?&lt;br /&gt;A: Whenever a program wants to store a key value pair, one can use Hashtable.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: I am trying to store an object using a key in a Hashtable. And some other object already exists in that location, then what will happen? The existing object will be overwritten? Or the new object will be stored elsewhere?&lt;br /&gt;A: The existing object will be overwritten and thus it will be lost.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference between the size and capacity of a Vector?&lt;br /&gt;A: The size is the number of elements actually stored in the vector, while capacity is the maximum number of elements it can store at a given instance of time.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can a vector contain heterogenous objects?&lt;br /&gt;A: Yes a Vector can contain heterogenous objects. Because a Vector stores everything in terms of Object.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can a ArrayList contain heterogenous objects?&lt;br /&gt;A: Yes a ArrayList can contain heterogenous objects. Because a ArrayList stores everything in terms of Object.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is an enumeration?&lt;br /&gt;A: An enumeration is an interface containing methods for accessing the underlying data structure from which the enumeration is obtained. It is a construct which collection classes return when you request a collection of all the objects stored in the collection. It allows sequential access to all the elements stored in the collection.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Considering the basic properties of Vector and ArrayList, where will you use Vector and where will you use ArrayList?&lt;br /&gt;A: The basic difference between a Vector and an ArrayList is that, vector is synchronized while ArrayList is not. Thus whenever there is a possibility of multiple threads accessing the same instance, one should use Vector. While if not multiple threads are going to access the same instance then use ArrayList. Non synchronized data structure will give better performance than the synchronized one.&lt;br /&gt;  [ Received from Sandesh Sadhale] &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can a vector contain heterogenous objects?&lt;br /&gt;A: Yes a Vector can contain heterogenous objects. Because a Vector stores everything in terms of Object.&lt;br /&gt;  [ Received from Sandesh Sadhale]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-2945009653980538921?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/2945009653980538921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=2945009653980538921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/2945009653980538921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/2945009653980538921'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/java-interview-questions.html' title='Java Interview Questions'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-7373238701643933306</id><published>2009-02-07T16:24:00.001+05:30</published><updated>2009-02-07T16:25:50.887+05:30</updated><title type='text'>C/C++ Algorithm for Interview</title><content type='html'>1. Reverse a singly linked list&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// iterative version&lt;br /&gt;//&lt;br /&gt;Node* ReverseList( Node ** List ) &lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; Node *temp1 = *List;&lt;br /&gt; Node * temp2 = NULL;&lt;br /&gt; Node * temp3 = NULL;&lt;br /&gt;&lt;br /&gt; while ( temp1 )&lt;br /&gt; {&lt;br /&gt;  *List = temp1; //set the head to last node  &lt;br /&gt;temp2= temp1-&gt;pNext; // save the next ptr in temp2&lt;br /&gt;  temp1-&gt;pNext = temp3; // change next to privous&lt;br /&gt;  temp3 = temp1;&lt;br /&gt;  temp1 = temp2;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; return *List;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Delete a node in double linked list&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void deleteNode(node *n)&lt;br /&gt;{&lt;br /&gt;node *np = n-&gt;prev;&lt;br /&gt;node *nn = n-&gt;next;&lt;br /&gt;np-&gt;next = n-&gt;next;&lt;br /&gt;nn-&gt;prev = n-&gt;prev;&lt;br /&gt;delete n;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;3. Sort a linked list&lt;br /&gt;&lt;br /&gt;//sorting in descending order&lt;br /&gt;struct node&lt;br /&gt;{&lt;br /&gt;int value;&lt;br /&gt;node* NEXT;&lt;br /&gt;}&lt;br /&gt;//Assume HEAD pointer denotes the first element in the //linked list&lt;br /&gt;// only change the values…don’t have to change the //pointers&lt;br /&gt;&lt;br /&gt;Sort( Node *Head)&lt;br /&gt;{&lt;br /&gt;node* first,second,temp;&lt;br /&gt;first= Head;&lt;br /&gt;while(first!=null)&lt;br /&gt;{&lt;br /&gt;second=first-&gt;NEXT;&lt;br /&gt;while(second!=null)&lt;br /&gt;{&lt;br /&gt;if(first-&gt;value &lt; second-&gt;value)&lt;br /&gt;{&lt;br /&gt;temp = new node();&lt;br /&gt;temp-&gt;value=first-&gt;value;&lt;br /&gt;first-&gt;value=second-&gt;value;&lt;br /&gt;second-&gt;value=temp-&gt;value;&lt;br /&gt;delete temp;&lt;br /&gt;}&lt;br /&gt;second=second-&gt;NEXT;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;first=first-&gt;NEXT;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;4. Reverse a string&lt;br /&gt;&lt;br /&gt;void ReverseString (char *String)&lt;br /&gt;{&lt;br /&gt;char *Begin = String;&lt;br /&gt;char *End = String + strlen(String) - 1;&lt;br /&gt;char TempChar = '\0';&lt;br /&gt;&lt;br /&gt;while (Begin &lt; End) &lt;br /&gt;{&lt;br /&gt;TempChar = *Begin;&lt;br /&gt;*Begin = *End;&lt;br /&gt;*End = TempChar;&lt;br /&gt;Begin++;&lt;br /&gt;End--;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;5. Insert a node a sorted linked list&lt;br /&gt;&lt;br /&gt;void sortedInsert(Node * head, Node* newNode)&lt;br /&gt;{&lt;br /&gt;Node *current = head;&lt;br /&gt;      &lt;br /&gt;// traverse the list until you find item bigger the // new node value&lt;br /&gt;   // &lt;br /&gt;while (current!= NULL &amp;&amp; current-&gt;data &lt; newNode-&gt;data)&lt;br /&gt;{&lt;br /&gt;current = current-&gt;next);&lt;br /&gt;}&lt;br /&gt;//&lt;br /&gt;// insert the new node before the big item&lt;br /&gt;//&lt;br /&gt;newNode-&gt;next = current-&gt;next;&lt;br /&gt;current = newNode;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Covert a string to upper case&lt;br /&gt;&lt;br /&gt;void ToUpper(char * S)&lt;br /&gt;{&lt;br /&gt;while (*S!=0)&lt;br /&gt;{&lt;br /&gt;*S=(*S &gt;= 'a' &amp;&amp; *S &lt;= 'z')?(*S-'a'+'A'):*S;&lt;br /&gt;S++;&lt;br /&gt;}&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. Multiple a number by 7 without using * and + operator.&lt;br /&gt;&lt;br /&gt; NewNum = Num &lt;&lt; 3; // mulitplied by 2 ^ 3 = 8&lt;br /&gt;&lt;br /&gt; NewNum = NewNum - Num; // 8 – 1 = 7&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;8. Write a function that takes in a string parameter and checks to see whether or not it is an integer, and if it is then return the integer value.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int strtoint(char *s)&lt;br /&gt;{&lt;br /&gt;int index = 0, flag = 0;&lt;br /&gt;&lt;br /&gt;while( *(s+index) != '\0')&lt;br /&gt;{&lt;br /&gt;if( (*(s + index) &gt;= '0') &amp;&amp; &lt;br /&gt;*(s + index) &lt;= '9')&lt;br /&gt;{&lt;br /&gt;flag = 1;&lt;br /&gt;index++;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;flag = 0;&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if( flag == 1 )&lt;br /&gt;return atoi(s);&lt;br /&gt;else&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;main() &lt;br /&gt;{ &lt;br /&gt;printf("%d",strtoint("0123")); &lt;br /&gt;printf("\n%d",strtoint("0123ii")); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;9. Print a data from a binary tree – In-order(ascending)&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// recursive version&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt;Void PrintTree ( struct * node node )&lt;br /&gt;{&lt;br /&gt; if ( node == NULL )&lt;br /&gt;  return;&lt;br /&gt;&lt;br /&gt; PrintTree(node-&gt;left );&lt;br /&gt; Printf(“%d”, node-&gt;data);&lt;br /&gt; PrintTree(node-&gt;right );&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;10. print integer using only putchar&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// recursive version&lt;br /&gt;//&lt;br /&gt;void PrintNum ( int Num )&lt;br /&gt;{&lt;br /&gt; if ( Num == 0 )&lt;br /&gt;  return;&lt;br /&gt; PrintNum ( Num / 10 );&lt;br /&gt; Puthcar ( ‘0’+ Num % 10 );&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;11. Find the factorial of number&lt;br /&gt;&lt;br /&gt; //&lt;br /&gt; // recursive version&lt;br /&gt; //&lt;br /&gt;&lt;br /&gt; int Factorial( int Num )&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt; If ( num &gt; 0 )&lt;br /&gt; return Num * Factorial ( Num –1 ); &lt;br /&gt;else&lt;br /&gt; return 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// iterative version&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt; int Factorial( int Num )&lt;br /&gt; {&lt;br /&gt; int I&lt;br /&gt; int result = 1;&lt;br /&gt; &lt;br /&gt;for ( I= Num; I &gt; 0; I-- )&lt;br /&gt;{&lt;br /&gt; result = result * I;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return result;&lt;br /&gt;}&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;12. Generate Fib numbers:&lt;br /&gt;&lt;br /&gt;int fib( n ) // recursive version&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; if ( n &lt; 2 )&lt;br /&gt;  return 1;&lt;br /&gt; else&lt;br /&gt;  return fib ( n –1 ) + fib ( n –2 );&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int fib( n ) //iterative version&lt;br /&gt;{&lt;br /&gt; int f1 =1, f2 = 1;&lt;br /&gt;&lt;br /&gt; if ( n &lt; 2 )&lt;br /&gt;  return 1; &lt;br /&gt; for ( i = 1; i &lt; N; i++)&lt;br /&gt; {&lt;br /&gt;  f = f1 + f2;&lt;br /&gt;  f1= f2;&lt;br /&gt;  f = f1;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return f;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;13. Write a function that finds the last instance of a character in a string&lt;br /&gt;&lt;br /&gt;char *lastchar(char *String, char ch)&lt;br /&gt;{&lt;br /&gt;char *pStr = NULL;&lt;br /&gt;&lt;br /&gt; // traverse the entire string&lt;br /&gt; &lt;br /&gt;while( * String ++ != NULL ) &lt;br /&gt;{&lt;br /&gt;if( *String == ch ) &lt;br /&gt;pStr = String;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;return pStr;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;14. Return Nth the node from the end of the linked list in one pass.&lt;br /&gt;&lt;br /&gt;Node * GetNthNode ( Node* Head , int NthNode )&lt;br /&gt;{&lt;br /&gt; Node * pNthNode = NULL;&lt;br /&gt; Node * pTempNode = NULL;&lt;br /&gt; int nCurrentElement = 0;&lt;br /&gt; &lt;br /&gt;for ( pTempNode = Head; pTempNode != NULL; pTempNode = pTempNode-&gt;pNext )&lt;br /&gt; {&lt;br /&gt;  nCurrentElement++;   &lt;br /&gt;  if ( nCurrentElement - NthNode == 0 )&lt;br /&gt;  {&lt;br /&gt;   pNthNode = Head;&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  if ( nCurrentElement - NthNode &gt; 0)&lt;br /&gt;  {&lt;br /&gt;   pNthNode = pNthNode -&gt;pNext;&lt;br /&gt;  }     &lt;br /&gt; }&lt;br /&gt; if (pNthNode )&lt;br /&gt; {&lt;br /&gt;  return pNthNode;&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt;  return NULL;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;15. Counting set bits in a number.&lt;br /&gt;&lt;br /&gt;First version:&lt;br /&gt;&lt;br /&gt;int CoutSetBits(int Num)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;for(int count=0; Num; Num &gt;&gt;= 1)&lt;br /&gt;{&lt;br /&gt;      if (Num &amp; 1) &lt;br /&gt;count++;&lt;br /&gt;}&lt;br /&gt;return count;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Optimized version:&lt;br /&gt;&lt;br /&gt;int CoutSetBits(int Num)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;for(int count =0; Num; count++)&lt;br /&gt;{&lt;br /&gt;      Num &amp;= Num -1;&lt;br /&gt; }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-7373238701643933306?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/7373238701643933306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=7373238701643933306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/7373238701643933306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/7373238701643933306'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/cc-algorithm-for-interview.html' title='C/C++ Algorithm for Interview'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-526989802392365166</id><published>2009-02-07T16:22:00.000+05:30</published><updated>2009-02-07T16:24:12.776+05:30</updated><title type='text'>DBMS Interview Question and Answer</title><content type='html'>DBMS Interview Questions and Answers &lt;br /&gt;QUESTION 1:&lt;br /&gt;What is database?&lt;br /&gt;ANSWER:&lt;br /&gt;A database is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and which is designed, built and populated with data for a specific purpose.&lt;br /&gt;QUESTION 2:&lt;br /&gt;What is DBMS?&lt;br /&gt;ANSWER:&lt;br /&gt;• Redundancy is controlled.&lt;br /&gt;• Unauthorised access is restricted.&lt;br /&gt;• Providing multiple user interfaces.&lt;br /&gt;• Enforcing integrity constraints.&lt;br /&gt;• Providing backup and recovery.&lt;br /&gt;QUESTION 4:&lt;br /&gt;What is a Database system?&lt;br /&gt;ANSWER:&lt;br /&gt;The database and DBMS software together is called as Database system.&lt;br /&gt;QUESTION 5:&lt;br /&gt;Disadvantage in File Processing System?&lt;br /&gt;ANSWER:&lt;br /&gt;• Data redundancy &amp; inconsistency.&lt;br /&gt;• Difficult in accessing data.&lt;br /&gt;• Data isolation.&lt;br /&gt;• Data integrity.&lt;br /&gt;• Concurrent access is not possible.&lt;br /&gt;• Security Problems. .&lt;br /&gt;QUESTION 6:&lt;br /&gt;Describe the three levels of data abstraction?&lt;br /&gt;ANSWER:&lt;br /&gt;The are three levels of abstraction:&lt;br /&gt;• Physical level: The lowest level of abstraction describes how data are stored.&lt;br /&gt;• Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data.&lt;br /&gt;• View level: The highest level of abstraction describes only part of entire database.&lt;br /&gt;QUESTION 7:&lt;br /&gt;Define the "integrity rules"&lt;br /&gt;ANSWER:&lt;br /&gt;There are two Integrity rules.&lt;br /&gt;• Entity Integrity: States that “Primary key cannot have NULL value”&lt;br /&gt;• Referential Integrity: States that “Foreign Key can be either a NULL value or should be Primary Key value of other relation.&lt;br /&gt;QUESTION 8:&lt;br /&gt;What is extension and intension?&lt;br /&gt;ANSWER:&lt;br /&gt;Extension -It is the number of tuples present in a table at any instance. This is time dependent.&lt;br /&gt;Intension - It is a constant value that gives the name, structure of table and the constraints laid on it.&lt;br /&gt;QUESTION 9:&lt;br /&gt;What is System R? What are its two major subsystems?&lt;br /&gt;ANSWER:&lt;br /&gt;System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center . It is a prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be used in a real life environment to solve real life problems, with performance at least comparable to that of existing system.&lt;br /&gt;Its two subsystems are&lt;br /&gt;• Research Storage&lt;br /&gt;• System Relational Data System.&lt;br /&gt;QUESTION 10:&lt;br /&gt;How is the data structure of System R different from the relational structure?&lt;br /&gt;ANSWER:&lt;br /&gt;Unlike Relational systems in System R&lt;br /&gt;• Domains are not supported&lt;br /&gt;• Enforcement of candidate key uniqueness is optional&lt;br /&gt;• Enforcement of entity integrity is optional&lt;br /&gt;• Referential integrity is not enforced &lt;br /&gt;QUESTION 11:&lt;br /&gt;What is Data Independence?&lt;br /&gt;ANSWER:&lt;br /&gt;Data independence means that “the application is independent of the storage structure and access strategy of data”. In other words, The ability to modify the schema definition in one level should not affect the schema definition in the next higher level.&lt;br /&gt;Two types of Data Independence:&lt;br /&gt;• Physical Data Independence : Modification in physical level should not affect the logical level.&lt;br /&gt;• Logical Data Independence : Modification in logical level should affect the view level.&lt;br /&gt;NOTE: Logical Data Independence is more difficult to achieve&lt;br /&gt;QUESTION 12:&lt;br /&gt;What is a view? How it is related to data independence?&lt;br /&gt;ANSWER:&lt;br /&gt;A view may be thought of as a virtual table, that is, a table that does not really exist in its own right but is instead derived from one or more underlying base table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary.&lt;br /&gt;Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the effects of restructuring and growth in the database. Hence accounts for logical data independence. .&lt;br /&gt;QUESTION 13:&lt;br /&gt;What is Data Model?&lt;br /&gt;ANSWER:&lt;br /&gt;A collection of conceptual tools for describing data, data relationships data semantics and constraints.&lt;br /&gt;QUESTION 14:&lt;br /&gt;What is E-R model?&lt;br /&gt;ANSWER:&lt;br /&gt;This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entities are described in a database by a set of attributes.&lt;br /&gt;QUESTION 15:&lt;br /&gt;What is Object Oriented model?&lt;br /&gt;ANSWER:&lt;br /&gt;This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes.&lt;br /&gt;QUESTION 16:&lt;br /&gt;What is an Entity?&lt;br /&gt;ANSWER:&lt;br /&gt;It is a 'thing' in the real world with an independent existence.&lt;br /&gt;QUESTION 17:&lt;br /&gt;What is an Entity type?&lt;br /&gt;ANSWER:&lt;br /&gt;It is a collection (set) of entities that have same attributes.&lt;br /&gt;QUESTION 18:&lt;br /&gt;What is an Entity set?&lt;br /&gt;ANSWER:&lt;br /&gt;It is a collection of all entities of particular entity type in the database.&lt;br /&gt;QUESTION 19:&lt;br /&gt;What is an Extension of entity type?&lt;br /&gt;ANSWER:&lt;br /&gt;The collections of entities of a particular entity type are grouped together into an entity set.&lt;br /&gt;QUESTION 20:&lt;br /&gt;What is Weak Entity set?&lt;br /&gt;ANSWER:&lt;br /&gt;An entity set may not have sufficient attributes to form a primary key, and its primary key compromises of its partial key and primary key of its parent entity, then it is said to be Weak Entity set. &lt;br /&gt;QUESTION 21:&lt;br /&gt;What is an attribute?&lt;br /&gt;ANSWER:&lt;br /&gt;It is a particular property, which describes the entity.&lt;br /&gt;QUESTION 22:&lt;br /&gt;What is a Relation Schema and a Relation?&lt;br /&gt;ANSWER:&lt;br /&gt;A relation Schema denoted by R(A1, A2, …, An) is made up of the relation name R and the list of attributes Ai that it contains. A relation is defined as a set of tuples. Let r be the relation which contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list of n-values t=(v1,v2, ..., vn).&lt;br /&gt;QUESTION 23:&lt;br /&gt;What is degree of a Relation?&lt;br /&gt;ANSWER:&lt;br /&gt;It is the number of attribute of its relation schema.&lt;br /&gt;QUESTION 24:&lt;br /&gt;What is Relationship?&lt;br /&gt;ANSWER:&lt;br /&gt;It is an association among two or more entities.&lt;br /&gt;QUESTION 25:&lt;br /&gt;What is Relationship set?&lt;br /&gt;ANSWER:&lt;br /&gt;The collection (or set) of similar relationships.&lt;br /&gt;QUESTION 26:&lt;br /&gt;What is Relationship type?&lt;br /&gt;ANSWER:&lt;br /&gt;Relationship type defines a set of associations or a relationship set among a given set of entity types.&lt;br /&gt;QUESTION 27:&lt;br /&gt;What is degree of Relationship type?&lt;br /&gt;ANSWER:&lt;br /&gt;It is the number of entity type participating.&lt;br /&gt;QUESTION 28:&lt;br /&gt;What is Data Storage - Definition Language?&lt;br /&gt;ANSWER:&lt;br /&gt;The storage structures and access methods used by database system are specified by a set of definition in a special type of DDL called data storage-definition language.&lt;br /&gt;QUESTION 29:&lt;br /&gt;What is DML (Data Manipulation Language)?&lt;br /&gt;ANSWER:&lt;br /&gt;This language that enable user to access or manipulate data as organised by appropriate data model.&lt;br /&gt;• Procedural DML or Low level: DML requires a user to specify what data are needed and how to get those data.&lt;br /&gt;• Non-Procedural DML or High level: DML requires a user to specify what data are needed without specifying how to get those data.&lt;br /&gt;QUESTION 30:&lt;br /&gt;What is VDL (View Definition Language)?&lt;br /&gt;ANSWER:&lt;br /&gt;It specifies user views and their mappings to the conceptual schema. &lt;br /&gt;QUESTION 31:&lt;br /&gt;What is DML Compiler?&lt;br /&gt;ANSWER:&lt;br /&gt;It translates DML statements in a query language into low-level instruction that the query evaluation engine can understand.&lt;br /&gt;QUESTION 32:&lt;br /&gt;What is Query evaluation engine?&lt;br /&gt;ANSWER:&lt;br /&gt;It executes low-level instruction generated by compiler.&lt;br /&gt;QUESTION 33:&lt;br /&gt;What is DDL Interpreter?&lt;br /&gt;ANSWER:&lt;br /&gt;It interprets DDL statements and record them in tables containing metadata.&lt;br /&gt;QUESTION 34:&lt;br /&gt;What is Record-at-a-time?&lt;br /&gt;ANSWER:&lt;br /&gt;The Low level or Procedural DML can specify and retrieve each record from a set of records. This retrieve of a record is said to be Record-at-a-time.&lt;br /&gt;QUESTION 35:&lt;br /&gt;What is Set-at-a-time or Set-oriented?&lt;br /&gt;ANSWER:&lt;br /&gt;The High level or Non-procedural DML can specify and retrieve many records in a single DML statement. This retrieve of a record is said to be Set-at-a-time or Set-oriented.&lt;br /&gt;QUESTION 36:&lt;br /&gt;What is Relational Algebra?&lt;br /&gt;ANSWER:&lt;br /&gt;It is procedural query language. It consists of a set of operations that take one or two relations as input and produce a new relation.&lt;br /&gt;QUESTION 37:&lt;br /&gt;What is Relational Calculus?&lt;br /&gt;ANSWER:&lt;br /&gt;It is an applied predicate calculus specifically tailored for relational databases proposed by E.F. Codd. E.g. of languages based on it are DSL ALPHA, QUEL.&lt;br /&gt;QUESTION 38:&lt;br /&gt;How does Tuple-oriented relational calculus differ from domain-oriented relational calculus&lt;br /&gt;ANSWER:&lt;br /&gt;The tuple-oriented calculus uses a tuple variables i.e., variable whose only permitted values are tuples of that relation. E.g. QUEL&lt;br /&gt;The domain-oriented calculus has domain variables i.e., variables that range over the underlying domains instead of over relation. E.g. ILL, DEDUCE.&lt;br /&gt;QUESTION 39:&lt;br /&gt;What is normalization?&lt;br /&gt;ANSWER:&lt;br /&gt;It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties&lt;br /&gt;• Minimizing redundancy&lt;br /&gt;• Minimizing insertion, deletion and update anomalies.&lt;br /&gt;QUESTION 40:&lt;br /&gt;What is Functional Dependency?&lt;br /&gt;ANSWER:&lt;br /&gt;A Functional dependency is denoted by X Y between two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely determines the value of component Y. &lt;br /&gt;QUESTION 41:&lt;br /&gt;When is a functional dependency F said to be minimal?&lt;br /&gt;ANSWER:&lt;br /&gt;• Every dependency in F has a single attribute for its right hand side.&lt;br /&gt;• We cannot replace any dependency X A in F with a dependency Y A where Y is a proper subset of X and still have a set of dependency that is equivalent to F.&lt;br /&gt;• We cannot remove any dependency from F and still have set of dependency that is equivalent to F.&lt;br /&gt;QUESTION 42:&lt;br /&gt;What is Multivalued dependency?&lt;br /&gt;ANSWER:&lt;br /&gt;Multivalued dependency denoted by X Y specified on relation schema R, where X and Y are both subsets of R, specifies the following constraint on any relation r of R: if two tuples t1 and t2 exist in r such that t1[X] = t2[X] then t3 and t4 should also exist in r with the following properties&lt;br /&gt;• t3[x] = t4[X] = t1[X] = t2[X]&lt;br /&gt;• t3[Y] = t1[Y] and t4[Y] = t2[Y]&lt;br /&gt;• t3[Z] = t2[Z] and t4[Z] = t1[Z]&lt;br /&gt;where [Z = (R-(X U Y)) ]&lt;br /&gt;QUESTION 43:&lt;br /&gt;What is Lossless join property?&lt;br /&gt;ANSWER:&lt;br /&gt;It guarantees that the spurious tuple generation does not occur with respect to relation schemas after decomposition.&lt;br /&gt;QUESTION 44:&lt;br /&gt;What is 1 NF (Normal Form)?&lt;br /&gt;ANSWER:&lt;br /&gt;The domain of attribute must include only atomic (simple, indivisible) values.&lt;br /&gt;QUESTION 45:&lt;br /&gt;What is Fully Functional dependency?&lt;br /&gt;ANSWER:&lt;br /&gt;It is based on concept of full functional dependency. A functional dependency X Y is full functional dependency if removal of any attribute A from X means that the dependency does not hold any more.&lt;br /&gt;QUESTION 46:&lt;br /&gt;What is 2NF?&lt;br /&gt;ANSWER:&lt;br /&gt;A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key.&lt;br /&gt;QUESTION 47:&lt;br /&gt;What is 3NF?&lt;br /&gt;ANSWER:&lt;br /&gt;A relation schema R is in 3NF if it is in 2NF and for every FD X A either of the following is true&lt;br /&gt;• X is a Super-key of R.&lt;br /&gt;• A is a prime attribute of R.&lt;br /&gt;In other words, if every non prime attribute is non-transitively dependent on primary key.&lt;br /&gt;QUESTION 48:&lt;br /&gt;What is BCNF (Boyce-Codd Normal Form)?&lt;br /&gt;ANSWER:&lt;br /&gt;A relation schema R is in BCNF if it is in 3NF and satisfies an additional constraint that for every FD X A, X must be a candidate key.&lt;br /&gt;QUESTION 49:&lt;br /&gt;What is 4NF?&lt;br /&gt;ANSWER:&lt;br /&gt;A relation schema R is said to be in 4NF if for every Multivalued dependency X Y that holds over R, one of following is true&lt;br /&gt;• X is subset or equal to (or) XY = R.&lt;br /&gt;• X is a super key.&lt;br /&gt;QUESTION 50:&lt;br /&gt;What is 5NF?&lt;br /&gt;ANSWER:&lt;br /&gt;A Relation schema R is said to be 5NF if for every join dependency {R1, R2, ..., Rn} that holds R, one the following is true&lt;br /&gt;• Ri = R for some i.&lt;br /&gt;• The join dependency is implied by the set of FD, over R in which the left side is key of R.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-526989802392365166?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/526989802392365166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=526989802392365166' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/526989802392365166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/526989802392365166'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/dbms-interview-question-and-answer.html' title='DBMS Interview Question and Answer'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-2974961069384288090</id><published>2009-02-07T16:21:00.000+05:30</published><updated>2009-02-07T16:22:37.951+05:30</updated><title type='text'>DATA BASE MANAGEMENT SYSTEM</title><content type='html'>1. What is database? &lt;br /&gt;A database is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and which is designed, built and populated with data for a specific purpose. &lt;br /&gt;&lt;br /&gt;2. What is DBMS? &lt;br /&gt;It is a collection of programs that enables user to create and maintain a database. In other words it is general-purpose software that provides the users with the processes of defining, constructing and manipulating the database for various applications. &lt;br /&gt;&lt;br /&gt;3. What is a Database system? &lt;br /&gt;The database and DBMS software together is called as Database system. &lt;br /&gt;&lt;br /&gt;4. Advantages of DBMS? &lt;br /&gt;Ø Redundancy is controlled. &lt;br /&gt;Ø Unauthorised access is restricted. &lt;br /&gt;Ø Providing multiple user interfaces. &lt;br /&gt;Ø Enforcing integrity constraints. &lt;br /&gt;Ø Providing backup and recovery. &lt;br /&gt;&lt;br /&gt;5. Disadvantage in File Processing System? &lt;br /&gt;Ø Data redundancy &amp; inconsistency. &lt;br /&gt;Ø Difficult in accessing data. &lt;br /&gt;Ø Data isolation. &lt;br /&gt;Ø Data integrity. &lt;br /&gt;Ø Concurrent access is not possible. &lt;br /&gt;Ø Security Problems. &lt;br /&gt;&lt;br /&gt;6. Describe the three levels of data abstraction? &lt;br /&gt;The are three levels of abstraction: &lt;br /&gt;Ø Physical level: The lowest level of abstraction describes how data are stored. &lt;br /&gt;Ø Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data. &lt;br /&gt;Ø View level: The highest level of abstraction describes only part of entire database. &lt;br /&gt;7. Define the "integrity rules" &lt;br /&gt;There are two Integrity rules. &lt;br /&gt;Ø Entity Integrity: States that "Primary key cannot have NULL value" &lt;br /&gt;Ø Referential Integrity: States that "Foreign Key can be either a NULL value or should be Primary Key value of other relation. &lt;br /&gt;&lt;br /&gt;8. What is extension and intension? &lt;br /&gt;Extension - &lt;br /&gt;It is the number of tuples present in a table at any instance. This is time dependent. &lt;br /&gt;Intension - &lt;br /&gt;It is a constant value that gives the name, structure of table and the constraints laid on it. &lt;br /&gt;&lt;br /&gt;9. What is System R? What are its two major subsystems? &lt;br /&gt;System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center. It is a prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be used in a real life environment to solve real life problems, with performance at least comparable to that of existing system. &lt;br /&gt;Its two subsystems are &lt;br /&gt;Ø Research Storage &lt;br /&gt;Ø System Relational Data System. &lt;br /&gt;&lt;br /&gt;10. How is the data structure of System R different from the relational structure? &lt;br /&gt;Unlike Relational systems in System R &lt;br /&gt;Ø Domains are not supported &lt;br /&gt;Ø Enforcement of candidate key uniqueness is optional &lt;br /&gt;Ø Enforcement of entity integrity is optional &lt;br /&gt;Ø Referential integrity is not enforced &lt;br /&gt;&lt;br /&gt;11. What is Data Independence? &lt;br /&gt;Data independence means that "the application is independent of the storage structure and access strategy of data". In other words, The ability to modify the schema definition in one level should not affect the schema definition in the next higher level. &lt;br /&gt;Two types of Data Independence: &lt;br /&gt;Ø Physical Data Independence: Modification in physical level should not affect the logical level. &lt;br /&gt;Ø Logical Data Independence: Modification in logical level should affect the view level. &lt;br /&gt;NOTE: Logical Data Independence is more difficult to achieve &lt;br /&gt;12. What is a view? How it is related to data independence? &lt;br /&gt;A view may be thought of as a virtual table, that is, a table that does not really exist in its own right but is instead derived from one or more underlying base table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary. &lt;br /&gt;Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the effects of restructuring and growth in the database. Hence accounts for logical data independence. &lt;br /&gt;&lt;br /&gt;13. What is Data Model? &lt;br /&gt;A collection of conceptual tools for describing data, data relationships data semantics and constraints. &lt;br /&gt;&lt;br /&gt;14. What is E-R model? &lt;br /&gt;This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entities are described in a database by a set of attributes. &lt;br /&gt;&lt;br /&gt;15. What is Object Oriented model? &lt;br /&gt;This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes. &lt;br /&gt;&lt;br /&gt;16. What is an Entity? &lt;br /&gt;It is a 'thing' in the real world with an independent existence. &lt;br /&gt;&lt;br /&gt;17. What is an Entity type? &lt;br /&gt;It is a collection (set) of entities that have same attributes. &lt;br /&gt;&lt;br /&gt;18. What is an Entity set? &lt;br /&gt;It is a collection of all entities of particular entity type in the database. &lt;br /&gt;&lt;br /&gt;19. What is an Extension of entity type? &lt;br /&gt;The collections of entities of a particular entity type are grouped together into an entity set. &lt;br /&gt;20. What is Weak Entity set? &lt;br /&gt;An entity set may not have sufficient attributes to form a primary key, and its primary key compromises of its partial key and primary key of its parent entity, then it is said to be Weak Entity set. &lt;br /&gt;&lt;br /&gt;21. What is an attribute? &lt;br /&gt;It is a particular property, which describes the entity. &lt;br /&gt;&lt;br /&gt;22. What is a Relation Schema and a Relation? &lt;br /&gt;A relation Schema denoted by R(A1, A2, …, An) is made up of the relation name R and the list of attributes Ai that it contains. A relation is defined as a set of tuples. Let r be the relation which contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list of n-values t=(v1,v2, ..., vn). &lt;br /&gt;&lt;br /&gt;23. What is degree of a Relation? &lt;br /&gt;It is the number of attribute of its relation schema. &lt;br /&gt;&lt;br /&gt;24. What is Relationship? &lt;br /&gt;It is an association among two or more entities. &lt;br /&gt;&lt;br /&gt;25. What is Relationship set? &lt;br /&gt;The collection (or set) of similar relationships. &lt;br /&gt;&lt;br /&gt;26. What is Relationship type? &lt;br /&gt;Relationship type defines a set of associations or a relationship set among a given set of entity types. &lt;br /&gt;&lt;br /&gt;27. What is degree of Relationship type? &lt;br /&gt;It is the number of entity type participating. &lt;br /&gt;&lt;br /&gt;25. What is DDL (Data Definition Language)? &lt;br /&gt;A data base schema is specifies by a set of definitions expressed by a special language called DDL. &lt;br /&gt;&lt;br /&gt;26. What is VDL (View Definition Language)? &lt;br /&gt;It specifies user views and their mappings to the conceptual schema&lt;br /&gt;27. What is SDL (Storage Definition Language)? &lt;br /&gt;This language is to specify the internal schema. This language may specify the mapping between two schemas. &lt;br /&gt;&lt;br /&gt;28. What is Data Storage - Definition Language? &lt;br /&gt;The storage structures and access methods used by database system are specified by a set of definition in a special type of DDL called data storage-definition language. &lt;br /&gt;&lt;br /&gt;29. What is DML (Data Manipulation Language)? &lt;br /&gt;This language that enable user to access or manipulate data as organised by appropriate data model. &lt;br /&gt;Ø Procedural DML or Low level: DML requires a user to specify what data are needed and how to get those data. &lt;br /&gt;Ø Non-Procedural DML or High level: DML requires a user to specify what data are needed without specifying how to get those data. &lt;br /&gt;&lt;br /&gt;31. What is DML Compiler? &lt;br /&gt;It translates DML statements in a query language into low-level instruction that the query evaluation engine can understand. &lt;br /&gt;&lt;br /&gt;32. What is Query evaluation engine? &lt;br /&gt;It executes low-level instruction generated by compiler. &lt;br /&gt;&lt;br /&gt;33. What is DDL Interpreter? &lt;br /&gt;It interprets DDL statements and record them in tables containing metadata. &lt;br /&gt;&lt;br /&gt;34. What is Record-at-a-time? &lt;br /&gt;The Low level or Procedural DML can specify and retrieve each record from a set of records. This retrieve of a record is said to be Record-at-a-time. &lt;br /&gt;&lt;br /&gt;35. What is Set-at-a-time or Set-oriented? &lt;br /&gt;The High level or Non-procedural DML can specify and retrieve many records in a single DML statement. This retrieve of a record is said to be Set-at-a-time or Set-oriented. &lt;br /&gt;&lt;br /&gt;36. What is Relational Algebra? &lt;br /&gt;It is procedural query language. It consists of a set of operations that take one or two relations as input and produce a new relation. &lt;br /&gt;37. What is Relational Calculus? &lt;br /&gt;It is an applied predicate calculus specifically tailored for relational databases proposed by E.F. Codd. E.g. of languages based on it are DSL ALPHA, QUEL. &lt;br /&gt;&lt;br /&gt;38. How does Tuple-oriented relational calculus differ from domain-oriented relational calculus &lt;br /&gt;The tuple-oriented calculus uses a tuple variables i.e., variable whose only permitted values are tuples of that relation. E.g. QUEL &lt;br /&gt;The domain-oriented calculus has domain variables i.e., variables that range over the underlying domains instead of over relation. E.g. ILL, DEDUCE. &lt;br /&gt;&lt;br /&gt;39. What is normalization? &lt;br /&gt;It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties &lt;br /&gt;Ø Minimizing redundancy &lt;br /&gt;Ø Minimizing insertion, deletion and update anomalies. &lt;br /&gt;&lt;br /&gt;40. What is Functional Dependency? &lt;br /&gt;A Functional dependency is denoted by X Y between two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely determines the value of component Y. &lt;br /&gt;&lt;br /&gt;41. When is a functional dependency F said to be minimal? &lt;br /&gt;Ø Every dependency in F has a single attribute for its right hand side. &lt;br /&gt;Ø We cannot replace any dependency X A in F with a dependency Y A where Y is a proper subset of X and still have a set of dependency that is equivalent to F. &lt;br /&gt;Ø We cannot remove any dependency from F and still have set of dependency that is equivalent to F. &lt;br /&gt;&lt;br /&gt;42. What is Multivalued dependency? &lt;br /&gt;Multivalued dependency denoted by X Y specified on relation schema R, where X and Y are both subsets of R, specifies the following constraint on any relation r of R: if two tuples t1 and t2 exist in r such that t1[X] = t2[X] then t3 and t4 should also exist in r with the following properties &lt;br /&gt;Ø t3[x] = t4[X] = t1[X] = t2[X] &lt;br /&gt;Ø t3[Y] = t1[Y] and t4[Y] = t2[Y] &lt;br /&gt;Ø t3[Z] = t2[Z] and t4[Z] = t1[Z] &lt;br /&gt;where [Z = (R-(X U Y)) ] &lt;br /&gt;43. What is Lossless join property? &lt;br /&gt;It guarantees that the spurious tuple generation does not occur with respect to relation schemas after decomposition. &lt;br /&gt;&lt;br /&gt;44. What is 1 NF (Normal Form)? &lt;br /&gt;The domain of attribute must include only atomic (simple, indivisible) values. &lt;br /&gt;&lt;br /&gt;45. What is Fully Functional dependency? &lt;br /&gt;It is based on concept of full functional dependency. A functional dependency X Y is full functional dependency if removal of any attribute A from X means that the dependency does not hold any more. &lt;br /&gt;&lt;br /&gt;46. What is 2NF? &lt;br /&gt;A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key. &lt;br /&gt;&lt;br /&gt;47. What is 3NF? &lt;br /&gt;A relation schema R is in 3NF if it is in 2NF and for every FD X A either of the following is true &lt;br /&gt;Ø X is a Super-key of R. &lt;br /&gt;Ø A is a prime attribute of R. &lt;br /&gt;In other words, if every non prime attribute is non-transitively dependent on primary key. &lt;br /&gt;&lt;br /&gt;48. What is BCNF (Boyce-Codd Normal Form)? &lt;br /&gt;A relation schema R is in BCNF if it is in 3NF and satisfies an additional constraint that for every FD X A, X must be a candidate key. &lt;br /&gt;&lt;br /&gt;49. What is 4NF? &lt;br /&gt;A relation schema R is said to be in 4NF if for every Multivalued dependency X Y that holds over R, one of following is true &lt;br /&gt;Ø X is subset or equal to (or) XY = R. &lt;br /&gt;Ø X is a super key. &lt;br /&gt;&lt;br /&gt;50. What is 5NF? &lt;br /&gt;A Relation schema R is said to be 5NF if for every join dependency {R1, R2, ..., Rn} that holds R, one the following is true &lt;br /&gt;Ø Ri = R for some i. &lt;br /&gt;Ø The join dependency is implied by the set of FD, over R in which the left side is key of R. &lt;br /&gt;51. What is Domain-Key Normal Form? &lt;br /&gt;A relation is said to be in DKNF if all constraints and dependencies that should hold on the the constraint can be enforced by simply enforcing the domain constraint and key constraint on the relation. &lt;br /&gt;&lt;br /&gt;52. What are partial, alternate,, artificial, compound and natural key? &lt;br /&gt;Partial Key: &lt;br /&gt;It is a set of attributes that can uniquely identify weak entities and that are related to same owner entity. It is sometime called as Discriminator. &lt;br /&gt;Alternate Key: &lt;br /&gt;All Candidate Keys excluding the Primary Key are known as Alternate Keys. &lt;br /&gt;Artificial Key: &lt;br /&gt;If no obvious key, either stand alone or compound is available, then the last resort is to simply create a key, by assigning a unique number to each record or occurrence. Then this is known as developing an artificial key. &lt;br /&gt;Compound Key: &lt;br /&gt;If no single data element uniquely identifies occurrences within a construct, then combining multiple elements to create a unique identifier for the construct is known as creating a compound key. &lt;br /&gt;Natural Key: &lt;br /&gt;When one of the data elements stored within a construct is utilized as the primary key, then it is called the natural key. &lt;br /&gt;&lt;br /&gt;53. What is indexing and what are the different kinds of indexing? &lt;br /&gt;Indexing is a technique for determining how quickly specific data can be found. &lt;br /&gt;Types: &lt;br /&gt;Ø Binary search style indexing &lt;br /&gt;Ø B-Tree indexing &lt;br /&gt;Ø Inverted list indexing &lt;br /&gt;Ø Memory resident table &lt;br /&gt;Ø Table indexing &lt;br /&gt;&lt;br /&gt;54. What is system catalog or catalog relation? How is better known as? &lt;br /&gt;A RDBMS maintains a description of all the data that it contains, information about every relation and index that it contains. This information is stored in a collection of relations maintained by the system called metadata. It is also called data dictionary. &lt;br /&gt;55. What is meant by query optimization? &lt;br /&gt;The phase that identifies an efficient execution plan for evaluating a query that has the least estimated cost is referred to as query optimization. &lt;br /&gt;&lt;br /&gt;56. What is join dependency and inclusion dependency? &lt;br /&gt;Join Dependency: &lt;br /&gt;A Join dependency is generalization of Multivalued dependency.A JD {R1, R2, ..., Rn} is said to hold over a relation R if R1, R2, R3, ..., Rn is a lossless-join decomposition of R . There is no set of sound and complete inference rules for JD. &lt;br /&gt;Inclusion Dependency: &lt;br /&gt;An Inclusion Dependency is a statement of the form that some columns of a relation are contained in other columns. A foreign key constraint is an example of inclusion dependency. &lt;br /&gt;&lt;br /&gt;57. What is durability in DBMS? &lt;br /&gt;Once the DBMS informs the user that a transaction has successfully completed, its effects should persist even if the system crashes before all its changes are reflected on disk. This property is called durability. &lt;br /&gt;&lt;br /&gt;58. What do you mean by atomicity and aggregation? &lt;br /&gt;Atomicity: &lt;br /&gt;Either all actions are carried out or none are. Users should not have to worry about the effect of incomplete transactions. DBMS ensures this by undoing the actions of incomplete transactions. &lt;br /&gt;Aggregation: &lt;br /&gt;A concept which is used to model a relationship between a collection of entities and relationships. It is used when we need to express a relationship among relationships. &lt;br /&gt;&lt;br /&gt;59. What is a Phantom Deadlock? &lt;br /&gt;In distributed deadlock detection, the delay in propagating local information might cause the deadlock detection algorithms to identify deadlocks that do not really exist. Such situations are called phantom deadlocks and they lead to unnecessary aborts. &lt;br /&gt;&lt;br /&gt;60. What is a checkpoint and When does it occur? &lt;br /&gt;A Checkpoint is like a snapshot of the DBMS state. By taking checkpoints, the DBMS can reduce the amount of work to be done during restart in the event of subsequent crashes.61. What are the different phases of transaction? &lt;br /&gt;Different phases are &lt;br /&gt;Ø Analysis phase &lt;br /&gt;Ø Redo Phase &lt;br /&gt;Ø Undo phase &lt;br /&gt;&lt;br /&gt;62. What do you mean by flat file database? &lt;br /&gt;It is a database in which there are no programs or user access languages. It has no cross-file capabilities but is user-friendly and provides user-interface management. &lt;br /&gt;&lt;br /&gt;63. What is "transparent DBMS"? &lt;br /&gt;It is one, which keeps its Physical Structure hidden from user. &lt;br /&gt;&lt;br /&gt;64. Brief theory of Network, Hierarchical schemas and their properties &lt;br /&gt;Network schema uses a graph data structure to organize records example for such a database management system is CTCG while a hierarchical schema uses a tree data structure example for such a system is IMS. &lt;br /&gt;&lt;br /&gt;65. What is a query? &lt;br /&gt;A query with respect to DBMS relates to user commands that are used to interact with a data base. The query language can be classified into data definition language and data manipulation language. &lt;br /&gt;&lt;br /&gt;66. What do you mean by Correlated subquery? &lt;br /&gt;Subqueries, or nested queries, are used to bring back a set of rows to be used by the parent query. Depending on how the subquery is written, it can be executed once for the parent query or it can be executed once for each row returned by the parent query. If the subquery is executed for each row of the parent, this is called a correlated subquery. &lt;br /&gt;A correlated subquery can be easily identified if it contains any references to the parent subquery columns in its WHERE clause. Columns from the subquery cannot be referenced anywhere else in the parent query. The following example demonstrates a non-correlated subquery. &lt;br /&gt;E.g. Select * From CUST Where '10/03/1990' IN (Select ODATE From ORDER Where CUST.CNUM = ORDER.CNUM) &lt;br /&gt;&lt;br /&gt;67. What are the primitive operations common to all record management systems? &lt;br /&gt;Addition, deletion and modification.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-2974961069384288090?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/2974961069384288090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=2974961069384288090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/2974961069384288090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/2974961069384288090'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/data-base-management-system.html' title='DATA BASE MANAGEMENT SYSTEM'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-4086577801120660836</id><published>2009-02-07T16:19:00.000+05:30</published><updated>2009-02-07T16:21:14.565+05:30</updated><title type='text'>Computer Abbreviations Dictionary</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Computer Abbreviations Dictionary&lt;/span&gt;&lt;br /&gt;• ACE - Access Control Entry &lt;br /&gt;• ACL - Access Control List &lt;br /&gt;• ADO - Active Data Objects &lt;br /&gt;• AGP - Accelerated Graphics Port &lt;br /&gt;• AI - Artificial Intelligence &lt;br /&gt;• ALGOL - Algorithmic Language &lt;br /&gt;• ALU - Arithmetic Logic Unit &lt;br /&gt;• AOL - America Online &lt;br /&gt;• API - Application Program Interface &lt;br /&gt;• APIPA - Automatic Private Internet Protocol Addressing &lt;br /&gt;• ARP - Address Resolution Protocol &lt;br /&gt;• ASCII - American Standard Code for Information Interchange &lt;br /&gt;• ASF - Advanced Streaming Format &lt;br /&gt;• ASM - Association for Systems Management &lt;br /&gt;• ASP - Active Server Pages &lt;br /&gt;• ATAPI - Advanced Technology Attachment Packet Interface &lt;br /&gt;• ATM - Asynchronous Transfer Mode &lt;br /&gt;• AUI - Attachment Unit Interface &lt;br /&gt;• AVI - Audio Video Interleave&lt;br /&gt;• B2B - Business to Business &lt;br /&gt;• B2C - Business to Commerce &lt;br /&gt;• BASIC - Beginner's All Purpose Symbolic Instruction Code &lt;br /&gt;• BCD - Binary Coded Decimal &lt;br /&gt;• BHTML - Broadcast Hyper Text Markup Language &lt;br /&gt;• BIOS - Basic Input Output System &lt;br /&gt;• BMP - Bitmap&lt;br /&gt;• CAD - Computer Aided Design &lt;br /&gt;• CAI - Computer Aided Instructuion &lt;br /&gt;• CAM - Computer Aided Manufacturing &lt;br /&gt;• CASE - Computer Aided Software Engineering &lt;br /&gt;• CCNA - Cisco Certified Network Associate &lt;br /&gt;• CD - Compact Disc &lt;br /&gt;• CD - RW - Compact Disc Re-Writable &lt;br /&gt;• CD - WORM - Compact Disc - Write Once Read Many &lt;br /&gt;• C-DAC - Centre for Development of Advanced Computing &lt;br /&gt;• CDONTS - Collabaration on Data Objects for Windows NT Server &lt;br /&gt;• CGI - Common Gateway Interface &lt;br /&gt;• CIDR - Classless Inter-Domain Routing  &lt;br /&gt;• CLR - Common Language Runtime &lt;br /&gt;• CMOS - Complementary Metal Oxide Semiconductor &lt;br /&gt;• CMS - Content Management System &lt;br /&gt;• CMYK - Cyan, Magenta, Yellow, Key (black) &lt;br /&gt;• COBOL - Common Business Oriented Language &lt;br /&gt;• COM - Component Object Model &lt;br /&gt;• CORBA - Common Object Request Broker Architecture &lt;br /&gt;• CPU - Central Processing Unit &lt;br /&gt;• CRC - Cyclic Redundancy Check &lt;br /&gt;• CRM - Customer Relationship Management &lt;br /&gt;• CROM - Control Read Only Memory &lt;br /&gt;• CRT - Cathode Ray Tube &lt;br /&gt;• CUI - Character User Interface&lt;br /&gt;• DAC - Digital to Analog Converter &lt;br /&gt;• DAO - Data Access Objects &lt;br /&gt;• DAT - Digital Audio Tape &lt;br /&gt;• DBA - Data Base Administrator &lt;br /&gt;• DBMS - Data Base Management System &lt;br /&gt;• DCOM - Distributed Component Object Model &lt;br /&gt;• DDL - Data Definition Language &lt;br /&gt;• DFS - Distributed File System &lt;br /&gt;• DHCP - Domain Host Configuration Protocol &lt;br /&gt;• DHTML - Dynamics Hyper Text Markup Language &lt;br /&gt;• DLC - Data Link Control &lt;br /&gt;• dll - dynamic link library &lt;br /&gt;• DMA - Direct Memory Access &lt;br /&gt;• DML - Data Manipulation Language &lt;br /&gt;• DNS - Domain Name System &lt;br /&gt;• DOM - Document Object Model &lt;br /&gt;• DOS - Disk Operating System, Denial Of Service &lt;br /&gt;• DDOS - Distributed Denial Of Service &lt;br /&gt;• dpi - dots per inch &lt;br /&gt;• DSL - Digital Subscriber Line &lt;br /&gt;• DSN - Digital Subscriber Network &lt;br /&gt;• DTD - Document Type Definition &lt;br /&gt;• DVD - Digital Versatile Disc&lt;br /&gt;• e - electronic &lt;br /&gt;• EBCDIC - Extended Binary Coded Decimal Interchange Code &lt;br /&gt;• EFS - Encrypted File System &lt;br /&gt;• EPROM - Erasable Programmable Read Only Memory &lt;br /&gt;• EEPROM - Electrically Erasable Programmable Read Only Memory &lt;br /&gt;• EJB - Enterprise Java Beans &lt;br /&gt;• ERP - Enterprise Resource Planning &lt;br /&gt;• EULA - End User License Agreement&lt;br /&gt;• FAT - File Allocation Table &lt;br /&gt;• FDD- Floppy Disk Drive &lt;br /&gt;• FDDI - Fiber Distributed Data Interface &lt;br /&gt;• FIFO - First In First Out &lt;br /&gt;• FLOPS - Floating Point Operations Per Second &lt;br /&gt;• FO - Fiber Optics &lt;br /&gt;• FORTRAN - FORmula TRANslation &lt;br /&gt;• fps - frames per second &lt;br /&gt;• FRAM - Ferro-electric Random Access Memory&lt;br /&gt;• GB - Giga Bytes &lt;br /&gt;• GIF - Graphic Interchange Format &lt;br /&gt;• GIGO - Garbage In Garbage Out &lt;br /&gt;• GNU - GNU's Not Unix &lt;br /&gt;• GPL - General Public License &lt;br /&gt;• GUI - Graphical User Interface&lt;br /&gt;• HDD - Hard Disk Drive &lt;br /&gt;• HFS - Hierarchical File System &lt;br /&gt;• HP - Hewlett Packard &lt;br /&gt;• HPC - High Performance Computing &lt;br /&gt;• HPFS - High Performance File System &lt;br /&gt;• HSR - Horizontal Scan Rate &lt;br /&gt;• HTML - Hyper Text Markup Language &lt;br /&gt;• HTTP - Hyper Text Transfer Protocol &lt;br /&gt;• hw - Hardware &lt;br /&gt;• IBM - International Business Machines &lt;br /&gt;• ICMP - Internet Control Message Protocol &lt;br /&gt;• IDE - Integrated Development Environment &lt;br /&gt;• IGMP - Internet Group Management Protocol &lt;br /&gt;• IIS - Internet Information Server &lt;br /&gt;• IL - Intermediate Language &lt;br /&gt;• I/O - Input Output &lt;br /&gt;• IP - Internet Protocol &lt;br /&gt;• IPX - Internetworked Packet Exchange &lt;br /&gt;• IrDA - Infrared Data Association &lt;br /&gt;• IRQ - Interrupt Request &lt;br /&gt;• ISAPI - Internet Server Application Program Interface &lt;br /&gt;• ISDN - Integrated Services Digital Network &lt;br /&gt;• ISP - Internet Service Provider &lt;br /&gt;• IT - Information Technology &lt;br /&gt;• ITPL - Information Technology Park Limited (India)&lt;br /&gt;• JCL - Job Control Language &lt;br /&gt;• JDBC - Java Data Base Connectivity &lt;br /&gt;• JHTML - Java within Hyper Text Markup Language &lt;br /&gt;• JPEG - Joint Photographic Experts Group &lt;br /&gt;• JSP - Java Server Pages&lt;br /&gt;• kb - kilobytes &lt;br /&gt;• kbps - Kilo bytes per second&lt;br /&gt;• L2TP - Layer Two Tunneling Protocol &lt;br /&gt;• LAN - Local Area Network &lt;br /&gt;• LCD - Liquid Crystal Display &lt;br /&gt;• LIFO - Last In First Out &lt;br /&gt;• LIPS - Logical Interfaces Per Second &lt;br /&gt;• LOC - Lines Of Code &lt;br /&gt;• LSP - Layered Service Provider&lt;br /&gt;• MB - Mega Bytes &lt;br /&gt;• MBPS - Mega Bytes Per Second &lt;br /&gt;• MBR - Master Boot Record &lt;br /&gt;• MAC - Media Access Control &lt;br /&gt;• MAN - Metropolitan Area Network  &lt;br /&gt;• MAU - Multi-station Access Unit &lt;br /&gt;• MCP - Microsoft Certified Professional &lt;br /&gt;• MCS - MultiCast Server &lt;br /&gt;• MCSA - Microsoft® Certified Systems Administrator &lt;br /&gt;• MCSD - Microsoft® Certified Solution Developer  &lt;br /&gt;• MCSE - Microsoft® Certified System Engineer &lt;br /&gt;• MDI - Multiple Document Interface &lt;br /&gt;• MFC - Microsoft Foundation Classes &lt;br /&gt;• MFT - Master File Table &lt;br /&gt;• MIDI - Musical Instrument Digital Interface &lt;br /&gt;• MIMD - Multiple Instruction Multiple Data &lt;br /&gt;• MIME - Multipurpose Internet Mail Extensions &lt;br /&gt;• MISD - Multiple Instruction Single Data &lt;br /&gt;• MIPS - Millions of Instructions Per Second &lt;br /&gt;• MODEM - MOdulator and DEModulator &lt;br /&gt;• MP3 - Motion Pictures Experts Group Layer - 3 &lt;br /&gt;• MPEG - Motion Pictures Experts Group &lt;br /&gt;• MS - MicroSoft &lt;br /&gt;• MSDN - MicroSoft Developer Network &lt;br /&gt;• MSIL - Microsoft Intermediate Language &lt;br /&gt;• MSIIS - MicroSoft Internet Information Server &lt;br /&gt;• MSN - MicroSoft Network &lt;br /&gt;• MSRAP - MicroSoft Remote Administration Protocol &lt;br /&gt;• MSRPC - Microsoft Remote Procedure Call &lt;br /&gt;• MTS - Microsoft Transaction Server &lt;br /&gt;• MTU - Maximum Transmission Unit&lt;br /&gt;• NASSCOM - National Association of Software &amp; Service Companies &lt;br /&gt;• NDIS - Network Driver Interface Specification &lt;br /&gt;• NetBEUI - NetBIOS Enhanced User Interface &lt;br /&gt;• NIC - National Informatics Centre,  &lt;br /&gt;• NIIT - National Institute of Information Technology &lt;br /&gt;• NNTP - Network News Transfer Protocol &lt;br /&gt;• NOW - Network Of Workstations &lt;br /&gt;• NT (Windows) - New Technology &lt;br /&gt;• NTP - Network Time Protocol &lt;br /&gt;• NTFS - New Technology File System&lt;br /&gt;• OCP - Oracle Certified Professional &lt;br /&gt;• ODBC - Open Data Base Connectivity &lt;br /&gt;• OLE - Object Linking and Embedding &lt;br /&gt;• OMR - Optical Mark Reader &lt;br /&gt;• ONE - Open Network Architecture &lt;br /&gt;• OOAD - Object Oriented Analysis and Design &lt;br /&gt;• OOPS - Object Oriented Programming System &lt;br /&gt;• Open GL - Open Graphics Library &lt;br /&gt;• OS - Operating System&lt;br /&gt;• PC - Personal Computer &lt;br /&gt;• PCI - Peripheral Component Interconnect &lt;br /&gt;• PCMCIA - Personal Computer Memory Card International Association &lt;br /&gt;• PDA - Personal Digital Assistant &lt;br /&gt;• PDF - Portable Document Format &lt;br /&gt;• PDL - Page Description Language &lt;br /&gt;• PHP - PHP Hypertext Processor &lt;br /&gt;• PLC - Programmable Logic Controller &lt;br /&gt;• PNG - Portable Network Graphics &lt;br /&gt;• PnP - Plug and Play &lt;br /&gt;• POP - Post Office Protocol &lt;br /&gt;• POST - Power On Self Test &lt;br /&gt;• PPP - Peer to Peer Protocol &lt;br /&gt;• PPTP - Point to Point Tunneling Protocol &lt;br /&gt;• PROM - Programmable Read Only Memory &lt;br /&gt;• PS - Post Script &lt;br /&gt;• PSN - Processor Serial Number&lt;br /&gt;• QoS - Quality of Service&lt;br /&gt;• RAID - Redundant Array of Independent Disks &lt;br /&gt;• RAM - Random Access Memory &lt;br /&gt;• RAMDAC - Random Access Memory Digital to Analog Converter &lt;br /&gt;• RDBMS - Relational Data Base Management System &lt;br /&gt;• RDO - Remote Data Objects &lt;br /&gt;• RDP - Remote Desktop Protocol &lt;br /&gt;• RD RAM - Rambus Dynamic Random Access Memory &lt;br /&gt;• R-DAT - Rotating Digital Audio Tape &lt;br /&gt;• RFC - Request For Comments &lt;br /&gt;• RGB - Red Green Blue &lt;br /&gt;• RIP - Raster Image Processor &lt;br /&gt;• RISC - Reduced Instruction Set Computer &lt;br /&gt;• ROM - Read Only Memory &lt;br /&gt;• RPC - Remote Procedure Call &lt;br /&gt;• RTC - Real Time Clock &lt;br /&gt;• RTF - Rich Text Format &lt;br /&gt;• RTOS - Real Time Operating System&lt;br /&gt;• SACK - Selective Acknowledgements &lt;br /&gt;• SAM - Security Access Manager &lt;br /&gt;• SAP - Service Access Point, Systems Applications Products &lt;br /&gt;• SCSI - Small Computers Systems Interface &lt;br /&gt;• SRAM - Static Random Access Memory &lt;br /&gt;• SD RAM - Synchronous Dynamic Random Access Memory &lt;br /&gt;• S - DAT - Stationary Digital Audio Tape &lt;br /&gt;• SDK - Software Development Kit &lt;br /&gt;• SGML - Standard Generalized Markup Language &lt;br /&gt;• SG RAM - Synchronous Graphics Random Access Memory &lt;br /&gt;• SIM - Subscriber Identification Module &lt;br /&gt;• SIMD - Single Instruction Multiple Data &lt;br /&gt;• SISD - Single Instruction Single Data &lt;br /&gt;• SMS - Short Message Service &lt;br /&gt;• SMTP - Simple Mail Transfer Protocol &lt;br /&gt;• SNA - System Network Architecture &lt;br /&gt;• SNAP - Sub Network Access Protocol &lt;br /&gt;• SNMP - Simple Network Management Protocol &lt;br /&gt;• SOAP - Simple Object Access Protocol &lt;br /&gt;• SPX - Sequenced Packet Exchange &lt;br /&gt;• SQL - Structured Query Language &lt;br /&gt;• sw - software&lt;br /&gt;• TB - Tera Bytes &lt;br /&gt;• TAPI - Telephony Application Program Interface &lt;br /&gt;• TCP - Transmission Control Protocol &lt;br /&gt;• TCP/IP - Transmission Control Protocol / Internet Protocol &lt;br /&gt;• TDI - Transport Data Interface &lt;br /&gt;• TPM - Transactions Processing Monitor &lt;br /&gt;• TSR - Terminate and Stay Residents&lt;br /&gt;• UDP - User Datagram Protocol &lt;br /&gt;• UNC - Universal Naming Convention &lt;br /&gt;• UNIX - Uniplexed Information and Computer Systems &lt;br /&gt;• UML - Unified Modelling Language &lt;br /&gt;• URL - Universal Resource Locator &lt;br /&gt;• USB - Universal Serial Bus &lt;br /&gt;• UTP - Unshielded Twisted Pair&lt;br /&gt;• VAN - Virtual Area Network &lt;br /&gt;• VB - Visual Basic &lt;br /&gt;• VC++ - Visual C++ &lt;br /&gt;• VCD - Video Compact Disc &lt;br /&gt;• VGA - Video Graphics Array &lt;br /&gt;• VHS - Video Home System &lt;br /&gt;• VLIW - Very Long Instruction Words &lt;br /&gt;• VLSI - Very Large Scale Integrated Circuits &lt;br /&gt;• VPN - Virtual Private Network &lt;br /&gt;• VRAM - Video Random Access Memory &lt;br /&gt;• VRML - Virtual Reality Modelling Language &lt;br /&gt;• VS - Visual Studio &lt;br /&gt;• VSNL - Videsh Sanchar Nigam Limited &lt;br /&gt;• VXD - Virtual Device Driver&lt;br /&gt;&lt;br /&gt;• W3C - World Wide Web Consortium &lt;br /&gt;• WAN - Wide Area Network &lt;br /&gt;• WAP - Wireless Application Protocol &lt;br /&gt;• WHQL - Windows Hardware Quality Lab &lt;br /&gt;• Windows ME - Windows Millennium Edition &lt;br /&gt;• Windows NT - Windows New Technology &lt;br /&gt;• Windows XP - Windows eXPerienced &lt;br /&gt;• WINS - Windows Internet Name Services &lt;br /&gt;• WMI - Windows Management Instrumentation &lt;br /&gt;• WML - Wireless Markup Language &lt;br /&gt;• WORM - Write Once Read Many &lt;br /&gt;• WYSIWYG - What You See Is What You Get &lt;br /&gt;• WWW - World Wide Web&lt;br /&gt;• XHTML - eXtensible Hyper Text Markup Language &lt;br /&gt;• XML - eXtensible Markup Language &lt;br /&gt;• XSL - eXtensible Style Sheet langauge&lt;br /&gt;• Y2K - Year 2000&lt;br /&gt;• ZIF - Zero Insertion Force&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-4086577801120660836?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/4086577801120660836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=4086577801120660836' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/4086577801120660836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/4086577801120660836'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/computer-abbreviations-dictionary.html' title='Computer Abbreviations Dictionary'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-8912404019479583070</id><published>2009-02-07T16:17:00.000+05:30</published><updated>2009-02-07T16:19:13.057+05:30</updated><title type='text'>What is FLASH?</title><content type='html'>What is Flash?&lt;br /&gt;•	Macromedia Flash is a multimedia graphics program specially for use on the Web &lt;br /&gt;•	Flash enables you to create interactive "movies" on the Web &lt;br /&gt;•	Flash uses vector graphics, which means that the graphics can be scaled to any size without losing clarity/quality &lt;br /&gt;•	Flash does not require programming skills and is easy to learn &lt;br /&gt;________________________________________&lt;br /&gt;Flash vs. Animated Images and Java Applets&lt;br /&gt;Animated images and Java applets are often used to create dynamic effects on Web pages.&lt;br /&gt;The advantages of Flash are:&lt;br /&gt;•	Flash loads much faster than animated images &lt;br /&gt;•	Flash allows interactivity, animated images do not &lt;br /&gt;•	Flash does not require programming skills, java applets do &lt;br /&gt;Flash Embedded in HTML&lt;br /&gt;After creating a Flash movie you choose File &gt; Save As from the top menu to save your movie. Save the file as "Somefilename.fla". &lt;br /&gt;To embed the Flash movie you just made into an HTML page, you should go back to your Flash program and do the following steps:&lt;br /&gt;Step 1&lt;br /&gt;Choose File &gt; Open. Open a Flash movie you have created.&lt;br /&gt;Step 2&lt;br /&gt;Choose File &gt; Export Movie.&lt;br /&gt;Step 3&lt;br /&gt;Name the file "somefilename.swf". Choose the location where the file is to be stored (in your Web folder). Click OK.&lt;br /&gt;Step 4&lt;br /&gt;Open the HTML page where you want to insert your Flash movie. Insert this code:&lt;br /&gt;&lt;object width="550" height="400"&gt;&lt;br /&gt;&lt;param name="movie" value="somefilename.swf"&gt;&lt;br /&gt;&lt;embed src="somefilename.swf" width="550" height="400"&gt;&lt;br /&gt;&lt;/embed&gt;&lt;br /&gt;&lt;/object&gt;&lt;br /&gt;Note: This is the minimum code you need to embed a Flash movie in a browser. A broken icon will appear on the Web page if the user does not have the Flash plug-in installed.&lt;br /&gt;Note: In the code above there is both an &lt;embed&gt; tag and an &lt;object&gt; tag. This is because the &lt;object&gt; tag is recognized by Internet Explorer, and Netscape recognizes the &lt;embed&gt; tag and ignores the &lt;object&gt; tag.&lt;br /&gt;Step 5&lt;br /&gt;Type in the address of the HTML file in your browser and look at your first Flash movie.&lt;br /&gt;________________________________________&lt;br /&gt;Let the Flash Program do the Work&lt;br /&gt;The code above is the absolute minimum code to embed Flash movies in HTML pages. It is not recommended to use the minimum code. There should be a few more attributes added:&lt;br /&gt;•	classid is an attribute to the &lt;object&gt; tag. It tells Internet Explorer to load the ActiveX plug-in if it is not installed &lt;br /&gt;•	pluginspage is an attribute to the &lt;embed&gt; tag. It displays a link to the Shockwave download page if Netscape does not have it  &lt;br /&gt;The Flash program can add these attributes for you:&lt;br /&gt;Step 1&lt;br /&gt;Choose File &gt; Publish. Flash will now create the &lt;object&gt;, &lt;param&gt;, and &lt;embed&gt; tags for you. It will also create the classid and pluginspage attributes.&lt;br /&gt;Step 2&lt;br /&gt;Open the HTML document that Flash created, view the HTML source and copy the code into your HTML page where you want your Flash movie.&lt;br /&gt;Step 3&lt;br /&gt;Be sure that you have the "somefilename.swf" in your Web folder.&lt;br /&gt;Step 4&lt;br /&gt;Type in the address of the HTML file in your browser and look at your first Flash movie.&lt;br /&gt;Tweening comes from the words "in between".&lt;br /&gt;With Tweening you can go from one keyframe to another and specify changes in the animation and let the Flash program create the frames in between.&lt;br /&gt;________________________________________&lt;br /&gt;Example&lt;br /&gt;In this example you will learn how to make an object move across the screen.&lt;br /&gt;Example&lt;br /&gt;Step 1&lt;br /&gt;Create a small circle to the left in the Stage area. Do this by selecting the circle tool from the left toolbar. Draw the circle in the Stage area. &lt;br /&gt;Step 2&lt;br /&gt;Select the Arrow tool from the left toolbar. Double-click on the circle to select it. &lt;br /&gt;Step 3&lt;br /&gt;Now we have to convert the circle to a symbol. When the circle is converted to a symbol we can create instances of the circle. From the top menu choose Modify &gt; Convert to Symbol. Name the symbol "Ball", and select OK. &lt;br /&gt;Step 4&lt;br /&gt;Go to Frame 10 in the Timeline. Do this by clicking the gray field below 10. Then right click in this field. Choose Insert Keyframe. Keyframes appear as circles in a frame. This operation duplicates the image.  &lt;br /&gt;Note: A keyframe specifies changes in an animation. You create keyframes at important points in the Timeline and let Flash create the frames in between. &lt;br /&gt;Step 5&lt;br /&gt;Select the circle and move it to the right a couple of inches. &lt;br /&gt;Step 6&lt;br /&gt;Click on the Timeline any place between Frame 1 and Frame 10. Then right click and choose Create Motion Tween. &lt;br /&gt;Step 7&lt;br /&gt;Choose Control &gt; Test Movie from the top menu to test your Flash movie. &lt;br /&gt;With Motion Guide Tweening you can move an object from one location to another along a specified path.&lt;br /&gt;________________________________________&lt;br /&gt;Example&lt;br /&gt;In this example you will learn how to draw a path an object should follow.&lt;br /&gt;Example&lt;br /&gt;Step 1&lt;br /&gt;Choose Window &gt; Common Libraries &gt; Graphics. Select the image you want to use. In this example we have used a blue mouse. &lt;br /&gt;Step 2&lt;br /&gt;Click on the image and drag it outside the left edge of the Stage. &lt;br /&gt;Step 3&lt;br /&gt;Go to Frame 40 in the Timeline. Do this by clicking the gray field below 40. Then right click in this field. Choose Insert Keyframe. Keyframes appear as circles in a frame. This operation duplicates the image.  &lt;br /&gt;Step 4&lt;br /&gt;Click on the Timeline any place between Frame 1 and Frame 40. Then right click and choose Create Motion Tween. &lt;br /&gt;Step 5&lt;br /&gt;Right click on Layer 1 (Click on the layer name, where it says "Layer 1"). Choose Add Motion Guide in the pop-up menu. The Flash program will now insert a motion guide layer on top of layer 1. Motion guide layers are used to draw lines an animated symbol should follow. &lt;br /&gt;Step 6&lt;br /&gt;Click on the Motion Guide Layer to make sure it is the active layer (Click on the layer name, where it says "Guide: Layer 1"). &lt;br /&gt;Step 7&lt;br /&gt;Click on the Pencil tool in the left toolbox. Set the Pencil Mode to Smooth (in the Options section of the left toolbox). &lt;br /&gt;Step 8&lt;br /&gt;Draw a line. Begin on the image and draw a line to the other side of the Stage. &lt;br /&gt;Step 9&lt;br /&gt;Go back to Frame 1 in the Timeline. Click on the Arrow tool in the left toolbox. Select the "Snap to Objects" button in the Options section of the left toolbox. &lt;br /&gt;Step 10&lt;br /&gt;Place the image with its center on the beginning of the motion guide (the black line you have drawn with the Pencil). The center of the image shows as a +. A black circle appears when the image is snapped to the motion guide. Release the mouse button when the image is snapped to the guide. &lt;br /&gt;Step 11&lt;br /&gt;Go to Frame 40. Place the image with its center on the end of the motion guide. &lt;br /&gt;Step 12&lt;br /&gt;Choose Control &gt; Test Movie from the top menu to test your Flash movie. &lt;br /&gt;With Tint Tweening you can change the color of an object.&lt;br /&gt;________________________________________&lt;br /&gt;Example&lt;br /&gt;In this example you will learn how to change the color of an object.&lt;br /&gt;Example&lt;br /&gt;Step 1&lt;br /&gt;Choose Insert &gt; New Symbol. &lt;br /&gt;Note: To add Tint effects the object must be a symbol. &lt;br /&gt;Step 2&lt;br /&gt;Name the symbol "changecolor" and select the Graphic option in Behavior. Click OK. &lt;br /&gt;Note: You will now be taken to the symbol generator in the Flash program. Here you create symbols. Symbols can be dragged to the stage of your movie after you have created them. &lt;br /&gt;Step 3&lt;br /&gt;Choose the Text tool in the left toolbox. Choose Text &gt; Size &gt; 36 from the top menu to make the text big. Choose Text &gt; Style &gt; Bold to make the text thick. &lt;br /&gt;Step 4&lt;br /&gt;Click in the work area and write "Color Changing Text". &lt;br /&gt;Step 5&lt;br /&gt;Jump back to the movie. Do this by choosing Edit &gt; Edit Movie. &lt;br /&gt;Step 6&lt;br /&gt;Insert the symbol you just created into the movie. Choose Window &gt; Library. Select the "changecolor" symbol and drag it into the middle of the Stage. &lt;br /&gt;Step 7&lt;br /&gt;Insert a keyframe in Frame 15 and in Frame 30. &lt;br /&gt;Step 8&lt;br /&gt;Go to Frame 15. Right click on the text in the Stage. In the pop-up menu, choose Panels &gt; Effect. &lt;br /&gt;Step 9&lt;br /&gt;Choose Tint from the drop down menu. A color map will show. Set the colors to: R=0, G=255, B=0. &lt;br /&gt;Step 10&lt;br /&gt;Click on the Timeline any place between Frame 1 and Frame 15. Then right click and choose Create Motion Tween. &lt;br /&gt;Step 11&lt;br /&gt;Click on the Timeline any place between Frame 15 and Frame 30. Then right click and choose Create Motion Tween. &lt;br /&gt;Step 12&lt;br /&gt;Choose Control &gt; Test Movie from the top menu to test your Flash movie. &lt;br /&gt;With Shape Tweening you can change one object into another.&lt;br /&gt;________________________________________&lt;br /&gt;Example&lt;br /&gt;In this example you will learn how to change one object into another.&lt;br /&gt;Example&lt;br /&gt;Step 1&lt;br /&gt;Choose the Text tool in the left toolbox. Choose Text &gt; Size &gt; 48 from the top menu to make the text big. Choose Text &gt; Style &gt; Bold to make the text thick. &lt;br /&gt;Step 2&lt;br /&gt;Click in the work area and write "Hello". &lt;br /&gt;Step 3&lt;br /&gt;Right click on the text you just wrote and choose Panels &gt; Align from the pop-up menu. &lt;br /&gt;Step 4&lt;br /&gt;In the Align box select the "To Stage" button first. Then click on the "Align Horizontal Center" button and the "Align Vertical Center" button. Close the Align box. &lt;br /&gt;Step 5&lt;br /&gt;Select the Arrow Tool and click on the text. Choose Modify &gt; Break Apart from the top menu. &lt;br /&gt;Step 6&lt;br /&gt;Insert keyframes at Frame 24, 50 and 51. &lt;br /&gt;Step 7&lt;br /&gt;Delete the text "Hello" in Frame 24. Select it and press the Delete button on your keyboard. &lt;br /&gt;Step 8&lt;br /&gt;Write a new text on the Stage. Write "World!" (Font size: 48, style: bold). &lt;br /&gt;Step 9&lt;br /&gt;Right click on the text you just wrote and choose Panels &gt; Align from the pop-up menu. In the Align box select the "To Stage" button first. Then click on the "Align Horizontal Center" button and the "Align Vertical Center" button. Close the Align box &lt;br /&gt;Step 10&lt;br /&gt;Select the Arrow Tool and click on the text. Choose Modify &gt; Break Apart from the top menu. &lt;br /&gt;Step 11&lt;br /&gt;Insert a keyframe in Frame 26. &lt;br /&gt;Step 12&lt;br /&gt;Double click the keyframe in Frame 1. In the small pop-up box click on the Frame tab. Set Tweening to Shape. Close the pop-up box. &lt;br /&gt;Step 13&lt;br /&gt;Double click the keyframe in Frame 26. In the small pop-up box click on the Frame tab. Set Tweening to Shape. Close the pop-up box. &lt;br /&gt;Step 14&lt;br /&gt;Double click the keyframe in Frame 51. In the large pop-up box click on the Frame Actions tab. Click on the + sign. Choose Basic Actions &gt; Go To. Close the pop-up boxes. &lt;br /&gt;Step 15&lt;br /&gt;Choose Control &gt; Test Movie from the top menu to test your Flash movie. &lt;br /&gt;Example&lt;br /&gt;In this example you will learn how to insert an image, convert it to a button, and add a URL to it so it becomes a link.&lt;br /&gt;Example&lt;br /&gt;Step 1&lt;br /&gt;Choose File &gt; Import to import an image that will become a button. Locate the image and click Open. The image will be saved in the Library. &lt;br /&gt;Step 2&lt;br /&gt;Select the image with the Arrow tool. &lt;br /&gt;Step 3&lt;br /&gt;Convert the image to a symbol. Choose Insert &gt; Convert to Symbol from the top menu. Name the symbol "button", choose Button from the Behavior list and click OK. &lt;br /&gt;Step 4&lt;br /&gt;Right click on the image. Choose Actions from the pop-up menu. &lt;br /&gt;Step 5&lt;br /&gt;In the Object Actions box click on the + sign. Choose Basic Actions &gt; Get URL. &lt;br /&gt;Step 6&lt;br /&gt;Enter a full URL in the URL field (like http://www.w3schools.com). &lt;br /&gt;Step 7&lt;br /&gt;Choose target in the Window field. Close the Object Actions box. &lt;br /&gt;Step 8&lt;br /&gt;Choose Control &gt; Test Movie from the top menu to test your Flash movie. &lt;br /&gt;Example&lt;br /&gt;In this example you will learn how to create your own button and add a URL to it so it becomes a link.&lt;br /&gt;Example&lt;br /&gt;Step 1&lt;br /&gt;Choose Insert &gt; New Symbol from the top menu. &lt;br /&gt;Step 2&lt;br /&gt;Name the symbol "button", choose Button from the Behavior list and click OK. In the Timeline area, you will now see the four states of a button: up, over, down, hit. &lt;br /&gt;Step 3&lt;br /&gt;Select the Rectangle tool, pick a light red Fill Color and draw a rectangle in the work area.  &lt;br /&gt;Step 4&lt;br /&gt;Select the Text tool, pick a dark Fill Color and write "Click Me" over the rectangle.  &lt;br /&gt;Step 5&lt;br /&gt;Select the Arrow tool and place the text in the middle of the rectangle.  &lt;br /&gt;Step 6&lt;br /&gt;Add a keyframe to the Over State in the Timeline. The Over State indicates what should happen when you mouse over the button. &lt;br /&gt;Step 7&lt;br /&gt;Select the Rectangle, change the Fill color to a light green.  &lt;br /&gt;Step 8&lt;br /&gt;Choose Edit &gt; Edit Movie to go back to the movie. &lt;br /&gt;Step 9&lt;br /&gt;Choose Window &gt; Library to locate the button. Drag the button into the work area.  &lt;br /&gt;Step 10&lt;br /&gt;Right click on the image. Choose Actions from the pop-up menu. &lt;br /&gt;Step 11&lt;br /&gt;In the Object Actions box click on the + sign. Choose Basic Actions &gt; Get URL. &lt;br /&gt;Step 12&lt;br /&gt;Enter a full URL in the URL field (like http://www.w3schools.com). &lt;br /&gt;Step 13&lt;br /&gt;Choose target in the Window field. Close the Object Actions box. &lt;br /&gt;Step 14&lt;br /&gt;Choose Control &gt; Test Movie from the top menu to test your Flash movie. &lt;br /&gt;Example&lt;br /&gt;Example&lt;br /&gt;Step 1&lt;br /&gt;Insert a text in the upper left corner of the Stage area. Do this by selecting the text tool from the left toolbar. Write some text in the "textarea". &lt;br /&gt;Step 2&lt;br /&gt;Select the arrow tool from the left toolbar. Click on the text once to select it. &lt;br /&gt;Step 3&lt;br /&gt;Convert the text to a symbol. From the top menu choose Insert &gt; Convert to Symbol. Name the symbol "text", choose graphic from the Behavior list and select OK. &lt;br /&gt;Step 4&lt;br /&gt;Go to Frame 30 in the Timeline. Do this by clicking the gray field below 30. Then right click in this field. Choose Insert Keyframe. Keyframes appear as circles in a frame. &lt;br /&gt;Step 5&lt;br /&gt;Click on the Timeline any place between Frame 1 and Frame 30. Then right click and choose Create Motion Tween. &lt;br /&gt;Step 6&lt;br /&gt;Go back to Frame 30 in the Timeline. Move the text to the lower right corner. &lt;br /&gt;Step 7&lt;br /&gt;Make sure the text is selected. Choose Modify &gt; Transform &gt; Flip Horizontal. &lt;br /&gt;Step 8&lt;br /&gt;Choose Control &gt; Test Movie from the top menu to test your Flash movie. The text should move from the first location (in frame 1) to the second location (in frame 2). The text should also turn around on its way to the second location. &lt;br /&gt;Example&lt;br /&gt;Example&lt;br /&gt;Step 1&lt;br /&gt;Choose File &gt; Import to import a sound file. Locate the sound file and click Open. The sound file will be saved in the Library.&lt;br /&gt;Step 2&lt;br /&gt;Click in the first frame of "Layer 1" in the Timeline. Choose Window &gt; Panels &gt; Sound from the top menu.&lt;br /&gt;Step 3&lt;br /&gt;In the pop up window (Sound) choose the sound you imported in the Sound field. Choose Stream in the Sync field. Close the pop up window.&lt;br /&gt;Step 4&lt;br /&gt;Go to frame 50 in the Timeline. Right click and choose Insert Frame.&lt;br /&gt;Step 5&lt;br /&gt;Choose Control &gt; Test Movie from the top menu to test your Flash movie.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-8912404019479583070?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/8912404019479583070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=8912404019479583070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/8912404019479583070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/8912404019479583070'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/what-is-flash.html' title='What is FLASH?'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-255928888233011455</id><published>2009-02-07T16:16:00.000+05:30</published><updated>2009-02-07T16:17:42.773+05:30</updated><title type='text'>Learn Basics of Microsoft.NET</title><content type='html'>Microsoft .NET is Microsoft's new Internet strategy.&lt;br /&gt;.NET was originally called NGWS.&lt;br /&gt;________________________________________&lt;br /&gt;NGWS - Next Generation Windows Services&lt;br /&gt;Before the official announcement of .NET, the term NGWS was used for Microsoft's plans for producing an "Internet-based platform of Next Generation Windows Services". &lt;br /&gt;Steve Ballmer quote January 2000:&lt;br /&gt;"Delivering an Internet-based platform of Next Generation Windows Services is the top priority of our company. The breakthroughs we’re talking about here include changes to the programming model, to the user interface, to the application integration model, the file system, new XML schema....." &lt;br /&gt;________________________________________&lt;br /&gt;Microsoft. NET&lt;br /&gt;The Microsoft. NET strategy was presented by Microsoft officials to the rest of the world in June 2000:&lt;br /&gt;• .NET is Microsoft's new Internet and Web strategy &lt;br /&gt;• .NET is NOT a new operating system &lt;br /&gt;• .NET is a new Internet and Web based infrastructure &lt;br /&gt;• .NET delivers software as Web Services &lt;br /&gt;• .NET is a framework for universal services &lt;br /&gt;• .NET is a server centric computing model &lt;br /&gt;• .NET will run in any browser on any platform &lt;br /&gt;• .NET is based on the newest Web standards &lt;br /&gt;________________________________________&lt;br /&gt;.NET Internet Standards&lt;br /&gt;.NET is built on the following Internet standards:&lt;br /&gt;• HTTP, the communication protocol between Internet Applications &lt;br /&gt;• XML, the format for exchanging data between Internet Applications &lt;br /&gt;• SOAP, the standard format for requesting Web Services &lt;br /&gt;• UDDI, the standard to search and discover Web Services &lt;br /&gt;________________________________________&lt;br /&gt;.NET Framework&lt;br /&gt;The .NET Framework is the infrastructure for the new Microsoft .NET Platform. &lt;br /&gt;The .NET Framework is a common environment for building, deploying, and running Web Services and Web Applications.&lt;br /&gt;The .NET Framework contains common class libraries - like ADO.NET, ASP.NET and Windows Forms - to provide advanced standard services that can be integrated into a variety of computer systems.&lt;br /&gt;The .NET Framework is language neutral. Currently it supports C++, C#, Visual Basic, JScript (The Microsoft version of JavaScript) and COBOL. Third-party languages - like Eiffel, Perl, Python, Smalltalk, and others - will also be available for building future .NET Framework applications.&lt;br /&gt;The new Visual Studio.NET is a common development environment for the new .NET Framework. It provides a feature-rich application execution environment, simplified development and easy integration between a number of different development languages.&lt;br /&gt;________________________________________&lt;br /&gt;Additional Information&lt;br /&gt;• The .NET plan includes a new version of the Windows operating system, a new version of Office, and a variety of new development software for programmers to build Web-based applications. &lt;br /&gt;• The background for .NET is part of Microsoft's new strategy to keep Windows the dominant operating system in the market, as computing begins to move away from desktop computers toward Internet enabled devices, such as hand-held computers and cell phones. &lt;br /&gt;• The most visual components of the new .NET framework are the new Internet Information Server 6.0, with ASP.NET and ADO.NET support, Visual Studio.NET software tools to build Web-based software, and new XML support in the SQL Server 2000 database.  &lt;br /&gt;• Bill Gates is supervising the .NET project. &lt;br /&gt;.NET Building Blocks&lt;br /&gt;  &lt;br /&gt;________________________________________&lt;br /&gt;.NET Building Blocks is a set of core Internet Services.&lt;br /&gt;________________________________________&lt;br /&gt;Web Services&lt;br /&gt;Web Services provide data and services to other applications.&lt;br /&gt;Future applications will access Web Services via standard Web Formats (HTTP, HTML, XML, and SOAP), with no need to know how the Web Service itself is implemented.&lt;br /&gt;Web Services are main building blocks in the Microsoft .NET programming model.&lt;br /&gt;________________________________________&lt;br /&gt;Standard Communication&lt;br /&gt;Official Web standards (XML, UDDI, SOAP) will be used to describe what Internet data is, and to describe what Web Services can do.&lt;br /&gt;Future Web applications will be built on flexible services that can interact and exchange data, without the loss of integrity.&lt;br /&gt;________________________________________&lt;br /&gt;Internet Storages&lt;br /&gt;.NET offers secure and addressable places to store data and applications on the Web. Allowing all types of Internet devices (PCs, Palmtops, Phones) to access data and applications.&lt;br /&gt;These Web Services are built on Microsoft's existing NTFS, SQL Server, and Exchange technologies.&lt;br /&gt;________________________________________&lt;br /&gt;Internet Dynamic Delivery&lt;br /&gt;Reliable automatic upgrades by demand and installation independent applications.&lt;br /&gt;.NET will support rapid development of applications that can be dynamically reconfigured. &lt;br /&gt;________________________________________&lt;br /&gt;Internet Identity&lt;br /&gt;.NET supports many different levels of authentication services like passwords, wallets, and smart cards.&lt;br /&gt;These services are built on existing Microsoft Passport and Windows Authentication technologies.&lt;br /&gt;________________________________________&lt;br /&gt;Internet Messaging&lt;br /&gt;.NET supports integration of messaging, e-mail, voice-mail, and fax into one unified Internet Service, targeted for all kinds of PCs or smart Internet devices.&lt;br /&gt;These services are built on existing Hotmail, Exchange and Instant Messenger technologies.&lt;br /&gt;________________________________________&lt;br /&gt;Internet Calendar&lt;br /&gt;.NET supports Internet integration of work, social, and private home calendars. Allowing all types of Internet devices (PCs, Palmtops, Phones) to access the data.&lt;br /&gt;These services are built on existing Outlook and Hotmail technologies.&lt;br /&gt;________________________________________&lt;br /&gt;Internet Directory Services&lt;br /&gt;.NET supports a new kind of directory services that can answer XML based questions about Internet Services, far more exactly than search engines and yellow pages.&lt;br /&gt;These services are built on the UDDI standard.&lt;br /&gt;________________________________________&lt;br /&gt;NET Software&lt;br /&gt;  &lt;br /&gt;________________________________________&lt;br /&gt;.NET is a mix of technologies, standards and development tools&lt;br /&gt;________________________________________&lt;br /&gt;Windows.NET&lt;br /&gt;Today, Windows 2000 and Windows XP form the backbone of .NET.&lt;br /&gt;In the future, the .NET infrastructure will be integrated into all Microsoft's operating systems, desktop and server products.&lt;br /&gt;Windows.NET is the next generation Windows. It will provide support for all the .NET building blocks and .NET digital media. Windows.NET will be self-supporting with updates via Internet as users need them.&lt;br /&gt;________________________________________&lt;br /&gt;Office.NET&lt;br /&gt;A new version of Microsoft Office - Office.NET - will have a new .NET architecture based on Internet clients and Web Services.&lt;br /&gt;With Office.NET, browsing, communication, document handling and authoring will be integrated within a XML-based environment which allow users to store their documents on the Internet.&lt;br /&gt;________________________________________&lt;br /&gt;ASP.NET&lt;br /&gt;ASP.NET is the latest version of ASP. It includes Web Services to link applications, services and devices using HTTP, HTML, XML and SOAP.&lt;br /&gt;New in ASP.NET:&lt;br /&gt;• New Language Support &lt;br /&gt;• Programmable Controls &lt;br /&gt;• Event Driven Programming &lt;br /&gt;• XML Based Components &lt;br /&gt;• User Authentication &lt;br /&gt;• User Accounts and Roles &lt;br /&gt;• High Scalability &lt;br /&gt;• Compiled Code &lt;br /&gt;• Easy Configuration &lt;br /&gt;• Easy Deployment &lt;br /&gt;• Not ASP Compatible &lt;br /&gt;• Includes ADO.NET &lt;br /&gt;You can read more about ASP.NET and ADO.NET in our ASP.NET Tutorial.&lt;br /&gt;________________________________________&lt;br /&gt;Visual Studio.NET&lt;br /&gt;The latest version of Visual Studio - Visual Studio.NET - incorporates ASP.NET, ADO.NET, Web Services, Web Forms, and language innovations for Visual Basic. The development tools have deep XML support, an XML-based programming model and new object-oriented programming capabilities.&lt;br /&gt;________________________________________&lt;br /&gt;Visual Basic.NET&lt;br /&gt;Visual Basic.NET has added language enhancements, making it a full object-oriented programming language.&lt;br /&gt;________________________________________&lt;br /&gt;SQL Server 2000&lt;br /&gt;SQL Server 2000 is a fully web-enabled database.&lt;br /&gt;SQL Server 2000 has strong support for XML and HTTP which are two of the main infrastructure technologies for .NET.&lt;br /&gt;Some of the most important new SQL Server features are direct access to the database from a browser, query of relational data with results returned as XML, as well as storage of XML in relational formats.&lt;br /&gt;________________________________________&lt;br /&gt;Internet Information Services 6.0&lt;br /&gt;IIS 6.0 has strong support for more programming to take place on the server, to allow the new Web Applications to run in any browser on any platform.&lt;br /&gt;.NET Web Services&lt;br /&gt;  &lt;br /&gt;________________________________________&lt;br /&gt;Web services are small units of code built to handle a limited task.&lt;br /&gt;________________________________________&lt;br /&gt;What are Web Services?&lt;br /&gt;• Web services are small units of code &lt;br /&gt;• Web services are designed to handle a limited set of tasks &lt;br /&gt;• Web services use XML based communicating protocols &lt;br /&gt;• Web services are independent of operating systems &lt;br /&gt;• Web services are independent of programming languages &lt;br /&gt;• Web services connect people, systems and devices &lt;br /&gt;________________________________________&lt;br /&gt;Small Units of Code&lt;br /&gt;Web services are small units of code designed to handle a limited set of tasks.&lt;br /&gt;An example of a web service can be a small program designed to supply other applications with the latest stock exchange prices. Another example can be a small program designed to handle credit card payment.&lt;br /&gt;________________________________________&lt;br /&gt;XML Based Web Protocols&lt;br /&gt;Web services use the standard web protocols HTTP, XML, SOAP, WSDL, and UDDI.&lt;br /&gt;HTTP&lt;br /&gt;HTTP (Hypertext Transfer Protocol) is the World Wide Web standard for communication over the Internet. HTTP is standardized by the World Wide Web Consortium (W3C).&lt;br /&gt;XML&lt;br /&gt;XML (eXtensible Markup Language) is a well known standard for storing, carrying, and exchanging data. XML is standardized by the W3C.&lt;br /&gt;You can read more about XML in our XML tutorial.&lt;br /&gt;SOAP&lt;br /&gt;SOAP (Simple Object Access Protocol) is a lightweight platform and language neutral communication protocol that allows programs to communicate via standard Internet HTTP. SOAP is standardized by the W3C.&lt;br /&gt;You can read more about SOAP in our SOAP tutorial.&lt;br /&gt;WSDL&lt;br /&gt;WSDL (Web Services Description Language) is an XML-based language used to define web services and to describe how to access them. WSDL is a suggestion by Ariba, IBM and Microsoft for describing services for the W3C XML Activity on XML Protocols.&lt;br /&gt;You can read more about WSDL in our WSDL tutorial.&lt;br /&gt;UDDI&lt;br /&gt;UDDI (Universal Description, Discovery and Integration) is a directory service where businesses can register and search for web services.&lt;br /&gt;UDDI is a public registry, where one can publish and inquire about web services.&lt;br /&gt;________________________________________&lt;br /&gt;Independent of Operating Systems&lt;br /&gt;Since web services use XML based protocols to communicate with other systems, web services are independent of both operating systems and programming languages.&lt;br /&gt;An application calling a web service will always send its requests using XML, and get its answer returned as XML. The calling application will never be concerned about the operating system or the programming language running on the other computer.&lt;br /&gt;________________________________________&lt;br /&gt;Benefits of Web Services&lt;br /&gt;• Easier to communicate between applications &lt;br /&gt;• Easier to reuse existing services &lt;br /&gt;• Easier to distribute information to more consumers &lt;br /&gt;• Rapid development &lt;br /&gt;Web services make it easier to communicate between different applications. They also make it possible for developers to reuse existing web services instead of writing new ones.&lt;br /&gt;Web services can create new possibilities for many businesses because it provides an easy way to distribute information to a large number of consumers. One example could be flight schedules and ticket reservation systems.&lt;br /&gt; &lt;br /&gt;Executables, C++ (and Java too) must die&lt;br /&gt;Neither C++ nor Java can ever create standard components that can run on all computers. There is no room for these languages in future distributed applications. Executables are not standard. COM objects are not standard, DLL-files are not standard. Registry settings are not standard. INI-files are not standard. None of these components must be allowed to destroy your dream of a standard distributed application that will run on almost any computer in the world.&lt;br /&gt;________________________________________&lt;br /&gt;Clients must be Standard Internet Browsers&lt;br /&gt;Application clients must be standard clients without any additional components. No part of the applications must be stored on client computers. The application must never use, or rely on, any components, dll- or ini-files, registry settings or any other non standard settings or files stored on the client computer. (Then you can start calling it a Thin Client). Our best suggestion is to let all clients use standard Internet browsers like Internet Explorer, Netscape, or Firefox running on Windows or Mac computers.&lt;br /&gt;________________________________________&lt;br /&gt;Servers must be Standard Internet Servers&lt;br /&gt;Application servers must be standard Internet servers running standard software without any additional components. The application must never use, or rely on, any components, dll- or ini-files, registry settings or any other non standard settings or files stored on the server. Our best suggestion is to use a standard Internet server like Internet Information Services (IIS), with a standard request-handler like Active Server Pages (ASP), and a standard database connector like Active Data Objects (ADO). As your data-store you should use a standard SQL based database like Oracle or Microsoft's SQL Server. &lt;br /&gt;________________________________________&lt;br /&gt;Applications must use Internet Communication&lt;br /&gt;Application clients and servers must not be allowed to communicate via any proprietary protocol. Clients must request servers via a standard Internet protocol and servers must respond via the same protocol. Clients must be able to use any service without having to maintain a permanent connection to the server. Our best suggestion is to let servers be requested with standard stateless Internet HTTP requests. Servers should respond with a standard stateless Internet HTTP response. &lt;br /&gt;The paragraphs below describes W3Schools' vision about future Internet Distributed Applications.&lt;br /&gt;________________________________________&lt;br /&gt;Applications must be a Set of Services&lt;br /&gt;Applications can no longer be allowed to contain large masses of compiled executable code. Applications must be broken down into a number of smaller individual services that are easier to create and easier to maintain. Individual services should be developed and maintained by smaller groups of people. Services are not the same as executables, or components, or DLL's. Services should be answers to submitted requests. Services should be returned as data. Our best suggestion is to develop services as a number of server-side HTML and/or XML pages.&lt;br /&gt;________________________________________&lt;br /&gt;Services must not be Purpose Built&lt;br /&gt;Our history is full of applications that were purpose built for a single task. Many of these applications died before they were introduced, because they could not manage new changes in the requirements. This is a terrible waste of money and time. We (and the people that pay for our applications) want to create flexible applications that are so generalized that they can gracefully support future changes. Future - not even thought about - changes should easily hook into our application without crumbling or destroying it. Our best suggestion is to create flexible standard services that can be used to serve a lot of different requests.&lt;br /&gt;________________________________________&lt;br /&gt;Services must be easy to Create and Edit&lt;br /&gt;Services should not be coded if it can be avoided. If a service has to be coded, our best suggestion is to use scripts. Services should never be compiled into executables. That makes services too hard to access and to edit. Any pre-compiled component used in an application will threaten the possibility of creating an application that can move, scale and gracefully support future extensions or changes. Services should be created and modified by editing their properties and methods, not by changing their executable code. Our best suggestion is to use an XML editor to create and edit services, and to use a standard service engine to provide services by executing the service description. The service descriptions should be stored in a data store like a database or in an XML/HTML file.&lt;br /&gt;________________________________________&lt;br /&gt;Services and data must be Self Describing&lt;br /&gt;Application clients must be able to query a server for a service and to ask for the current server functions. Clients and servers must also be able to exchange data in a way so that both understand each element in the data. Our best suggestion is to use an XML based information vocabulary with a DTD (Document Type Definition) to exchange server functions, and to use XML to exchange data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-255928888233011455?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/255928888233011455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=255928888233011455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/255928888233011455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/255928888233011455'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/learn-basics-of-microsoftnet.html' title='Learn Basics of Microsoft.NET'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-5720286742273923053</id><published>2009-02-07T16:15:00.000+05:30</published><updated>2009-02-07T16:16:08.914+05:30</updated><title type='text'>Imporatnt Tactics For Programming</title><content type='html'>How to use printf function without semicolon?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are several ways to do this, below are some of the most popular ones:&lt;br /&gt;•	if(printf("Hello, World!\n")) { }&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;•	while(!printf("Hello, World!\n")) { }&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;•	switch(printf("Hello, World!\n")) { }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to swap two numbers without using temporary variable ?&lt;br /&gt;This one would figure in anyone's list of elite questions in Orkut programming communities that are guaranteed a minimum of 50 responses everytime someone raises it, if at all anyone were to be jobless enough to compile one such list. This question is often asked in many interviews in India and so obviously many would be interested in knowing the answer.&lt;br /&gt;&lt;br /&gt;And it would come as a rude jolt to many when confronted and told that there is no standard conformant way of doing this which would apply equally well to all built-in types. &lt;br /&gt;&lt;br /&gt;I would like to discuss all the solutions that have been offered so far.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;a=a+b;&lt;br /&gt;b=a-b;&lt;br /&gt;a=a-b;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The above method wont work because it doesn't take into account overflow errors. Suppose for example if we had to swap two signed numbers 1 and 32767 on a system where int is 16 bits long. On such a system, the maximum value an int can store (INT_MAX) would typically be 32767.&lt;br /&gt;&lt;br /&gt;So when the first step a+b is executed the result would be 32768, which would be larger than the maximum value that can be stored in an int variable. Consequently this value cant be stored in a and hence an overflow occurs. What happens after this is undefined. No matter what happens under the hood, the result is bound to be undefined and hence this method fails whenever an overflow occurs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;a=a*b;&lt;br /&gt;b=a/b;&lt;br /&gt;a=a/b;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This method would fail for the same reason the previous code snippet would fail. Here a*b can overflow. This has more problems as well. a/b can overflow too. This method would also fail if b were zero, as it would cause divide by zero error. So this is another worthless suggestion.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;a=a^b;&lt;br /&gt;b=b^a;&lt;br /&gt;a=a^b;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The method above wont work for floating point values. Bitwise operators are not defined for floating points and hence this solution can be used only when the numbers to be swapped are not floating points. Usage of this method on variables other than int (char, long, short) would result in Undefined Behavior(UB). In all the three methods above, the compiler implicitly uses temporary values to store the result from the mathematical operations and this temporary value is then copied into the l-value. So technically we are using temporary values here too. But let us proceed assuming that the question here is to swap two variables without defining any temporary variable in the user code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;a^=b^=a^=b;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;a=a+b-b=a;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The two code snippets shown above impresses almost every newbie the first time they see it. They would leave no stone unturned in praising the author of this code. Little do they realize that this code is not guaranteed to produce the same result on every system they test it on.&lt;br /&gt;&lt;br /&gt;Here we are entering the realm of Undefined Behavior often abbreviated as UB.&lt;br /&gt;&lt;br /&gt;There are three kinds of operators: unary, binary and ternary. Unary operators are those which operate on one and only one operand. Unary+, Unary-,dereferencing operator* are some examples. Binary operators are those which operate on two operands. Addition (+), Subtraction (-), Logical Or (||) are a few examples of binary operators. There is only one ternary operator in C++ viz ?:.&lt;br /&gt;&lt;br /&gt;When the compiler sees an expression, it breaks them into smaller units depending on a table called the operator precedence table∞. The operators at the top of the table are the ones executed first followed by other operators in the decreasing order of precedence.&lt;br /&gt;&lt;br /&gt;Now each of these operators can operate on one, two or three operands. These operands can themselves be expressions.&lt;br /&gt;&lt;br /&gt;For example : int a=(b+c)*(d+e);&lt;br /&gt;&lt;br /&gt;Here the operator * has two operands. The former is a simple expression (b+c) and the latter is another simple expression (d+e). &lt;br /&gt;&lt;br /&gt;Now the C++ standard doesn't place any condition on the order in which these expressions must be evaluated. A normal human being would first calculate (b+c) and store it in a temporary variable. He would then calculate (d+e) and store it in another temporary variable. He would then retrieve these two temporary values and then multiply them and store the result in the variable a. But the standard lays down no such conditions or rules. It leaves the choice to the compilers. So the compilers can evaluate either (d+e) first or (b+c) first. Different compilers choose to do it differently.&lt;br /&gt;&lt;br /&gt;For the simple expression given above this doesn't cause much confusion. The reader would probably be wondering as to why I am rambling on about it when evaluating (b+c) or (d+e) first doesn't change the result. &lt;br /&gt;&lt;br /&gt;Surprise!!!&lt;br /&gt;&lt;br /&gt;Consider this expression:&lt;br /&gt;&lt;br /&gt;int i=1;&lt;br /&gt;int temp=i++*(i-1);&lt;br /&gt;&lt;br /&gt;Here the operands of the multiplicative operator * are i++ and i-1;&lt;br /&gt;&lt;br /&gt;Now as mentioned before the compiler can evaluate either i++ first or (i-1) first. Let us see what happens when i++ is evaluated first. After i++ is evaluated the value that would be returned would be the existing value i.e. 1 and i would now be 2. After this i-1 is evaluated which would be 1. So i++*(i-1) would be 1*1 which is equal to 1. So temp would be 1 now.&lt;br /&gt;&lt;br /&gt;Now let us see what happens when (i-1) is evaluated first. Since i is 1, i-1 becomes zero. Irrespective of what i++ is now, i++*(i-1) would be zero. So temp is initialized to zero here.&lt;br /&gt;&lt;br /&gt;Do you realize the mistake? The result here depends on the order of evaluation and hence is unpredictable. It is unreasonable to expect all compilers to follow the same order of evaluation. Hence temp will be initialized to 1 on some systems and it will be initialized to zero on some other systems. This is Undefined Behavior and it is more often than not better to avoid coding practices like these.&lt;br /&gt;&lt;br /&gt;Now this brings me to the discussion of sequence points. I have tried hard and exhausted myself in the process of trying to convince people that they should pay special attention to this topic. Please check C-faq∞ and Wikipedia article∞ for more info on sequence points.&lt;br /&gt;&lt;br /&gt;After reading those topics some users confuse themselves between operator precedence and sequence points. Sequence points has got nothing to do with operator precedence. This requires more explanation.&lt;br /&gt;&lt;br /&gt;When a compiler sees an expression with many operators, it breaks the expression into many logical and simpler units. How it does this depends on operator precedence. &lt;br /&gt;&lt;br /&gt;For example when the compiler sees an expression like a+b*c+d, here the two operands are binary multiplicative operator * and binary addition operator +. * has higher precedence.&lt;br /&gt;&lt;br /&gt;So the first step would be to choose * as the point where the expression can be split into simpler units. So the expression would now become a+(b*c)+d. &lt;br /&gt;&lt;br /&gt;This expression is evaluated from left to right as + has left to right associativity. So the expression would become ( a + (b*c) ) + d&lt;br /&gt;&lt;br /&gt;Now assuming a and d are simple expressions themselves. In this case consider the first binary addition operator. &lt;br /&gt;&lt;br /&gt;Its operands are d and ( a + (b*c) ). Now as I mentioned before, the compiler can evaluate either d first or it can evaluate ( a + (b*c) ) first.&lt;br /&gt;&lt;br /&gt;Now if it chooses to evaluate ( a+ (b*c) ) first, it can further choose to evaluate (b*c) first or a first. And further if b and c were expressions themselves, then we cant be sure about which amongst b or c would be evaluated first. The standard doesn't guarantee much here. &lt;br /&gt;&lt;br /&gt;So the expression a+b*c+d which appears so simple to the naked eye has so many complications when we enter the realm of compilers and it is always better not to assume anything.&lt;br /&gt;&lt;br /&gt;Hope that clears things a bit.&lt;br /&gt;&lt;br /&gt;Now coming back to the original discussion. Why do those two code snippets lead to UB?&lt;br /&gt;&lt;br /&gt;For precisely the same reason (i++)*(i-1) leads to UB. In the first code snippet there are many XOR operations operating on the two variables a and b. The author of the code ends up modifying the variables a and b more than once between two sequence points which results in UB.&lt;br /&gt;&lt;br /&gt;In the second code snippet, the author assumes that b=a would be evaluated first before all other expressions. It may or may not be evaluated first. The results would be different for both the cases and hence leads to be UB again.&lt;br /&gt;&lt;br /&gt;Now to summarize, there is no known way to swap two variables without using a third variable that would apply equally well to all built-in types.&lt;br /&gt;Below is one more way to add two numbers without the arithmetic operators. This method makes use of the asterisk(*) field width specifier in the printf function and use the returned value from printf. Here the printf statement is given with field width operator in format, and the two numbers are given as argument for field widths, hence we are printing a total width of two given integer arguments. The printf function returns the number of characters printed, and here the total number of characters printed will be sum of a and b. The third and fifth arguments are zero length strings because it only needs to print the total width of two integers. &lt;br /&gt;Note that this method only works for unsigned integers.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;unsigned add(unsigned a, unsigned b)&lt;br /&gt;{&lt;br /&gt;         return printf("%*s%*s", a, "", b,"");&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;How to find whether a given number is even or odd without using % (modulus) operator ?&lt;br /&gt;A newbie question. Here is a simple C++ solution.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bool isOdd(int num){&lt;br /&gt;    return num&amp;1?true:false;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the number is odd then it's least significant bit (LSB) is set i.e. it is 1. If it is even then it is 0. When you bitwise and (&amp;) this number with 1, the result would be either 1 if the number is odd or zero if it is even.&lt;br /&gt;&lt;br /&gt;As rightly pointed out by SpS, the same code can be implemented in C (following C99 standard) as&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#include &lt;stdbool.h&gt;&lt;br /&gt;bool isOdd(int num){&lt;br /&gt;       return (num&amp;1)?true:false;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here stdbool.h defines the macros bool, true and false. The macro bool is defined to be _Bool (the boolean type according to C99 standard). true is a macro which expands to the decimal constant 1 and false is a macro which expands to decimal constant 0.&lt;br /&gt;&lt;br /&gt;For C89 sticklers&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int isOdd(int num){&lt;br /&gt;       return (num&amp;1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to find whether the given number is a power of 2 in single a single step (without using loops) ?&lt;br /&gt;&lt;br /&gt;Ok this is another often repeated question. But unlike the others, this has a legitimate solution.&lt;br /&gt;&lt;br /&gt;Before I show you the code for this, I would like to explain a few things first. We are required to find if a number is a power of 2 in just one step. A number would be a power of two if there is exactly one bit that is equal to 1 in its bit pattern (even 1 is a power of 2. 2 raised to the power zero is 1). Now we could use the method that we used to count the number of bits that are 1 in a given number and check if it is equal to 1. However that approach needs many steps and hence wont suffice here.&lt;br /&gt;&lt;br /&gt;In a number which is an exact power of 2 only 1 bit is set and all others are zero. Let the position of this 1 bit be MSB. Mathematics rules for binary numbers tells us that if we subtract 1 from this number then the number that we would get would have all its bit starting from the bit position MSB+1 set to 1. For example if the given number num is 8(00001000) then num-1 would be 7 (00000111). Now we notice that these two bit patterns dont have a 1 in the same bit position. Further observation suggests that if we bitwise and (&amp;) both these numbers we would get zero.&lt;br /&gt;&lt;br /&gt;It can also be proved that num&amp;(num-1) would be zero only if num is a power of 2. I leave that as an exercise. If you are'nt able to figure out why it is so, then just leave a comment here and I will explain that part too.&lt;br /&gt;&lt;br /&gt;Now here is the code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bool isPowerOf2(int num){&lt;br /&gt;   return ((num&gt;0) &amp;&amp; (num &amp; (num-1))==0);&lt;br /&gt;}&lt;br /&gt;How to find greatest of two/three/four numbers without using relational operators ?&lt;br /&gt;&lt;br /&gt;Finding greatest of two numbers:&lt;br /&gt;•	    int maxof2(int a,int b)&lt;br /&gt;    {&lt;br /&gt;        return (a + b + abs(a - b))/2;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;•	/****************************************************&lt;br /&gt;Purpuse  : Evaluate the bigger one of two integers.&lt;br /&gt;Author   : ALNG&lt;br /&gt;Date     : 2003-03-11 &lt;br /&gt;Original : http://search.csdn.net/Expert/topic/1515/1515035.xml&lt;br /&gt;**************************************************/&lt;br /&gt;&lt;br /&gt;inline int signof(int i)&lt;br /&gt;{&lt;br /&gt;    return unsigned(i) &gt;&gt; (sizeof (int) * 8 - 1);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;int max(int a, int b)&lt;br /&gt;{&lt;br /&gt;    int p[2];&lt;br /&gt;    p[0] = a;&lt;br /&gt;    p[1] = b;&lt;br /&gt;    &lt;br /&gt;    return p[signof(a - b)];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Function for finding greatest of three numbers:&lt;br /&gt;    int maxof3(int a, int b, int c)&lt;br /&gt;    {&lt;br /&gt;        return (a + b + c * 2 + abs(a - b) + abs(a + b - c * 2 + abs(a - b))) / 4;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Function for finding greatest of four numbers:&lt;br /&gt;    int maxof4(int a, int b, int c, int d)&lt;br /&gt;    {&lt;br /&gt;        return (a + b + c + d + abs (b - a) + abs(d - c) + abs(a + b - c - d + abs( b - a) - abs(d - c)))/ 4;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;How to print 1 to n(a user defined value) without using any kind of loops or recursion ?&lt;br /&gt;This is is very easy to implement in C++ using a constructor and a static member to count the number of objects instantiated of that class as shown in the below code:&lt;br /&gt;&lt;br /&gt;C++&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     #include &lt;iostream&gt;&lt;br /&gt;     &lt;br /&gt;     class a{&lt;br /&gt;          public:&lt;br /&gt;               a(){std::cout&lt;&lt;++i&lt;&lt;std::endl;}&lt;br /&gt;          private:&lt;br /&gt;               static int i;&lt;br /&gt;     };&lt;br /&gt;     &lt;br /&gt;     int a::i; //allocates memory for the static variable&lt;br /&gt;     &lt;br /&gt;     int main(){&lt;br /&gt;          int n=0;&lt;br /&gt;          std::cout&lt;&lt;"Enter the maximum number that you want to print: ";&lt;br /&gt;          std::cin&gt;&gt;n;&lt;br /&gt;          a* array=new a[n]; //this statement prints 1 to n because creating an array of n objects calls the default class constructor n times&lt;br /&gt;          return 0;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;Note: This does use implicit loop when objects are created, but there aren't any explicit looping statements or recursion in the program.&lt;br /&gt;&lt;br /&gt;For C language, we can do this using setjmp and longjmp as given in the below code. Again there is an implicit loop, but no explicit looping construct or recursion used.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;#include &lt;setjmp.h&gt;&lt;br /&gt;&lt;br /&gt;static jmp_buf jmpbuf;&lt;br /&gt;static int val = 1, n;&lt;br /&gt;&lt;br /&gt;void printvalue(void)&lt;br /&gt;{ &lt;br /&gt;        printf("%d\n",val++);&lt;br /&gt;        longjmp(jmpbuf,val);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;        printf("Enter the N value:");&lt;br /&gt;        scanf("%d",&amp;n);&lt;br /&gt;        if (setjmp(jmpbuf) &gt; n)&lt;br /&gt;                return 0;&lt;br /&gt;        else&lt;br /&gt;        printvalue();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is wrong with using void main()? Where does the returned value from main() go?&lt;br /&gt;&lt;br /&gt;The main() function has to return an integer value which indicates the exit status of the program. The C and C++ standards only allow declarations for main function in the below forms:&lt;br /&gt;•	int main(void) { /* ... */ }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;•	int main(int argc, char *argv[ ]) { /* ... */ }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Or any other form which is equivalent of the above two, such as int main() and int main(int argc, char **argv).&lt;br /&gt;Program to print its own source code as output&lt;br /&gt;A Program which reproduces its own source code is called as a quine.&lt;br /&gt;There are lots of ways to do this, here are some of them:&lt;br /&gt;•	main(){char *c="main(){char *c=%c%s%c;printf(c,34,c,34);}";printf(c,34,c,34);}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;•	main(){char*a="main(){char*a=%c%s%c;int b='%c';printf(a,b,a,b,b);}";int b='"';printf(a,b,a,b,b);}&lt;br /&gt;&lt;br /&gt;What are the differences between C and C++ ?&lt;br /&gt;&lt;br /&gt;Can you write a code which compiles in C but not in C++ ?&lt;br /&gt;This question puzzles many who believe that C++ is a superset of C language, and all C language code is valid in C++. But it is not true and you should read the differences between C and C++ to know how they are different.&lt;br /&gt;&lt;br /&gt;Below are few examples which compiles in C and would fail to compile in C++:&lt;br /&gt;Example 1:&lt;br /&gt;&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    int class;&lt;br /&gt;    class=10;&lt;br /&gt;    printf("%d",class);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This will not compile under C++ because class is a keyword, but will compile in C without any problems. Similarly any keywords which are specific to C++ such as public, private, virtual, friend etc can be used as identifiers in C, but not in C++.&lt;br /&gt;&lt;br /&gt;Example 2:&lt;br /&gt;&lt;br /&gt;int fun()&lt;br /&gt;{&lt;br /&gt;    //some code&lt;br /&gt;}&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    fun(10,20);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This will fail to compile in C++, because in C++, the declaration of a function with no argument list is equivalent to declaring it as function with void parameter list. But in C language, it means a function with unspecified number of arguments and we can pass any number of arguments to this function in C.&lt;br /&gt;&lt;br /&gt;Example 3:&lt;br /&gt;&lt;br /&gt;#include&lt;stdlib.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    int *array=malloc(sizeof(int)*100);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is valid in C because a pointer of type void* can be assigned to any other pointer without cast, but this is not in valid C++ because will have to give an explicit cast to it as in: &lt;br /&gt;int *array=(int*)malloc(sizeof(int)*100); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example 4:&lt;br /&gt;&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    static int i=5;&lt;br /&gt;    if(i&gt;0)&lt;br /&gt;        printf("%d\n",i);&lt;br /&gt;    else&lt;br /&gt;    { &lt;br /&gt;        i--;&lt;br /&gt;        main();&lt;br /&gt;        return 0;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;What are far, huge and near qualified pointers?&lt;br /&gt;What are far, huge and near qualified pointers?&lt;br /&gt;How to count the number of 1's (set bits) in a given number ?&lt;br /&gt;&lt;br /&gt;This is another question that confounds most of the newbies in Orkut and they end up confusing themselves and the others.&lt;br /&gt;&lt;br /&gt;There are many ways you can do this, below are a few naive methods for the beginners:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int countBits(unsigned num){&lt;br /&gt;     int count= 0;&lt;br /&gt;     while(num){&lt;br /&gt;           count += num &amp; 1;&lt;br /&gt;           num &gt;&gt;= 1;&lt;br /&gt;     }&lt;br /&gt;     return count;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int countBits(unsigned num){&lt;br /&gt;    for(unsigned int count=0; num; count++){&lt;br /&gt;         num&amp;=num-1;&lt;br /&gt;    }&lt;br /&gt;    return count;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is how you can do it in C++ using the bitset class provided in the STL.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int countBits(int num){&lt;br /&gt;     std::bitset&lt;sizeof(int)*8&gt; temp(num);&lt;br /&gt;     return temp.count();&lt;br /&gt;}&lt;br /&gt;What are wild and dangling pointers?&lt;br /&gt;A pointer which is not initialized with any address is called as a wild pointer. It may contain any garbage address, so dereferencing a wild pointer is dangerous(as it causes undefined behavior). A dangling pointer is a pointer which no longer points to any valid location. It is just as dangerous as wild pointer as it contains invalid location.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;#include&lt;stdlib.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    int *p; /*At this point, the pointer p is a wild pointer. Its uninitialized, so it may have any random address in it*/&lt;br /&gt;    p=malloc(sizeof(int)*10); /* p is initialized with the address to an array of 10 integers */&lt;br /&gt;    free(p); /* p becomes dangling pointer as it no longer points to a valid location. */&lt;br /&gt;    p=NULL; /* p is no longer dangling pointer as it now initialized with NULL*/&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;How can we return more than one value from a function?&lt;br /&gt;&lt;br /&gt;One simple way is to embed the different values that we want to return in a struct and then return the struct.&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;struct data&lt;br /&gt;{&lt;br /&gt;int a;&lt;br /&gt;float b;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;struct data myFunction(void)&lt;br /&gt;{&lt;br /&gt;struct data x;&lt;br /&gt;/*set values for the members of x*/&lt;br /&gt;return x;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;struct data myData;&lt;br /&gt;myData=myFunction();&lt;br /&gt;/*Now you can access the different values within myData structure*/&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The other way around is to pass the pointers to different objects as argument to the function.&lt;br /&gt;Suppose, you need a function fun1() to return one integer value and three float values, then, declare fun1() as:&lt;br /&gt;int fun1(float *x, float *y, float *z); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;int fun1(float *x, float *y, float *z)&lt;br /&gt;{&lt;br /&gt;int status;&lt;br /&gt;/*Set the values of *x, *y, *z and status*/&lt;br /&gt;return status;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;While calling the function, pass address of three float variables in which you want to store the returned values, like:&lt;br /&gt;x = fun1(&amp;float1, &amp;float2, &amp;float3); &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-5720286742273923053?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/5720286742273923053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=5720286742273923053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/5720286742273923053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/5720286742273923053'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/imporatnt-tactics-for-programming.html' title='Imporatnt Tactics For Programming'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-6776002614025543301</id><published>2009-02-07T16:12:00.000+05:30</published><updated>2009-02-07T16:13:56.867+05:30</updated><title type='text'>DB Interview Questions</title><content type='html'>DB Interview Questions&lt;br /&gt;Question: What is SQL?   &lt;br /&gt;&lt;br /&gt;Question: What is SELECT statement?&lt;br /&gt;&lt;br /&gt;Question: How can you compare a part of the name rather than the entire name?&lt;br /&gt;&lt;br /&gt;Question: &lt;br /&gt;What is the INSERT statement?&lt;br /&gt;&lt;br /&gt;Question: How do you delete a record from a database?&lt;br /&gt;&lt;br /&gt;Question: How could I get distinct entries from a table? &lt;br /&gt;&lt;br /&gt;Question: How to get the results of a Query sorted in any order?&lt;br /&gt;&lt;br /&gt;Question: How can I find the total number of records in a table?&lt;br /&gt;&lt;br /&gt;Question: What is GROUP BY?&lt;br /&gt;&lt;br /&gt;Question: What is the difference among "dropping a table", "truncating a table" and "deleting all records" from a table?&lt;br /&gt;&lt;br /&gt;Question: What are the Large object types suported by Oracle?&lt;br /&gt;&lt;br /&gt;Question: Difference between a "where" clause and a "having" clause ?&lt;br /&gt;&lt;br /&gt;Question: What's the difference between a primary key and a unique key?&lt;br /&gt;&lt;br /&gt;Question: What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?&lt;br /&gt;&lt;br /&gt;Question: What are triggers? How to invoke a trigger on demand? &lt;br /&gt;&lt;br /&gt;Question: What is a join and explain different types of joins. &lt;br /&gt;&lt;br /&gt;Question: What is a self join? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is SQL? &lt;br /&gt;A: SQL stands for 'Structured Query Language'.&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is SELECT statement?&lt;br /&gt;A: The SELECT statement lets you select a set of values from a table in a database. The values selected from the database table would depend on the various conditions that are specified in the SQL query.&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How can you compare a part of the name rather than the entire name?&lt;br /&gt;A: SELECT * FROM people WHERE empname LIKE '%ab%'&lt;br /&gt;Would return a recordset with records consisting empname the sequence 'ab' in empname .&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the INSERT statement? &lt;br /&gt;A: The INSERT statement lets you insert information into a database.&lt;br /&gt; &lt;br /&gt;Q: How do you delete a record from a database? &lt;br /&gt;A: Use the DELETE statement to remove records or any particular column values from a database.&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How could I get distinct entries from a table?&lt;br /&gt;A: The SELECT statement in conjunction with DISTINCT lets you select a set of distinct values from a table in a database. The values selected from the database table would of course depend on the various conditions that are specified in the SQL query. Example&lt;br /&gt;SELECT DISTINCT empname FROM emptable &lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How to get the results of a Query sorted in any order?&lt;br /&gt;A: You can sort the results and return the sorted results to your program by using ORDER BY keyword thus saving you the pain of carrying out the sorting yourself. The ORDER BY keyword is used for sorting.&lt;br /&gt;&lt;br /&gt;SELECT empname, age, city FROM emptable ORDER BY empname&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How can I find the total number of records in a table?&lt;br /&gt;A: You could use the COUNT keyword , example&lt;br /&gt;&lt;br /&gt;SELECT COUNT(*) FROM emp WHERE age&gt;40 &lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is GROUP BY?&lt;br /&gt;A: The GROUP BY keywords have been added to SQL because aggregate functions (like SUM) return the aggregate of all column values every time they are called. Without the GROUP BY functionality, finding the sum for each individual group of column values was not possible. &lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the difference among "dropping a table", "truncating a table" and "deleting all records" from a table.&lt;br /&gt;A: Dropping :  (Table structure  + Data are deleted), Invalidates the dependent objects ,Drops the indexes &lt;br /&gt;Truncating:  (Data alone deleted), Performs an automatic commit, Faster than delete&lt;br /&gt;Delete : (Data alone deleted), Doesn’t perform automatic commit&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are the Large object types suported by Oracle? &lt;br /&gt;A: Blob and Clob.&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Difference between a "where" clause and a "having" clause.&lt;br /&gt;A: Having clause is used only with group functions whereas Where is not used with.&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What's the difference between a primary key and a unique key? &lt;br /&gt;A: Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn't allow NULLs, but unique key allows one NULL only.&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors? &lt;br /&gt;A: Cursors allow row-by-row prcessing of the resultsets.&lt;br /&gt;Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. See books online for more information.&lt;br /&gt;Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one rowundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Furthere, there are restrictions on the SELECT statements that can be used with some types of cursors.&lt;br /&gt;Most of the times, set based operations can be used instead of cursors. &lt;br /&gt;&lt;br /&gt;Q: What are triggers? How to invoke a trigger on demand? &lt;br /&gt;A: Triggers are special kind of stored procedures that get executed automatically when an INSERT, UPDATE or DELETE operation takes place on a table. &lt;br /&gt;Triggers can't be invoked on demand. They get triggered only when an associated action (INSERT, UPDATE, DELETE) happens on the table on which they are defined.&lt;br /&gt;Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.&lt;br /&gt;&lt;br /&gt;Q: What is a join and explain different types of joins. &lt;br /&gt;A: Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table. &lt;br /&gt;Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.&lt;br /&gt;Q: What is a self join?&lt;br /&gt;A: Self join is just like any other join, except that two instances of the same table will be joined in the query.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3969207528823773602-6776002614025543301?l=gladiatorragu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gladiatorragu.blogspot.com/feeds/6776002614025543301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3969207528823773602&amp;postID=6776002614025543301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/6776002614025543301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3969207528823773602/posts/default/6776002614025543301'/><link rel='alternate' type='text/html' href='http://gladiatorragu.blogspot.com/2009/02/db-interview-questions.html' title='DB Interview Questions'/><author><name>Discovery</name><uri>http://www.blogger.com/profile/02092060942649579888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_vzMqAd7zZR4/SY1YVdrWXMI/AAAAAAAAACU/IiOXLi9mUZg/S220/Jack.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3969207528823773602.post-607576358294997323</id><published>2009-02-07T16:03:00.000+05:30</published><updated>2009-02-07T16:12:06.876+05:30</updated><title type='text'>TECHNICAL INTERVIEW Q&amp;A (ALL in ONE)</title><content type='html'>&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;TECHNICAL INTERVIEW QUESTIONS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Table of Contents&lt;br /&gt;&lt;br /&gt;Data Structures Aptitude	&lt;br /&gt;C Aptitude	&lt;br /&gt;C++ Aptitude and OOPS	&lt;br /&gt;Quantitative Aptitude	&lt;br /&gt;UNIX Concepts	&lt;br /&gt;RDBMS Concepts	&lt;br /&gt;SQL	&lt;br /&gt;Computer Networks	&lt;br /&gt;Operating Systems	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Data Structures Aptitude&lt;/span&gt;&lt;br /&gt;1.	What is data structure?&lt;br /&gt;A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data.&lt;br /&gt;&lt;br /&gt;2.	List out the areas in which data structures are applied extensively?	&lt;br /&gt;	Compiler Design,&lt;br /&gt;	Operating System,&lt;br /&gt;	Database Management System,&lt;br /&gt;	Statistical analysis package,&lt;br /&gt;	Numerical Analysis,&lt;br /&gt;	Graphics,&lt;br /&gt;	Artificial Intelligence,&lt;br /&gt;	Simulation&lt;br /&gt;&lt;br /&gt;3.	What are the major data structures used in the following areas : RDBMS, Network data model &amp; Hierarchical data model.&lt;br /&gt;	RDBMS                         – Array  (i.e. Array of structures)&lt;br /&gt;	Network data model      – Graph&lt;br /&gt;	Hierarchical data model – Trees&lt;br /&gt;&lt;br /&gt;4.	If you are using C language to implement the heterogeneous linked list, what pointer type will you use?&lt;br /&gt;The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type.&lt;br /&gt;       &lt;br /&gt;5.	Minimum number of queues needed to implement the priority queue?&lt;br /&gt;Two. One queue is used for actual storing of data and another for storing priorities.&lt;br /&gt;&lt;br /&gt;6.	What is the data structures used to perform recursion?&lt;br /&gt;Stack. Because of its LIFO (Last In First Out) property it remembers its ‘caller’ so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls. &lt;br /&gt;	Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used. &lt;br /&gt;&lt;br /&gt;7.	What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms?&lt;br /&gt;	Polish and Reverse Polish notations.&lt;br /&gt;&lt;br /&gt;8.	Convert the expression ((A + B) *  C – (D – E) ^ (F + G)) to equivalent Prefix and Postfix notations.&lt;br /&gt;	Prefix Notation:&lt;br /&gt;	^ - * +ABC - DE + FG Postfix Notation:&lt;br /&gt;	AB + C * DE - - FG + ^ &lt;br /&gt;9.	Sorting is not possible by using which of the following methods?&lt;br /&gt;	(a) Insertion     &lt;br /&gt;	(b) Selection     &lt;br /&gt;	(c) Exchange      &lt;br /&gt;	(d) Deletion&lt;br /&gt;&lt;br /&gt;	(d) Deletion.&lt;br /&gt;Using insertion we can perform insertion sort, using selection we can perform selection sort, using exchange we can perform the bubble sort (and other similar sorting methods). But no sorting method can be done just using deletion.&lt;br /&gt;&lt;br /&gt;10.	A binary tree with 20 nodes has            null branches?&lt;br /&gt;	21&lt;br /&gt;	Let us take a tree with 5 nodes (n=5) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It will have only 6 (ie,5+1) null branches. In general, &lt;br /&gt;	A binary tree with n nodes has exactly n+1 null nodes. &lt;br /&gt;&lt;br /&gt;11.	What are the methods available in storing sequential files ?&lt;br /&gt;	Straight merging,&lt;br /&gt;	Natural merging,&lt;br /&gt;	Polyphase sort,&lt;br /&gt;	Distribution of Initial runs.&lt;br /&gt;&lt;br /&gt;12.	How many different trees are possible with 10 nodes ?&lt;br /&gt;	1014&lt;br /&gt;	For example, consider a tree with 3 nodes(n=3), it will have the maximum combination of 5 different (ie, 23 - 3 =  5) trees.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;		i		ii		iii		   iv		     v&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	In general:&lt;br /&gt;	If there are n nodes, there exist 2n-n different trees. &lt;br /&gt;&lt;br /&gt;13.	List out few of the Application of tree data-structure?&lt;br /&gt;	The manipulation of Arithmetic expression,&lt;br /&gt;	Symbol Table construction,&lt;br /&gt;	Syntax analysis.&lt;br /&gt;&lt;br /&gt;14.	List out few of the applications that make use of Multilinked Structures?&lt;br /&gt;	Sparse matrix,&lt;br /&gt;	Index generation.&lt;br /&gt;&lt;br /&gt;15.	In tree construction which is the suitable efficient data structure?&lt;br /&gt;	(a) Array           (b) Linked list              (c) Stack           (d) Queue   (e) none&lt;br /&gt;&lt;br /&gt;(b) Linked list&lt;br /&gt;&lt;br /&gt;16.	What is the type of the algorithm used in solving the 8 Queens problem?&lt;br /&gt;	Backtracking&lt;br /&gt;&lt;br /&gt;17.	In an AVL tree, at what condition the balancing is to be done? &lt;br /&gt;	If the ‘pivotal value’ (or the ‘Height factor’) is greater than 1 or less than –1.&lt;br /&gt;&lt;br /&gt;18.	What is the bucket size, when the overlapping and collision occur at same time?&lt;br /&gt;	One. If there is only one entry possible in the bucket, when the collision occurs, there is no way to accommodate the colliding value. This results in the overlapping of values.&lt;br /&gt;&lt;br /&gt;19.	Traverse the given tree using Inorder, Preorder and Postorder traversals.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	Inorder :	D H B E A F C I G J&lt;br /&gt;	Preorder:	A B D H E C F G I J&lt;br /&gt;	Postorder:	H D E B F I J G C A&lt;br /&gt;&lt;br /&gt;20.	There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree?&lt;br /&gt;15. &lt;br /&gt;In general:&lt;br /&gt;	There are 2n-1 nodes in a full binary tree.&lt;br /&gt;By the method of elimination:&lt;br /&gt;Full binary trees contain odd number of nodes. So there cannot be full binary trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete binary tree but not a full binary tree. So the correct answer is 15.&lt;br /&gt;Note:&lt;br /&gt;	Full and Complete binary trees are different. All full binary trees are complete binary trees but not vice versa. &lt;br /&gt;&lt;br /&gt;21.	In the given binary tree, using array you can store the node 4 at which location?&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;At location  6&lt;br /&gt;&lt;br /&gt;		&lt;br /&gt;1	2	3	-	-	4	-	-	5&lt;br /&gt;		&lt;br /&gt;Root	LC1	RC1	LC2	RC2	LC3	RC3	LC4	RC4&lt;br /&gt;&lt;br /&gt;where LCn means Left Child of node n and RCn means Right Child  of node n&lt;br /&gt;&lt;br /&gt;22.	Sort the given values using Quick Sort?&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;65	70	75	80	85	60	55	50	45&lt;br /&gt;&lt;br /&gt;	Sorting takes place from the pivot value, which is the first value of the given elements, this is marked bold. The values at the left pointer and right pointer are indicated using L and R respectively.	&lt;br /&gt;&lt;br /&gt;65	70L	75	80	85	60	55	50	45R&lt;br /&gt;&lt;br /&gt;Since pivot is not yet changed the same process is continued after interchanging the values at L and R positions&lt;br /&gt;&lt;br /&gt;65	45	75 L	80	85	60	55	50 R	70&lt;br /&gt;		&lt;br /&gt;65	45	50	80 L	85	60	55 R	75	70&lt;br /&gt;&lt;br /&gt;65	45	50	55	85 L	60 R	80	75	70&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;65	45	50	55	60 R	85 L	80	75	70&lt;br /&gt;		&lt;br /&gt;When the L and R pointers cross each other the pivot value is interchanged with the value at right pointer. If the pivot is changed it means that the pivot has occupied its original position in the sorted order (shown in bold italics) and hence two different arrays are formed, one from start of the original array to the pivot position-1 and the other from pivot position+1 to end.&lt;br /&gt;&lt;br /&gt;60 L	45	50	55 R	65	85 L	80	75	70 R&lt;br /&gt;&lt;br /&gt;55 L	45	50 R	60	65	70 R	80 L	75	85&lt;br /&gt;&lt;br /&gt;50 L	45 R	55	60	65	70	80 L	75 R	85&lt;br /&gt;&lt;br /&gt;In the next pass we get the sorted form of the array.&lt;br /&gt;&lt;br /&gt;45	50	55	60	65	70	75	80	85&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;23.	For the given graph, draw the DFS and BFS?&lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	BFS:	A X G H P E M Y J&lt;br /&gt;&lt;br /&gt;	DFS:	A X H P E Y M J G&lt;br /&gt;&lt;br /&gt;24.	Classify the Hashing Functions based on the various methods by which the key value is found. &lt;br /&gt;	Direct method,&lt;br /&gt;	Subtraction method,&lt;br /&gt;	Modulo-Division method,&lt;br /&gt;	Digit-Extraction method,&lt;br /&gt;	Mid-Square method,&lt;br /&gt;	Folding method,&lt;br /&gt;	Pseudo-random method.	 &lt;br /&gt;&lt;br /&gt;25.	What are the types of Collision Resolution Techniques and the methods used in each of the type?&lt;br /&gt;	Open addressing (closed hashing),&lt;br /&gt;The methods used include:&lt;br /&gt;		Overflow block,&lt;br /&gt;	Closed addressing (open hashing)&lt;br /&gt;The methods used include:&lt;br /&gt;Linked list,&lt;br /&gt;Binary tree…&lt;br /&gt;&lt;br /&gt;26.	In RDBMS, what is the efficient data structure used in the internal storage representation?&lt;br /&gt;	B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes.    &lt;br /&gt;&lt;br /&gt;27.	Draw the B-tree of order 3 created by inserting the following data arriving in sequence – 92  24  6  7  11  8  22  4  5  16  19  20  78&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;28.	Of the following tree structure, which is, efficient considering space and time complexities?&lt;br /&gt;(a)	Incomplete Binary Tree&lt;br /&gt;(b)	Complete Binary Tree      &lt;br /&gt;(c)	Full Binary Tree&lt;br /&gt;&lt;br /&gt;	(b) Complete Binary Tree. &lt;br /&gt;By the method of elimination:&lt;br /&gt;Full binary tree loses its nature when operations of insertions and deletions are done. For incomplete binary trees, extra storage is required and overhead of NULL node checking takes place. So complete binary tree is the better one since the property of complete binary tree is maintained even after operations like additions and deletions are done on it.  &lt;br /&gt;&lt;br /&gt;29.	What is a spanning Tree?&lt;br /&gt;	A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.&lt;br /&gt;&lt;br /&gt;30.	Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?&lt;br /&gt;	No.&lt;br /&gt;	Minimal spanning tree assures that the total weight of the tree is kept at its minimum. But it doesn’t mean that the distance between any two nodes involved in the minimum-spanning tree is minimum.&lt;br /&gt;&lt;br /&gt;31.	Convert the given graph with weighted edges to minimal spanning tree. &lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;the equivalent minimal spanning tree is:           &lt;br /&gt;32.	Which is the simplest file structure?&lt;br /&gt;(a)	Sequential &lt;br /&gt;(b)	Indexed &lt;br /&gt;(c)	Random&lt;br /&gt;&lt;br /&gt;(a) Sequential&lt;br /&gt;&lt;br /&gt;33.	Whether Linked List is linear or Non-linear data structure?&lt;br /&gt;	According to Access strategies Linked list is a linear one.&lt;br /&gt;	According to Storage Linked List is a Non-linear one.&lt;br /&gt;&lt;br /&gt;34.	Draw a binary Tree for the expression :&lt;br /&gt;&lt;br /&gt;	A * B - (C + D) * (P / Q)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;35.	For the following COBOL code, draw the Binary tree?&lt;br /&gt;&lt;br /&gt;01 STUDENT_REC.&lt;br /&gt;     02 NAME.&lt;br /&gt;          03 FIRST_NAME PIC X(10).&lt;br /&gt;	    03 LAST_NAME PIC X(10).&lt;br /&gt;	&lt;br /&gt;	02 YEAR_OF_STUDY.&lt;br /&gt;	    03 FIRST_SEM PIC XX.&lt;br /&gt;	    03 SECOND_SEM PIC XX.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C Aptitude &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note : 	All the programs are tested under Turbo C/C++ compilers.  &lt;br /&gt;It is assumed that,&lt;br /&gt;	Programs run under DOS environment,&lt;br /&gt;	The underlying machine is an x86 system,&lt;br /&gt;	Program is compiled using Turbo C/C++ compiler.&lt;br /&gt;The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed). &lt;br /&gt;&lt;br /&gt;Predict the output or error(s) for the following:&lt;br /&gt;&lt;br /&gt;1.	void main()&lt;br /&gt;{&lt;br /&gt;	int  const * p=5;&lt;br /&gt;	printf("%d",++(*p));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;		Compiler error: Cannot modify a constant value. &lt;br /&gt;Explanation:    &lt;br /&gt;p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".&lt;br /&gt;&lt;br /&gt;2.	main()&lt;br /&gt;{&lt;br /&gt;	char s[ ]="man";&lt;br /&gt;	int i;&lt;br /&gt;	for(i=0;s[ i ];i++)&lt;br /&gt;	printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;            	mmmm&lt;br /&gt;                       	aaaa&lt;br /&gt;                       	nnnn&lt;br /&gt;Explanation:&lt;br /&gt;s[i], *(i+s), *(s+i), i[s] are all different ways of expressing the same idea. Generally  array name is the base address for that array. Here s is the base address. i is the index number/displacement from the base address. So, indirecting it with * is same as s[i]. i[s] may be surprising. But in the  case of  C  it is same as s[i].&lt;br /&gt;&lt;br /&gt;3.	main()&lt;br /&gt;{&lt;br /&gt;	float me = 1.1;&lt;br /&gt;	double you = 1.1;&lt;br /&gt;	if(me==you)&lt;br /&gt;printf("I love U");&lt;br /&gt;else&lt;br /&gt;		printf("I hate U");&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;I hate U&lt;br /&gt;Explanation:&lt;br /&gt;For floating point numbers (float, double, long double) the values cannot be predicted exactly. Depending on the number of bytes, the precession with of the value  represented varies. Float takes 4 bytes and long double takes 10 bytes. So float stores 0.9 with less precision than long double.&lt;br /&gt;Rule of Thumb: &lt;br /&gt;Never compare or at-least be cautious when using floating point numbers with relational operators (== , &gt;, &lt;, &lt;=, &gt;=,!= ) .  &lt;br /&gt;&lt;br /&gt;4.	main()&lt;br /&gt;	{&lt;br /&gt;	static int var = 5;&lt;br /&gt;	printf("%d ",var--);&lt;br /&gt;	if(var)&lt;br /&gt;		main();&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;5 4 3 2 1&lt;br /&gt;        	Explanation:&lt;br /&gt;When static storage class is given, it is initialized once. The change in the value of a static variable is retained even between the function calls. Main is also treated like any other ordinary function, which can be called recursively.  &lt;br /&gt;&lt;br /&gt;5.	main()&lt;br /&gt;{&lt;br /&gt;	 int c[ ]={2.8,3.4,4,6.7,5};&lt;br /&gt;	 int j,*p=c,*q=c;&lt;br /&gt;	 for(j=0;j&lt;5;j++) {&lt;br /&gt;		printf(" %d ",*c);&lt;br /&gt;	   	++q;	  }&lt;br /&gt;	 for(j=0;j&lt;5;j++){&lt;br /&gt;printf(" %d ",*p);&lt;br /&gt;++p;	  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;            	2 2 2 2 2 2 3 4 6 5&lt;br /&gt;         	Explanation: &lt;br /&gt;Initially pointer c is assigned to both p and q. In the first loop, since only q is incremented and not c , the value 2 will be printed 5 times. In second loop p itself is incremented. So the values 2 3 4 6 5 will be printed. &lt;br /&gt;	&lt;br /&gt;6.	main()&lt;br /&gt;{&lt;br /&gt;	extern int i;&lt;br /&gt;	i=20;&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:  &lt;br /&gt;Linker Error : Undefined symbol '_i'&lt;br /&gt;Explanation: &lt;br /&gt;             	extern storage class in the following declaration,&lt;br /&gt;                       		extern int i;&lt;br /&gt;specifies to the compiler that the memory for i is allocated in some other program and that address will be given to the current program at the time of linking. But linker finds that no other variable of name i is available in any other program with memory space allocated for it. Hence a linker error has occurred .&lt;br /&gt;&lt;br /&gt;7.	main()&lt;br /&gt;{&lt;br /&gt;	int i=-1,j=-1,k=0,l=2,m;&lt;br /&gt;	m=i++&amp;&amp;j++&amp;&amp;k++||l++;&lt;br /&gt;	printf("%d %d %d %d %d",i,j,k,l,m);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;            	0 0 1 3 1&lt;br /&gt;Explanation :&lt;br /&gt;Logical operations always give a result of 1 or 0 . And also the logical AND (&amp;&amp;) operator has higher priority over the logical OR (||) operator. So the expression  ‘i++ &amp;&amp; j++ &amp;&amp; k++’ is executed first. The result of this expression is 0    (-1 &amp;&amp; -1 &amp;&amp; 0 = 0). Now the expression is 0 || 2 which evaluates to 1 (because OR operator always gives 1 except for ‘0 || 0’ combination- for which it gives 0). So the value of m is 1. The values of other variables are also incremented by 1.&lt;br /&gt;&lt;br /&gt;8.	main()&lt;br /&gt;{&lt;br /&gt;	char *p;&lt;br /&gt;	printf("%d %d ",sizeof(*p),sizeof(p));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: &lt;br /&gt;            	1 2&lt;br /&gt;Explanation:&lt;br /&gt;The sizeof() operator gives the number of bytes taken by its operand. P is a character pointer, which needs one byte for storing its value (a character). Hence sizeof(*p) gives a value of 1. Since it needs two bytes to store the address of the character pointer sizeof(p) gives 2.&lt;br /&gt;&lt;br /&gt;9.	main()&lt;br /&gt;{&lt;br /&gt;	int i=3;&lt;br /&gt;	switch(i)&lt;br /&gt;	 {&lt;br /&gt;	    default:printf("zero");&lt;br /&gt;	    case 1: printf("one");&lt;br /&gt;		   break;&lt;br /&gt;	   case 2:printf("two");&lt;br /&gt;		  break;&lt;br /&gt;	  case 3: printf("three");&lt;br /&gt;		  break;&lt;br /&gt;	  }  &lt;br /&gt;}&lt;br /&gt;Answer :&lt;br /&gt;three&lt;br /&gt;Explanation :&lt;br /&gt;The default case can be placed anywhere inside the loop. It is executed only when all other cases doesn't match.&lt;br /&gt;&lt;br /&gt;10.	main()&lt;br /&gt;{&lt;br /&gt;	  printf("%x",-1&lt;&lt;4);&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;fff0&lt;br /&gt;Explanation :&lt;br /&gt;-1 is internally represented as all 1's. When left shifted four times the least significant 4 bits are filled with 0's.The %x format specifier specifies that the integer value be printed as a hexadecimal value.&lt;br /&gt;&lt;br /&gt;11.	main()&lt;br /&gt;{&lt;br /&gt;	char string[]="Hello World";&lt;br /&gt;	display(string);&lt;br /&gt;}&lt;br /&gt;void display(char *string)&lt;br /&gt;{&lt;br /&gt;	printf("%s",string);&lt;br /&gt;}&lt;br /&gt;          	Answer:&lt;br /&gt;Compiler Error : Type mismatch in redeclaration of function display &lt;br /&gt;          	Explanation :&lt;br /&gt;In third line, when the function display is encountered, the compiler doesn't know anything about the function display. It assumes the arguments and return types to be integers, (which is the default type). When it sees the actual function display, the arguments and type contradicts with what it has assumed previously. Hence a compile time error occurs.&lt;br /&gt;&lt;br /&gt;12.	main()&lt;br /&gt;{&lt;br /&gt;	int c=- -2;&lt;br /&gt;	printf("c=%d",c);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;             		c=2;&lt;br /&gt;          	Explanation:&lt;br /&gt;Here unary minus (or negation) operator is used twice. Same maths  rules applies, ie. minus * minus= plus.&lt;br /&gt;Note: &lt;br /&gt;However you cannot give like --2. Because -- operator can  only be applied to variables as a decrement operator (eg., i--). 2 is a constant and not a variable.&lt;br /&gt;&lt;br /&gt;13.	#define int char&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;	int i=65;&lt;br /&gt;	printf("sizeof(i)=%d",sizeof(i));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;          		sizeof(i)=1&lt;br /&gt;Explanation:&lt;br /&gt;Since the #define replaces the string  int by the macro char &lt;br /&gt;&lt;br /&gt;14.	main()&lt;br /&gt;{&lt;br /&gt;int i=10;&lt;br /&gt;i=!i&gt;14;&lt;br /&gt;printf("i=%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;i=0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; 	Explanation:&lt;br /&gt;In the expression !i&gt;14 , NOT (!) operator has more precedence than ‘ &gt;’ symbol.  ! is a unary logical operator. !i (!10) is 0 (not of true is false).  0&gt;14 is false (zero). &lt;br /&gt;&lt;br /&gt;15.	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char s[]={'a','b','c','\n','c','\0'};&lt;br /&gt;char *p,*str,*str1;&lt;br /&gt;p=&amp;s[3];&lt;br /&gt;str=p;&lt;br /&gt;str1=s;&lt;br /&gt;printf("%d",++*p + ++*str1-32);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;77	&lt;br /&gt;Explanation:&lt;br /&gt;p is pointing to character '\n'. str1 is pointing to character 'a' ++*p. "p is pointing to '\n' and that is incremented by one." the ASCII value of '\n' is 10, which is then incremented to 11. The value of ++*p is 11. ++*str1, str1 is pointing to 'a' that is incremented by 1 and it becomes 'b'. ASCII value of 'b' is 98.&lt;br /&gt; Now performing (11 + 98 – 32), we get 77("M");&lt;br /&gt; So we get the output 77 :: "M" (Ascii is 77).&lt;br /&gt;&lt;br /&gt;16.	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a[2][2][2] = { {10,2,3,4}, {5,6,7,8}  };&lt;br /&gt;int *p,*q;&lt;br /&gt;p=&amp;a[2][2][2];&lt;br /&gt;*q=***a;&lt;br /&gt;printf("%d----%d",*p,*q);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;SomeGarbageValue---1&lt;br /&gt;Explanation:&lt;br /&gt;p=&amp;a[2][2][2]  you declare only two 2D arrays, but you are trying to access the third 2D(which you are not declared) it will print garbage values. *q=***a starting address of a is assigned integer pointer. Now q is pointing to starting address of a. If you print *q, it will print first element of 3D array.&lt;br /&gt;	&lt;br /&gt;17.	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct xx&lt;br /&gt;{&lt;br /&gt;      int x=3;&lt;br /&gt;      char name[]="hello";&lt;br /&gt; };&lt;br /&gt;struct xx *s;&lt;br /&gt;printf("%d",s-&gt;x);&lt;br /&gt;printf("%s",s-&gt;name);&lt;br /&gt;}&lt;br /&gt;	Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;Explanation:&lt;br /&gt;You should not initialize variables in declaration&lt;br /&gt;&lt;br /&gt;18.	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct xx&lt;br /&gt;{&lt;br /&gt;int x;&lt;br /&gt;struct yy&lt;br /&gt;{&lt;br /&gt;char s;&lt;br /&gt;	struct xx *p;&lt;br /&gt;};&lt;br /&gt;struct yy *q;&lt;br /&gt;};&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;Explanation:&lt;br /&gt;The structure yy is nested within structure xx. Hence, the elements are of yy are to be accessed through the instance of structure xx, which needs an instance of yy to be known. If the instance is created after defining the structure the compiler will not know about the instance relative to xx. Hence for nested structure yy you have to declare member.&lt;br /&gt;&lt;br /&gt;19.	main()&lt;br /&gt;{&lt;br /&gt;printf("\nab");&lt;br /&gt;printf("\bsi");&lt;br /&gt;printf("\rha");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;hai&lt;br /&gt;Explanation:&lt;br /&gt;\n  - newline&lt;br /&gt;\b  - backspace&lt;br /&gt;\r  - linefeed&lt;br /&gt;&lt;br /&gt;20.	main()&lt;br /&gt;{&lt;br /&gt;int i=5;&lt;br /&gt;printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;45545&lt;br /&gt;Explanation:&lt;br /&gt;The arguments in a function call are pushed into the stack from left to right. The evaluation is by popping out from the stack. and the  evaluation is from right to left, hence the result.&lt;br /&gt;&lt;br /&gt;21.	#define square(x) x*x&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;i = 64/square(4);&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;64&lt;br /&gt;Explanation:&lt;br /&gt;the macro call square(4) will substituted by 4*4 so the expression becomes i = 64/4*4 . Since / and * has equal priority the expression will be evaluated as (64/4)*4 i.e. 16*4 = 64&lt;br /&gt;  &lt;br /&gt;22.	main()&lt;br /&gt;{&lt;br /&gt;char *p="hai friends",*p1;&lt;br /&gt;p1=p;&lt;br /&gt;while(*p!='\0') ++*p++;&lt;br /&gt;printf("%s   %s",p,p1);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;ibj!gsjfoet&lt;br /&gt;	Explanation:&lt;br /&gt;		++*p++ will be parse in the given order&lt;br /&gt;	*p that is value at the location currently pointed by p will be taken&lt;br /&gt;	++*p the retrieved value will be incremented &lt;br /&gt;	when ; is encountered the location will be incremented that is p++ will be executed&lt;br /&gt;Hence, in the while loop initial value pointed by p is ‘h’, which is changed to ‘i’ by executing ++*p and pointer moves to point, ‘a’ which is similarly changed to ‘b’ and so on. Similarly blank space is converted to ‘!’. Thus, we obtain value in p becomes “ibj!gsjfoet” and since p reaches ‘\0’ and p1 points to p thus p1doesnot print anything. &lt;br /&gt;&lt;br /&gt;23.	#include &lt;stdio.h&gt;&lt;br /&gt;#define a 10&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;#define a 50&lt;br /&gt;printf("%d",a);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;50&lt;br /&gt;Explanation:&lt;br /&gt;The preprocessor directives can be redefined anywhere in the program. So the most recently assigned value will be taken.&lt;br /&gt;&lt;br /&gt;24.	#define clrscr() 100&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;clrscr();&lt;br /&gt;printf("%d\n",clrscr());&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;100&lt;br /&gt;Explanation:&lt;br /&gt;Preprocessor executes as a seperate pass before the execution of the compiler. So textual replacement of clrscr() to 100 occurs.The input  program to compiler looks like this :&lt;br /&gt;		main()&lt;br /&gt;		{&lt;br /&gt;		     100;&lt;br /&gt;		     printf("%d\n",100);&lt;br /&gt;		}&lt;br /&gt;	Note:	&lt;br /&gt;100; is an executable statement but with no action. So it doesn't give any problem&lt;br /&gt;&lt;br /&gt;25.	main()&lt;br /&gt;{&lt;br /&gt;printf("%p",main);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;		Some address will be printed.&lt;br /&gt;Explanation:&lt;br /&gt; 	Function names are just addresses (just like array names are addresses).&lt;br /&gt;main() is also a function. So the address of function main will be printed. %p in printf specifies that the argument is an address. They are printed as hexadecimal numbers.&lt;br /&gt;&lt;br /&gt;27)	main()&lt;br /&gt;{&lt;br /&gt;clrscr();&lt;br /&gt;}&lt;br /&gt;clrscr();&lt;br /&gt;	&lt;br /&gt;Answer:&lt;br /&gt;No output/error&lt;br /&gt;Explanation:&lt;br /&gt;The first clrscr() occurs inside a function. So it becomes a function call. In the second clrscr(); is a function declaration (because it is not inside any function).&lt;br /&gt;&lt;br /&gt;28)	enum colors {BLACK,BLUE,GREEN}&lt;br /&gt; main()&lt;br /&gt;{&lt;br /&gt;  &lt;br /&gt; printf("%d..%d..%d",BLACK,BLUE,GREEN);&lt;br /&gt;   &lt;br /&gt; return(1);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;0..1..2&lt;br /&gt;Explanation:&lt;br /&gt;enum assigns numbers starting from 0, if not explicitly defined.&lt;br /&gt;&lt;br /&gt;29)	void main()&lt;br /&gt;{&lt;br /&gt; char far *farther,*farthest;&lt;br /&gt;  &lt;br /&gt; printf("%d..%d",sizeof(farther),sizeof(farthest));&lt;br /&gt;   &lt;br /&gt; }&lt;br /&gt;Answer:&lt;br /&gt;4..2  &lt;br /&gt;Explanation:&lt;br /&gt; 	the second pointer is of char type and not a far pointer&lt;br /&gt;&lt;br /&gt;30)	main()&lt;br /&gt;{&lt;br /&gt; int i=400,j=300;&lt;br /&gt; printf("%d..%d");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;400..300&lt;br /&gt;Explanation:&lt;br /&gt;printf takes the values of the first two assignments of the program. Any number of printf's may be given. All of them take only the first two values. If more number of assignments given in the program,then printf will take garbage values.&lt;br /&gt;&lt;br /&gt;31)	 main()&lt;br /&gt;{&lt;br /&gt; char *p;&lt;br /&gt; p="Hello";&lt;br /&gt; printf("%c\n",*&amp;*p);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;H &lt;br /&gt;Explanation:&lt;br /&gt;* is a dereference operator &amp; is a reference  operator. They can be    applied any number of times provided it is meaningful. Here  p points to  the first character in the string "Hello". *p dereferences it and so its value is H. Again  &amp; references it to an address and * dereferences it to the value H.&lt;br /&gt;&lt;br /&gt;32) 	main()&lt;br /&gt;{&lt;br /&gt;    int i=1;&lt;br /&gt;    while (i&lt;=5)&lt;br /&gt;    {&lt;br /&gt;       printf("%d",i);&lt;br /&gt;       if (i&gt;2)&lt;br /&gt;	  goto here;&lt;br /&gt;       i++;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;fun()&lt;br /&gt;{&lt;br /&gt;   here:&lt;br /&gt;     printf("PP");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: Undefined label 'here' in function main&lt;br /&gt;Explanation:&lt;br /&gt;Labels have functions scope, in other words The scope of the labels is limited to functions . The label 'here' is available in function fun() Hence it is not visible in function main.&lt;br /&gt;&lt;br /&gt;33)	 main()&lt;br /&gt;{&lt;br /&gt;   static char names[5][20]={"pascal","ada","cobol","fortran","perl"};&lt;br /&gt;    int i;&lt;br /&gt;    char *t;&lt;br /&gt;    t=names[3];&lt;br /&gt;    names[3]=names[4];&lt;br /&gt;    names[4]=t;	&lt;br /&gt;    for (i=0;i&lt;=4;i++)&lt;br /&gt;    	printf("%s",names[i]);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: Lvalue required in function main&lt;br /&gt;Explanation:&lt;br /&gt;Array names are pointer constants. So it cannot be modified.&lt;br /&gt;&lt;br /&gt;34)	void main()&lt;br /&gt;{&lt;br /&gt;	int i=5;&lt;br /&gt;	printf("%d",i++ + ++i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Output Cannot be predicted  exactly.&lt;br /&gt;Explanation:&lt;br /&gt;Side effects are involved in the evaluation of   i&lt;br /&gt;&lt;br /&gt;35)	void main()&lt;br /&gt;{&lt;br /&gt;	int i=5;&lt;br /&gt;	printf("%d",i+++++i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error &lt;br /&gt;Explanation:&lt;br /&gt;The expression i+++++i is parsed as i ++ ++ + i which is an illegal combination of operators. &lt;br /&gt;   &lt;br /&gt;36)	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=1,j=2;&lt;br /&gt;switch(i)&lt;br /&gt; {&lt;br /&gt; case 1:  printf("GOOD");&lt;br /&gt;	    break;&lt;br /&gt; case j:  printf("BAD");&lt;br /&gt;  	   break;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: Constant expression required in function main.&lt;br /&gt;Explanation:&lt;br /&gt;The case statement can have only constant expressions (this implies that we cannot use variable names directly so an error).&lt;br /&gt;	Note:&lt;br /&gt;Enumerated types can be used in case statements. &lt;br /&gt;&lt;br /&gt;37)	main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;printf("%d",scanf("%d",&amp;i));  // value 10 is given as input here&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;1&lt;br /&gt;Explanation:&lt;br /&gt;Scanf returns number of items successfully read and not 1/0.  Here 10 is given as input which should have been scanned successfully. So number of items read is 1. &lt;br /&gt;&lt;br /&gt;38)	#define f(g,g2) g##g2&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int var12=100;&lt;br /&gt;printf("%d",f(var,12));&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;100 &lt;br /&gt;&lt;br /&gt;39)	main()&lt;br /&gt;{&lt;br /&gt;int i=0;&lt;br /&gt; &lt;br /&gt;for(;i++;printf("%d",i)) ;&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;	1&lt;br /&gt;Explanation:&lt;br /&gt;before entering into the for loop the checking condition is "evaluated". Here it evaluates to 0 (false) and comes out of the loop, and i is incremented (note the semicolon after the for loop).&lt;br /&gt;&lt;br /&gt;40)	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;  char s[]={'a','b','c','\n','c','\0'};&lt;br /&gt;  char *p,*str,*str1;&lt;br /&gt;  p=&amp;s[3];&lt;br /&gt;  str=p;&lt;br /&gt;  str1=s;&lt;br /&gt;  printf("%d",++*p + ++*str1-32);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;M&lt;br /&gt;Explanation:&lt;br /&gt;p is pointing to character '\n'.str1 is pointing to character 'a' ++*p meAnswer:"p is pointing to '\n' and that is incremented by one." the ASCII value of '\n' is 10. then it is incremented to 11. the value of ++*p is 11. ++*str1 meAnswer:"str1 is pointing to 'a' that is incremented by 1 and it becomes 'b'. ASCII value of 'b' is 98. both 11 and 98 is added and result is subtracted from 32. &lt;br /&gt;i.e. (11+98-32)=77("M");&lt;br /&gt;	&lt;br /&gt;41)	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;  struct xx&lt;br /&gt;   {&lt;br /&gt;      int x=3;&lt;br /&gt;      char name[]="hello";&lt;br /&gt;   };&lt;br /&gt;struct xx *s=malloc(sizeof(struct xx));&lt;br /&gt;printf("%d",s-&gt;x);&lt;br /&gt;printf("%s",s-&gt;name);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;Explanation:&lt;br /&gt;Initialization should not be done for structure members inside the structure declaration&lt;br /&gt;&lt;br /&gt;42)	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct xx&lt;br /&gt; {&lt;br /&gt;	  int x;&lt;br /&gt;	  struct yy&lt;br /&gt;	   {&lt;br /&gt;	     char s;&lt;br /&gt;	     struct xx *p;&lt;br /&gt;	   };&lt;br /&gt;            	 struct yy *q;&lt;br /&gt;           	 };&lt;br /&gt;          	}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;Explanation:&lt;br /&gt;in the end of nested structure yy a member have to be declared.&lt;br /&gt;&lt;br /&gt;43)	main()&lt;br /&gt;{&lt;br /&gt; extern int i;&lt;br /&gt; i=20;&lt;br /&gt; printf("%d",sizeof(i));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Linker error: undefined symbol '_i'.&lt;br /&gt;Explanation:&lt;br /&gt;extern declaration specifies that the variable i is defined somewhere else. The compiler passes the external variable to be resolved by the linker. So compiler doesn't find an error. During linking the linker searches for the definition of i. Since it is not found the linker flags an error.&lt;br /&gt;&lt;br /&gt;44)	main()&lt;br /&gt;{&lt;br /&gt;printf("%d", out);&lt;br /&gt;}&lt;br /&gt;int out=100;&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: undefined symbol out in function main.&lt;br /&gt;Explanation:&lt;br /&gt;The rule is that a variable is available for use from the point of declaration. Even though a is a global variable, it is not available for main. Hence an error.&lt;br /&gt;&lt;br /&gt;45)	main()&lt;br /&gt;{&lt;br /&gt; extern out;&lt;br /&gt; printf("%d", out);&lt;br /&gt;}&lt;br /&gt; int out=100;&lt;br /&gt;Answer:&lt;br /&gt;100	&lt;br /&gt;	Explanation:	&lt;br /&gt;This is the correct way of writing the previous program.&lt;br /&gt;	      &lt;br /&gt;46)	main()&lt;br /&gt;{&lt;br /&gt; show();&lt;br /&gt;}&lt;br /&gt;void show()&lt;br /&gt;{&lt;br /&gt; printf("I'm the greatest");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compier error: Type mismatch in redeclaration of show.&lt;br /&gt;Explanation:&lt;br /&gt;When the compiler sees the function show it doesn't know anything about it. So the default return type (ie, int) is assumed. But when compiler sees the actual definition of show mismatch occurs since it is declared as void. Hence the error.&lt;br /&gt;The solutions are as follows:&lt;br /&gt;1. declare void show() in main() .&lt;br /&gt;2. define show() before main().&lt;br /&gt;3. declare extern void show() before the use of show().&lt;br /&gt; &lt;br /&gt;47)	main( )&lt;br /&gt;{&lt;br /&gt;  int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}};&lt;br /&gt;  printf(“%u %u %u %d \n”,a,*a,**a,***a);&lt;br /&gt;	  printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1);&lt;br /&gt; 	 }&lt;br /&gt;Answer:&lt;br /&gt;100, 100, 100, 2&lt;br /&gt;114, 104, 102, 3&lt;br /&gt;Explanation:&lt;br /&gt;		The given array is a 3-D one. It can also be viewed as a 1-D array. &lt;br /&gt;												                                                                                                                            &lt;br /&gt;2	4	7	8	3	4	2	2	2	3	3	4&lt;br /&gt;   100  102  104  106 108   110  112  114  116   118   120   122&lt;br /&gt;&lt;br /&gt;thus, for the first printf statement a, *a, **a  give address of  first element . since the indirection ***a gives the value. Hence, the first line of the output.&lt;br /&gt;for the second printf a+1 increases in the third dimension thus points to value at 114, *a+1 increments in second dimension thus points to 104, **a +1 increments the first dimension thus points to 102 and ***a+1 first gets the value at first location and then increments it by 1. Hence, the output.&lt;br /&gt;&lt;br /&gt;48)	main( )&lt;br /&gt;{&lt;br /&gt;  int a[ ] = {10,20,30,40,50},j,*p;&lt;br /&gt;  for(j=0; j&lt;5; j++)&lt;br /&gt;    {&lt;br /&gt;printf(“%d” ,*a); &lt;br /&gt;a++;&lt;br /&gt;    }&lt;br /&gt;    p = a;&lt;br /&gt;   for(j=0; j&lt;5; j++) &lt;br /&gt;      {&lt;br /&gt;printf(“%d ” ,*p); &lt;br /&gt;p++;&lt;br /&gt;      }&lt;br /&gt; }&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: lvalue required.&lt;br /&gt;		&lt;br /&gt;Explanation:&lt;br /&gt;Error is in line with statement a++. The operand must be an lvalue and may be of any of scalar type for the any operator, array name only when subscripted is an lvalue. Simply array name is a non-modifiable lvalue.&lt;br /&gt;&lt;br /&gt;49)	main( )&lt;br /&gt;{&lt;br /&gt; static int  a[ ]   = {0,1,2,3,4};&lt;br /&gt; int  *p[ ] = {a,a+1,a+2,a+3,a+4};&lt;br /&gt; int  **ptr =  p;&lt;br /&gt; ptr++;&lt;br /&gt; printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr); &lt;br /&gt; *ptr++;&lt;br /&gt; printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr); &lt;br /&gt; *++ptr;&lt;br /&gt; printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr); &lt;br /&gt; ++*ptr;&lt;br /&gt;	 printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr); &lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;	111&lt;br /&gt;	222&lt;br /&gt;	333&lt;br /&gt;	344&lt;br /&gt;Explanation:&lt;br /&gt;Let us consider the array and the two pointers with some address&lt;br /&gt;a	&lt;br /&gt;0	1	2	3	4&lt;br /&gt;   100      102      104      106      108&lt;br /&gt;					     p&lt;br /&gt;100	102	104	106	108&lt;br /&gt;  			   1000    1002    1004    1006    1008&lt;br /&gt;	     ptr	&lt;br /&gt;1000&lt;br /&gt;2000&lt;br /&gt;After execution of the instruction ptr++ value in ptr becomes 1002, if scaling factor for integer is 2 bytes. Now ptr – p is value in ptr – starting location of array p, (1002 – 1000) / (scaling factor) = 1,  *ptr – a = value at address pointed by ptr – starting value of array a, 1002 has a value 102  so the value is (102 – 100)/(scaling factor) = 1,  **ptr is the value stored in the location pointed by  the pointer of ptr = value pointed by value pointed by 1002 = value pointed by 102 = 1. Hence the output of the firs printf is  1, 1, 1.&lt;br /&gt;After execution of *ptr++ increments value of the value in ptr by scaling factor, so it becomes1004. Hence, the outputs for the second printf are ptr – p = 2, *ptr – a = 2, **ptr = 2. &lt;br /&gt;After execution of *++ptr increments value of the value in ptr by scaling factor, so it becomes1004. Hence, the outputs for the third printf are ptr – p = 3, *ptr – a = 3, **ptr = 3. &lt;br /&gt;After execution of ++*ptr value in ptr remains the same, the value pointed by the value is incremented by the scaling factor. So the value in array p at location 1006 changes from 106 10 108,. Hence, the outputs for the fourth printf are ptr – p = 1006 – 1000 = 3, *ptr – a = 108 – 100 = 4, **ptr = 4. &lt;br /&gt;&lt;br /&gt;50)	main( )&lt;br /&gt;{&lt;br /&gt; char  *q;&lt;br /&gt; int  j;&lt;br /&gt; for (j=0; j&lt;3; j++) scanf(“%s” ,(q+j));&lt;br /&gt; for (j=0; j&lt;3; j++) printf(“%c” ,*(q+j));&lt;br /&gt; for (j=0; j&lt;3; j++) printf(“%s” ,(q+j));&lt;br /&gt;}&lt;br /&gt;Explanation:&lt;br /&gt;Here we have only one pointer to type char and since we take input in the same pointer thus we keep writing over in the same location, each time shifting the pointer value by 1. Suppose the inputs are MOUSE,  TRACK and VIRTUAL. Then for the first input suppose the pointer starts at location 100 then the input one is stored as&lt;br /&gt;M	O	U	S	E	\0&lt;br /&gt;When the second input is given the pointer is incremented as j value becomes 1, so the input is filled in memory starting from 101.&lt;br /&gt;M	T	R	A	C	K	\0&lt;br /&gt;The third input  starts filling from the location 102&lt;br /&gt;M	T	V	I	R	T	U	A	L	\0&lt;br /&gt;This is the final value stored .&lt;br /&gt;The first printf prints the values at the position q, q+1 and q+2  = M T V&lt;br /&gt;The second printf prints three strings starting from locations q, q+1, q+2&lt;br /&gt; i.e  MTVIRTUAL, TVIRTUAL and VIRTUAL.&lt;br /&gt;   &lt;br /&gt;51)	main( )&lt;br /&gt;{&lt;br /&gt; void *vp;&lt;br /&gt; char ch = ‘g’, *cp = “goofy”;&lt;br /&gt; int j = 20;&lt;br /&gt; vp = &amp;ch;&lt;br /&gt; printf(“%c”, *(char *)vp);&lt;br /&gt; vp = &amp;j;&lt;br /&gt; printf(“%d”,*(int *)vp);&lt;br /&gt; vp = cp;&lt;br /&gt; printf(“%s”,(char *)vp + 3);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;	g20fy&lt;br /&gt;Explanation:&lt;br /&gt;Since a void pointer is used it can be type casted to any  other type pointer. vp = &amp;ch  stores address of char ch and the next statement prints the value stored in vp after type casting it to the proper data type pointer. the output is ‘g’. Similarly  the output from second printf is ‘20’. The third printf statement type casts it to print the string from the 4th value hence the output is ‘fy’.&lt;br /&gt;&lt;br /&gt;52)	main ( )&lt;br /&gt;{&lt;br /&gt; static char *s[ ]  = {“black”, “white”, “yellow”, “violet”};&lt;br /&gt; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;&lt;br /&gt; p = ptr;&lt;br /&gt; **++p;&lt;br /&gt; printf(“%s”,*--*++p + 3);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;	ck&lt;br /&gt;Explanation:&lt;br /&gt;In this problem we have an array of char pointers pointing to start of 4 strings. Then we have ptr which is a pointer to a pointer of type char and a variable p which is a pointer to a pointer to a pointer of type char. p hold the initial value of ptr, i.e. p = s+3. The next statement increment value in p by 1 , thus now value of p =  s+2. In the printf statement the expression is evaluated *++p causes gets value s+1 then the pre decrement is executed and we get s+1 – 1 = s . the indirection operator now gets the value from the array of s and adds 3 to the starting address. The string is printed starting from this position. Thus, the output is ‘ck’.&lt;br /&gt;&lt;br /&gt;53)	main()&lt;br /&gt;{&lt;br /&gt; int  i, n;&lt;br /&gt; char *x = “girl”;&lt;br /&gt; n = strlen(x);&lt;br /&gt; *x = x[n];&lt;br /&gt; for(i=0; i&lt;n; ++i)&lt;br /&gt;   {&lt;br /&gt;printf(“%s\n”,x);&lt;br /&gt;x++;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;Answer:&lt;br /&gt;(blank space)&lt;br /&gt;irl&lt;br /&gt;rl&lt;br /&gt;l&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;Here a string (a pointer to char) is initialized with a value “girl”.  The strlen function returns the length of the string, thus n has a value 4. The next statement assigns value at the nth location (‘\0’) to the first location. Now the string becomes “\0irl” . Now the printf statement prints the string after each iteration it increments it starting position.  Loop starts from 0 to 4. The first time x[0] = ‘\0’ hence it prints nothing and pointer value is incremented. The second time it prints from x[1] i.e “irl” and the third time it prints “rl” and the last time it prints “l” and the loop terminates.&lt;br /&gt;54)	int i,j;&lt;br /&gt;	for(i=0;i&lt;=10;i++)&lt;br /&gt;	{&lt;br /&gt;	j+=5;&lt;br /&gt;	assert(i&lt;5);&lt;br /&gt;	}&lt;br /&gt;Answer: &lt;br /&gt;Runtime error: Abnormal program termination. &lt;br /&gt;			assert failed (i&lt;5), &lt;file name&gt;,&lt;line number&gt; &lt;br /&gt;Explanation:&lt;br /&gt;asserts are used during debugging to make sure that certain conditions are satisfied. If assertion fails, the program will terminate reporting the same. After debugging use,&lt;br /&gt;	#undef NDEBUG&lt;br /&gt;and this will disable all the assertions from the source code. Assertion&lt;br /&gt;is a good debugging tool to make use of.  &lt;br /&gt;  &lt;br /&gt;55)	main()&lt;br /&gt;	{&lt;br /&gt;	int i=-1;&lt;br /&gt;	+i;&lt;br /&gt;	printf("i = %d, +i = %d \n",i,+i);&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt; i = -1, +i = -1&lt;br /&gt;Explanation:&lt;br /&gt;Unary + is the only dummy operator in C. Where-ever it comes you can just ignore it just because it has no effect in the expressions (hence the name dummy operator).&lt;br /&gt;&lt;br /&gt;56)	What are the files which are automatically opened when a C file is executed?&lt;br /&gt;Answer:&lt;br /&gt;stdin, stdout, stderr (standard input,standard output,standard error).&lt;br /&gt;&lt;br /&gt;57) what will be the position of the file marker?&lt;br /&gt;	a: fseek(ptr,0,SEEK_SET);&lt;br /&gt;	b: fseek(ptr,0,SEEK_CUR);&lt;br /&gt;&lt;br /&gt;Answer :&lt;br /&gt;	a: The SEEK_SET sets the file position marker to the starting of the file.&lt;br /&gt;		b: The SEEK_CUR sets the file position marker to the current position&lt;br /&gt;	of the file.&lt;br /&gt;&lt;br /&gt;58)	main()&lt;br /&gt;	{&lt;br /&gt;	char name[10],s[12];&lt;br /&gt;	scanf(" \"%[^\"]\"",s);&lt;br /&gt;	}&lt;br /&gt;	How scanf will execute? &lt;br /&gt;Answer:&lt;br /&gt;First it checks for the leading white space and discards it.Then it matches with a quotation mark and then it  reads all character upto another quotation mark.&lt;br /&gt;&lt;br /&gt;59)	What is the problem with the following code segment?&lt;br /&gt;	while ((fgets(receiving array,50,file_ptr)) != EOF)&lt;br /&gt;			;&lt;br /&gt;Answer &amp; Explanation:&lt;br /&gt;fgets returns a pointer. So the correct end of file check is checking for != NULL.&lt;br /&gt;&lt;br /&gt;60)	main()&lt;br /&gt;	{&lt;br /&gt;	main();&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt; Runtime error : Stack overflow.&lt;br /&gt;Explanation:&lt;br /&gt;main function calls itself again and again. Each time the function is called its return address is stored in the call stack. Since there is no condition to terminate the function call, the call stack overflows at runtime. So it terminates the program and results in an error.&lt;br /&gt;&lt;br /&gt;61)	main()&lt;br /&gt;	{&lt;br /&gt;	char *cptr,c;&lt;br /&gt;	void *vptr,v;&lt;br /&gt;	c=10;  v=0;&lt;br /&gt;	cptr=&amp;c; vptr=&amp;v;&lt;br /&gt;	printf("%c%v",c,v);&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error (at line number 4): size of v is Unknown.&lt;br /&gt;Explanation:&lt;br /&gt;You can create a variable of type void * but not of type void, since void is an empty type. In the second line you are creating variable vptr of type void * and v of type void hence an error.&lt;br /&gt;&lt;br /&gt;62)	main()&lt;br /&gt;	{&lt;br /&gt;	char *str1="abcd";&lt;br /&gt;	char str2[]="abcd";&lt;br /&gt;	printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd"));&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;2 5 5&lt;br /&gt;Explanation:&lt;br /&gt;In first sizeof, str1 is a character pointer so it gives you the size of the pointer variable. In second sizeof the name str2 indicates the name of the array whose size is 5 (including the '\0' termination character). The third sizeof is similar to the second one.&lt;br /&gt;&lt;br /&gt;63)	main()&lt;br /&gt;	{&lt;br /&gt;	char not;&lt;br /&gt;	not=!2;&lt;br /&gt;	printf("%d",not);&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;0&lt;br /&gt;Explanation:&lt;br /&gt;! is a logical operator. In C the value 0 is considered to be the boolean value FALSE, and any non-zero value is considered to be the boolean value TRUE. Here 2 is a non-zero value so TRUE. !TRUE is FALSE (0) so it prints 0.&lt;br /&gt;&lt;br /&gt;64)	#define FALSE -1&lt;br /&gt;	#define TRUE   1&lt;br /&gt;	#define NULL   0&lt;br /&gt;	main() {&lt;br /&gt;	   if(NULL)&lt;br /&gt;		puts("NULL");&lt;br /&gt;	   else if(FALSE)&lt;br /&gt;		puts("TRUE");&lt;br /&gt;	   else&lt;br /&gt;		puts("FALSE");&lt;br /&gt;	   }&lt;br /&gt;Answer:&lt;br /&gt;TRUE&lt;br /&gt;Explanation:&lt;br /&gt;The input program to the compiler after processing by the preprocessor is,&lt;br /&gt;	main(){&lt;br /&gt;		if(0)&lt;br /&gt;			puts("NULL");&lt;br /&gt;	else if(-1)&lt;br /&gt;			puts("TRUE");&lt;br /&gt;	else&lt;br /&gt;			puts("FALSE");&lt;br /&gt;		}&lt;br /&gt;Preprocessor doesn't replace the values given inside the double quotes. The check by if condition is boolean value false so it goes to else. In second if -1 is boolean value true hence "TRUE" is printed.&lt;br /&gt;&lt;br /&gt;65)	main()&lt;br /&gt;	{&lt;br /&gt;	int k=1;&lt;br /&gt;	printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE");&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;1==1 is TRUE&lt;br /&gt;Explanation:&lt;br /&gt;When two strings are placed together (or separated by white-space) they are concatenated (this is called as "stringization" operation). So the string is as if it is given as "%d==1 is %s". The conditional operator( ?: ) evaluates to "TRUE".&lt;br /&gt;&lt;br /&gt;66)	main()&lt;br /&gt;	{&lt;br /&gt;	int y;&lt;br /&gt;	scanf("%d",&amp;y); // input given is 2000&lt;br /&gt;	if( (y%4==0 &amp;&amp; y%100 != 0) || y%100 == 0 )&lt;br /&gt;	     printf("%d is a leap year");&lt;br /&gt;	else&lt;br /&gt;	     printf("%d is not a leap year");&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;2000 is a leap year&lt;br /&gt;Explanation:&lt;br /&gt;An ordinary program to check if leap year or not.&lt;br /&gt;&lt;br /&gt;67)  	#define max 5&lt;br /&gt;	#define int arr1[max]&lt;br /&gt;	main()&lt;br /&gt;	{&lt;br /&gt;	typedef char arr2[max];&lt;br /&gt;	arr1 list={0,1,2,3,4};&lt;br /&gt;	arr2 name="name";&lt;br /&gt;	printf("%d %s",list[0],name);&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error (in the line arr1 list = {0,1,2,3,4})&lt;br /&gt;Explanation:&lt;br /&gt;arr2 is declared of type array of size 5 of characters. So it can be used to declare the variable name of the type arr2. But it is not the case of arr1. Hence an error.&lt;br /&gt;Rule of Thumb: &lt;br /&gt;#defines are used for textual replacement whereas typedefs are used for declaring new types.&lt;br /&gt;&lt;br /&gt;68)	int i=10;&lt;br /&gt;	main()&lt;br /&gt;	{&lt;br /&gt; 	 extern int i;&lt;br /&gt;          	  {&lt;br /&gt;	     int i=20;&lt;br /&gt;		{&lt;br /&gt;		 const volatile unsigned i=30;&lt;br /&gt;		 printf("%d",i);&lt;br /&gt;		}&lt;br /&gt;	      printf("%d",i);&lt;br /&gt;	   }&lt;br /&gt;	printf("%d",i);&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;30,20,10&lt;br /&gt;Explanation:&lt;br /&gt;'{' introduces new block and thus new scope. In the innermost block i is declared as, &lt;br /&gt;	const volatile unsigned&lt;br /&gt;which is a valid declaration. i is assumed of type int. So printf prints 30. In the next block, i has value 20 and so printf prints 20. In the outermost block, i is declared as extern, so no storage space is allocated for it. After compilation is over the linker resolves it to global variable i (since it is the only variable visible there). So it prints i's value as 10.&lt;br /&gt;&lt;br /&gt;69)	main()&lt;br /&gt;	{&lt;br /&gt;	    int *j;&lt;br /&gt;	    {&lt;br /&gt;	     int i=10;&lt;br /&gt;	     j=&amp;i;&lt;br /&gt;	     }&lt;br /&gt;	     printf("%d",*j);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;10&lt;br /&gt;Explanation:&lt;br /&gt;The variable i is a block level variable and the visibility is inside that block only. But the lifetime of i is lifetime of the function so it lives upto the exit of main function. Since the i is still allocated space, *j prints the value stored in i since j points i.&lt;br /&gt;&lt;br /&gt;70)	main()&lt;br /&gt;	{&lt;br /&gt;	int i=-1;&lt;br /&gt;	-i;&lt;br /&gt;	printf("i = %d, -i = %d \n",i,-i);&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;i = -1, -i = 1&lt;br /&gt;Explanation:&lt;br /&gt;-i is executed and this execution doesn't affect the value of i. In printf first you just print the value of i. After that the value of the expression -i = -(-1) is printed.&lt;br /&gt;&lt;br /&gt;71)	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt; {&lt;br /&gt;   const int i=4;&lt;br /&gt;   float j;&lt;br /&gt;   j = ++i;&lt;br /&gt;   printf("%d  %f", i,++j);&lt;br /&gt; }&lt;br /&gt;Answer:&lt;br /&gt;Compiler error &lt;br /&gt;  	Explanation:&lt;br /&gt;i is a constant. you cannot change the value of constant &lt;br /&gt;&lt;br /&gt;72)	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;  int a[2][2][2] = { {10,2,3,4}, {5,6,7,8}  };&lt;br /&gt;  int *p,*q;&lt;br /&gt;  p=&amp;a[2][2][2];&lt;br /&gt;  *q=***a;&lt;br /&gt;  printf("%d..%d",*p,*q);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;garbagevalue..1&lt;br /&gt;Explanation:&lt;br /&gt;p=&amp;a[2][2][2]  you declare only two 2D arrays. but you are trying to access the third 2D(which you are not declared) it will print garbage values. *q=***a starting address of a is assigned integer pointer. now q is pointing to starting address of a.if you print *q meAnswer:it will print first element of 3D array.&lt;br /&gt;&lt;br /&gt;73)	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;  {&lt;br /&gt;    register i=5;&lt;br /&gt;    char j[]= "hello";                     &lt;br /&gt;     printf("%s  %d",j,i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;hello 5&lt;br /&gt;Explanation:&lt;br /&gt;if you declare i as register  compiler will treat it as ordinary integer and it will take integer value. i value may be  stored  either in register  or in memory.&lt;br /&gt;&lt;br /&gt;74)	main()&lt;br /&gt;{&lt;br /&gt;	  int i=5,j=6,z;&lt;br /&gt;	  printf("%d",i+++j);&lt;br /&gt;	 }&lt;br /&gt;Answer:&lt;br /&gt;11&lt;br /&gt;Explanation:&lt;br /&gt;the expression i+++j is treated as (i++ + j)    &lt;br /&gt;	  &lt;br /&gt;76)	struct aaa{&lt;br /&gt;struct aaa *prev;&lt;br /&gt;int i;&lt;br /&gt;struct aaa *next;&lt;br /&gt;};&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt; struct aaa abc,def,ghi,jkl;&lt;br /&gt; int x=100;&lt;br /&gt; abc.i=0;abc.prev=&amp;jkl;&lt;br /&gt; abc.next=&amp;def;&lt;br /&gt; def.i=1;def.prev=&amp;abc;def.next=&amp;ghi;&lt;br /&gt; ghi.i=2;ghi.prev=&amp;def;&lt;br /&gt; ghi.next=&amp;jkl;&lt;br /&gt; jkl.i=3;jkl.prev=&amp;ghi;jkl.next=&amp;abc;&lt;br /&gt; x=abc.next-&gt;next-&gt;prev-&gt;next-&gt;i;&lt;br /&gt; printf("%d",x);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;2&lt;br /&gt;Explanation:&lt;br /&gt;		above all statements form a double circular linked list;&lt;br /&gt;abc.next-&gt;next-&gt;prev-&gt;next-&gt;i &lt;br /&gt;this one points to "ghi" node the value of at particular node is 2.&lt;br /&gt;&lt;br /&gt;77)	struct point&lt;br /&gt; {&lt;br /&gt; int x;&lt;br /&gt; int y;&lt;br /&gt; };&lt;br /&gt;struct point origin,*pp;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;pp=&amp;origin;&lt;br /&gt;printf("origin is(%d%d)\n",(*pp).x,(*pp).y);&lt;br /&gt;printf("origin is (%d%d)\n",pp-&gt;x,pp-&gt;y);&lt;br /&gt;} &lt;br /&gt;	&lt;br /&gt;Answer:&lt;br /&gt;origin is(0,0)&lt;br /&gt;origin is(0,0) &lt;br /&gt;Explanation:&lt;br /&gt;pp is a pointer to structure. we can access the elements of the structure either with arrow mark or with indirection operator. &lt;br /&gt;Note: &lt;br /&gt;Since structure point  is globally declared x &amp; y are initialized as zeroes &lt;br /&gt;		&lt;br /&gt;78)	main()&lt;br /&gt;{&lt;br /&gt; int i=_l_abc(10);&lt;br /&gt; 	 printf("%d\n",--i);&lt;br /&gt;}&lt;br /&gt;int _l_abc(int i)&lt;br /&gt;{&lt;br /&gt; return(i++);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;9&lt;br /&gt;Explanation: &lt;br /&gt;return(i++) it will first return i and then increments. i.e. 10 will be returned.&lt;br /&gt;&lt;br /&gt;79)	main()&lt;br /&gt;{&lt;br /&gt; char *p;&lt;br /&gt; int *q;&lt;br /&gt; long *r;&lt;br /&gt; p=q=r=0;&lt;br /&gt; p++;&lt;br /&gt; q++;&lt;br /&gt; r++;&lt;br /&gt; printf("%p...%p...%p",p,q,r);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;0001...0002...0004&lt;br /&gt;Explanation:&lt;br /&gt;++ operator  when applied to pointers increments address according to their corresponding data-types.&lt;br /&gt;&lt;br /&gt; 80)	main()&lt;br /&gt;{&lt;br /&gt; char c=' ',x,convert(z);&lt;br /&gt; getc(c);&lt;br /&gt; if((c&gt;='a') &amp;&amp; (c&lt;='z'))&lt;br /&gt; x=convert(c);&lt;br /&gt; printf("%c",x);&lt;br /&gt;}&lt;br /&gt;convert(z)&lt;br /&gt;{&lt;br /&gt;  return z-32;&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;Compiler error&lt;br /&gt;Explanation:&lt;br /&gt;declaration of convert and format of getc() are wrong. &lt;br /&gt;&lt;br /&gt;81)	main(int argc, char **argv)&lt;br /&gt;{&lt;br /&gt; printf("enter the character");&lt;br /&gt; getchar();&lt;br /&gt; sum(argv[1],argv[2]);&lt;br /&gt;}&lt;br /&gt;sum(num1,num2)&lt;br /&gt;int num1,num2;&lt;br /&gt;{&lt;br /&gt; return num1+num2;&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error.&lt;br /&gt;Explanation:&lt;br /&gt;argv[1] &amp; argv[2] are strings. They are passed to the function sum without converting it to integer values.  &lt;br /&gt;&lt;br /&gt;82)	# include &lt;stdio.h&gt;&lt;br /&gt;int one_d[]={1,2,3};&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt; int *ptr; &lt;br /&gt; ptr=one_d;&lt;br /&gt; ptr+=3;&lt;br /&gt; printf("%d",*ptr);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;garbage value&lt;br /&gt;Explanation:&lt;br /&gt;ptr pointer is pointing to out of the array range of one_d.&lt;br /&gt;&lt;br /&gt;83)	# include&lt;stdio.h&gt;&lt;br /&gt;aaa() {&lt;br /&gt;  printf("hi");&lt;br /&gt; }&lt;br /&gt;bbb(){&lt;br /&gt; printf("hello");&lt;br /&gt; }&lt;br /&gt;ccc(){&lt;br /&gt; printf("bye");&lt;br /&gt; }&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;  int (*ptr[3])();&lt;br /&gt;  ptr[0]=aaa;&lt;br /&gt;  ptr[1]=bbb;&lt;br /&gt;  ptr[2]=ccc;&lt;br /&gt;  ptr[2]();&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;bye &lt;br /&gt;Explanation:&lt;br /&gt;ptr is array of pointers to functions of return type int.ptr[0] is assigned to address of the function aaa. Similarly ptr[1] and ptr[2] for bbb and ccc respectively. ptr[2]() is in effect of writing ccc(), since ptr[2] points to ccc.&lt;br /&gt;&lt;br /&gt;85)	#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;FILE *ptr;&lt;br /&gt;char i;&lt;br /&gt;ptr=fopen("zzz.c","r");&lt;br /&gt;while((i=fgetch(ptr))!=EOF)&lt;br /&gt;printf("%c",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;contents of zzz.c followed by an infinite loop  &lt;br /&gt;	Explanation:&lt;br /&gt;The condition is checked against EOF, it should be checked against NULL.&lt;br /&gt;&lt;br /&gt;86)	main()&lt;br /&gt;{&lt;br /&gt; int i =0;j=0;&lt;br /&gt; if(i &amp;&amp; j++)&lt;br /&gt;   	printf("%d..%d",i++,j);&lt;br /&gt;printf("%d..%d,i,j);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;0..0 &lt;br /&gt;Explanation:&lt;br /&gt;The value of i is 0. Since this information is enough to determine the truth value of the boolean expression. So the statement following the if statement is not executed.  The values of i and j remain unchanged and get printed.&lt;br /&gt;      &lt;br /&gt;87)	main()&lt;br /&gt;{&lt;br /&gt; int i;&lt;br /&gt; i = abc();&lt;br /&gt; printf("%d",i);&lt;br /&gt;}&lt;br /&gt;abc()&lt;br /&gt;{&lt;br /&gt; _AX = 1000;&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;1000&lt;br /&gt;Explanation:&lt;br /&gt;Normally the return value from the function is through the information from the accumulator. Here _AH is the pseudo global variable denoting the accumulator. Hence, the value of the accumulator is set 1000 so the function returns value 1000. &lt;br /&gt;&lt;br /&gt;88)	int i;&lt;br /&gt;        	main(){&lt;br /&gt;int t;&lt;br /&gt;for ( t=4;scanf("%d",&amp;i)-t;printf("%d\n",i))&lt;br /&gt;             	printf("%d--",t--);&lt;br /&gt;            	}&lt;br /&gt;	// If the inputs are 0,1,2,3 find the o/p&lt;br /&gt;Answer:&lt;br /&gt; 	4--0&lt;br /&gt;		3--1&lt;br /&gt;		2--2 	&lt;br /&gt;Explanation:&lt;br /&gt;Let us assume some x= scanf("%d",&amp;i)-t the values during execution &lt;br /&gt;          		will be,&lt;br /&gt;          t        i       x&lt;br /&gt;          4       0      -4&lt;br /&gt;          3       1      -2&lt;br /&gt;          2       2       0&lt;br /&gt;          &lt;br /&gt;89)	main(){&lt;br /&gt;  int a= 0;int b = 20;char x =1;char y =10;&lt;br /&gt;  if(a,b,x,y)&lt;br /&gt;        printf("hello");&lt;br /&gt; }&lt;br /&gt;Answer:&lt;br /&gt;hello &lt;br /&gt;Explanation:&lt;br /&gt;The comma operator has associativity from left to right. Only the rightmost value is returned and the other values are evaluated and ignored. Thus the value of last variable y is returned to check in if. Since it is a non zero value if becomes true so, "hello" will be printed.&lt;br /&gt;&lt;br /&gt;90)	main(){&lt;br /&gt; unsigned int i;&lt;br /&gt; for(i=1;i&gt;-2;i--)&lt;br /&gt;        		printf("c aptitude");&lt;br /&gt;}&lt;br /&gt;Explanation:&lt;br /&gt;i is an unsigned integer. It is compared with a signed value. Since the both types doesn't match, signed is promoted to unsigned value. The unsigned equivalent of -2 is a huge value so condition becomes false and control comes out of the loop. &lt;br /&gt;&lt;br /&gt;91)	In the following pgm add a  stmt in the function  fun such that the address of &lt;br /&gt;'a' gets stored in 'j'.&lt;br /&gt;main(){&lt;br /&gt;  int * j;&lt;br /&gt;  void fun(int **);&lt;br /&gt;  fun(&amp;j);&lt;br /&gt; }&lt;br /&gt; void fun(int **k) {&lt;br /&gt;  int a =0;&lt;br /&gt;  /* add a stmt here*/&lt;br /&gt; }&lt;br /&gt;Answer:&lt;br /&gt;		*k = &amp;a&lt;br /&gt;Explanation:&lt;br /&gt;       		The argument of the function is a pointer to a pointer.&lt;br /&gt;      &lt;br /&gt;92)	What are the following notations of defining functions known as?&lt;br /&gt;i.      int abc(int a,float b)&lt;br /&gt;        		{&lt;br /&gt;                	/* some code */&lt;br /&gt; }&lt;br /&gt;ii.    int abc(a,b)&lt;br /&gt;        int a; float b;&lt;br /&gt;        		{&lt;br /&gt;          		/* some code*/&lt;br /&gt;        		}&lt;br /&gt;Answer:&lt;br /&gt;i.  ANSI C notation&lt;br /&gt;ii. Kernighan &amp; Ritche notation &lt;br /&gt;&lt;br /&gt;93)	main()&lt;br /&gt;{&lt;br /&gt;char *p;&lt;br /&gt;p="%d\n";&lt;br /&gt;           	p++;&lt;br /&gt;           	p++;&lt;br /&gt;           	printf(p-2,300);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;	300&lt;br /&gt;Explanation:&lt;br /&gt;The pointer points to % since it is incremented twice and again decremented by 2, it points to '%d\n' and 300 is printed.&lt;br /&gt;&lt;br /&gt;94)	main(){&lt;br /&gt; char a[100];&lt;br /&gt; a[0]='a';a[1]]='b';a[2]='c';a[4]='d';&lt;br /&gt; abc(a);&lt;br /&gt;}&lt;br /&gt;abc(char a[]){&lt;br /&gt; a++; &lt;br /&gt;   	 printf("%c",*a);&lt;br /&gt; a++;&lt;br /&gt; printf("%c",*a);&lt;br /&gt;}&lt;br /&gt;Explanation:&lt;br /&gt;The base address is modified only in function and as a result a points to 'b' then after incrementing to 'c' so bc will be printed.&lt;br /&gt;                &lt;br /&gt;95)	func(a,b)&lt;br /&gt;int a,b;&lt;br /&gt;{&lt;br /&gt; return( a= (a==b) );&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int process(),func();&lt;br /&gt;printf("The value of process is %d !\n ",process(func,3,6));&lt;br /&gt;}&lt;br /&gt;process(pf,val1,val2)&lt;br /&gt;int (*pf) ();&lt;br /&gt;int val1,val2;&lt;br /&gt;{&lt;br /&gt;return((*pf) (val1,val2));&lt;br /&gt; }&lt;br /&gt;Answer:&lt;br /&gt;The value if process is 0 !&lt;br /&gt;Explanation:&lt;br /&gt;The function 'process' has 3 parameters - 1, a pointer to another function  2 and 3, integers. When this function is invoked from main, the following substitutions for formal parameters take place: func for pf, 3 for val1 and 6 for val2. This function returns the result of the operation performed by the function 'func'. The function func has two integer parameters. The formal parameters are substituted as 3 for a and 6 for b. since 3 is not equal to 6, a==b returns 0. therefore the function returns 0 which in turn is returned by the function 'process'.&lt;br /&gt;&lt;br /&gt;96)	void main()&lt;br /&gt;{&lt;br /&gt;	static int i=5;&lt;br /&gt;	if(--i){&lt;br /&gt;		main();&lt;br /&gt;		printf("%d ",i);&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt; 0 0 0 0&lt;br /&gt;Explanation:&lt;br /&gt;	The variable "I" is declared as static, hence memory for I will be allocated for only once, as it encounters the statement. The function main() will be called recursively unless I becomes equal to 0, and since main() is recursively called, so the value of static I ie., 0 will be printed every time the control is returned.&lt;br /&gt;&lt;br /&gt;97)	void main()&lt;br /&gt;{&lt;br /&gt;	int k=ret(sizeof(float));&lt;br /&gt;	printf("\n here value is %d",++k);&lt;br /&gt;}&lt;br /&gt;int ret(int ret)&lt;br /&gt;{&lt;br /&gt;	ret += 2.5;&lt;br /&gt;	return(ret);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt; Here value is 7&lt;br /&gt;Explanation:&lt;br /&gt;	The int ret(int ret), ie., the function name and the argument name can be the same.&lt;br /&gt;	Firstly, the function ret() is called in which the sizeof(float) ie., 4 is passed,  after the first expression the value in ret will be 6, as ret is integer hence the value stored in ret will have implicit type conversion from float to int. The ret is returned in main() it is printed after and preincrement.&lt;br /&gt; &lt;br /&gt;98)	void main()&lt;br /&gt;{&lt;br /&gt;	char a[]="12345\0";&lt;br /&gt;	int i=strlen(a);&lt;br /&gt;	printf("here in 3 %d\n",++i);&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;here in 3 6&lt;br /&gt;Explanation:&lt;br /&gt;	The char array 'a' will hold the initialized string, whose length will be counted from 0 till the null character. Hence the 'I' will hold the value equal to 5, after the pre-increment in the printf statement, the 6 will be printed.&lt;br /&gt;	&lt;br /&gt;99)	void main()&lt;br /&gt;{&lt;br /&gt;	unsigned giveit=-1;&lt;br /&gt;	int gotit;&lt;br /&gt;	printf("%u ",++giveit);&lt;br /&gt;	printf("%u \n",gotit=--giveit);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt; 0 65535&lt;br /&gt;Explanation:&lt;br /&gt;	&lt;br /&gt;100)	void main()&lt;br /&gt;{&lt;br /&gt;	int i;&lt;br /&gt;	char a[]="\0";&lt;br /&gt;	if(printf("%s\n",a))&lt;br /&gt;		printf("Ok here \n");&lt;br /&gt;	else&lt;br /&gt;		printf("Forget it\n");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt; Ok here &lt;br /&gt;Explanation:&lt;br /&gt;Printf will return how many characters does it print. Hence printing a null character returns 1 which makes the if statement true, thus "Ok here" is printed.&lt;br /&gt; &lt;br /&gt;101)	void main()&lt;br /&gt;{&lt;br /&gt;	void *v;&lt;br /&gt;	int integer=2;&lt;br /&gt;	int *i=&amp;integer;&lt;br /&gt;	v=i;&lt;br /&gt;	printf("%d",(int*)*v);&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;Compiler Error. We cannot apply indirection on type void*.&lt;br /&gt;Explanation:&lt;br /&gt;Void pointer is a generic pointer type. No pointer arithmetic can be done on it. Void pointers are normally used for, &lt;br /&gt;1.	Passing generic pointers to functions and returning such pointers.&lt;br /&gt;2.	As a intermediate pointer type.&lt;br /&gt;3.	Used when the exact pointer type will be known at a later point of time.&lt;br /&gt;&lt;br /&gt;102)	void main()&lt;br /&gt;{&lt;br /&gt;	int i=i++,j=j++,k=k++;&lt;br /&gt;printf(“%d%d%d”,i,j,k);&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;Garbage values.&lt;br /&gt;Explanation:&lt;br /&gt;An identifier is available to use in program code from the point of its declaration. &lt;br /&gt;So expressions such as  i = i++ are valid statements. The i, j and k are automatic variables and so they contain some garbage value. Garbage in is garbage out (GIGO). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;103)	void main()&lt;br /&gt;{&lt;br /&gt;	static int i=i++, j=j++, k=k++;&lt;br /&gt;printf(“i = %d j = %d k = %d”, i, j, k);&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;i = 1 j = 1 k = 1&lt;br /&gt;Explanation:&lt;br /&gt;Since static variables are initialized to zero by default.&lt;br /&gt;&lt;br /&gt;104)	void main()&lt;br /&gt;{&lt;br /&gt;	while(1){&lt;br /&gt;		if(printf("%d",printf("%d")))&lt;br /&gt;			break;&lt;br /&gt;		else&lt;br /&gt;			continue;&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;Garbage values&lt;br /&gt;Explanation:&lt;br /&gt;The inner printf executes first to print some garbage value. The printf returns no of characters printed and this value also cannot be predicted. Still the outer printf  prints something and so returns a non-zero value. So it encounters the break statement and comes out of the while statement.&lt;br /&gt;&lt;br /&gt;104)	main()&lt;br /&gt;{&lt;br /&gt;	unsigned int i=10;&lt;br /&gt;	while(i--&gt;=0)&lt;br /&gt;		printf("%u ",i);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;	10 9 8 7 6 5 4 3 2 1 0 65535 65534…..&lt;br /&gt;Explanation:&lt;br /&gt;Since i is an unsigned integer it can never become negative. So the expression i-- &gt;=0  will always be true, leading to an infinite loop.	&lt;br /&gt;&lt;br /&gt;105)	#include&lt;conio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;	int x,y=2,z,a;&lt;br /&gt;	if(x=y%2) z=2;&lt;br /&gt;	a=2;&lt;br /&gt;	printf("%d %d ",z,x);&lt;br /&gt;}&lt;br /&gt; Answer: &lt;br /&gt;Garbage-value 0&lt;br /&gt;Explanation:&lt;br /&gt;The value of y%2 is 0. This value is assigned to x. The condition reduces to if (x) or in other words if(0) and so z goes uninitialized.&lt;br /&gt;Thumb Rule: Check all control paths to write bug free code.&lt;br /&gt;&lt;br /&gt;106)	main()&lt;br /&gt;{&lt;br /&gt;	int a[10];&lt;br /&gt;	printf("%d",*a+1-*a+3);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;4  &lt;br /&gt;Explanation:&lt;br /&gt;	*a and -*a cancels out. The result is as simple as 1 + 3 = 4 !	&lt;br /&gt;&lt;br /&gt;107)	#define prod(a,b) a*b&lt;br /&gt;main() &lt;br /&gt;{&lt;br /&gt;	int x=3,y=4;&lt;br /&gt;	printf("%d",prod(x+2,y-1));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;10&lt;br /&gt;Explanation:&lt;br /&gt;	The macro expands and evaluates to as:&lt;br /&gt;	x+2*y-1 =&gt; x+(2*y)-1 =&gt; 10&lt;br /&gt;&lt;br /&gt;108)	main()&lt;br /&gt;{&lt;br /&gt;	unsigned int i=65000;&lt;br /&gt;	while(i++!=0);&lt;br /&gt;	printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt; 1&lt;br /&gt;Explanation:&lt;br /&gt;Note the semicolon after the while statement. When the value of i becomes 0 it comes out of while loop. Due to post-increment on i the value of i while printing is 1.&lt;br /&gt;  &lt;br /&gt;109)	main()&lt;br /&gt;{&lt;br /&gt;	int i=0;&lt;br /&gt;	while(+(+i--)!=0)&lt;br /&gt;		i-=i++;&lt;br /&gt;	printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;-1&lt;br /&gt;Explanation:&lt;br /&gt;Unary + is the only dummy operator in C. So it has no effect on the expression and now the while loop is, 	while(i--!=0) which is false and so breaks out of while loop. The value –1 is printed due to the post-decrement operator.&lt;br /&gt; 	&lt;br /&gt;113)	main()&lt;br /&gt;{&lt;br /&gt;	float f=5,g=10;&lt;br /&gt;	enum{i=10,j=20,k=50};&lt;br /&gt;	printf("%d\n",++k);&lt;br /&gt;	printf("%f\n",f&lt;&lt;2);&lt;br /&gt;	printf("%lf\n",f%g);&lt;br /&gt;	printf("%lf\n",fmod(f,g)); &lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Line no 5: Error: Lvalue required&lt;br /&gt;Line no 6: Cannot apply leftshift to float&lt;br /&gt;Line no 7: Cannot apply mod to float&lt;br /&gt;Explanation:&lt;br /&gt;		Enumeration constants cannot be modified, so you cannot apply ++.&lt;br /&gt;		Bit-wise operators and % operators cannot be applied on float values.&lt;br /&gt;		fmod() is to find the modulus values for floats as % operator is for ints.  &lt;br /&gt;&lt;br /&gt;110)  	main()&lt;br /&gt;{&lt;br /&gt;	int i=10;&lt;br /&gt;	void pascal f(int,int,int);&lt;br /&gt;f(i++,i++,i++);&lt;br /&gt;	printf(" %d",i);&lt;br /&gt;}&lt;br /&gt;void pascal f(integer :i,integer:j,integer :k)&lt;br /&gt;{ &lt;br /&gt;write(i,j,k); &lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error:  unknown type integer&lt;br /&gt;Compiler error:  undeclared function write&lt;br /&gt;Explanation:&lt;br /&gt;Pascal keyword doesn’t mean that pascal code can be used. It means that the function follows Pascal argument passing mechanism in calling the functions. &lt;br /&gt;&lt;br /&gt;111) 	void pascal f(int i,int j,int k)&lt;br /&gt;{ &lt;br /&gt;printf(“%d %d %d”,i, j, k); &lt;br /&gt;}&lt;br /&gt;void cdecl f(int i,int j,int k)&lt;br /&gt;{ &lt;br /&gt;printf(“%d %d %d”,i, j, k); &lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;	int i=10;&lt;br /&gt;f(i++,i++,i++);&lt;br /&gt;	printf(" %d\n",i);&lt;br /&gt;i=10;&lt;br /&gt;f(i++,i++,i++);&lt;br /&gt;printf(" %d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;10 11 12 13&lt;br /&gt;12 11 10 13&lt;br /&gt;Explanation:&lt;br /&gt;Pascal argument passing mechanism forces the arguments to be called from left to right. cdecl is the normal C argument passing mechanism where the arguments are passed from right to left.&lt;br /&gt; &lt;br /&gt;112). What is the output of the program given below&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;    {&lt;br /&gt;       signed char i=0;&lt;br /&gt;       for(;i&gt;=0;i++) ;&lt;br /&gt;       printf("%d\n",i);&lt;br /&gt;    }&lt;br /&gt;Answer&lt;br /&gt;		-128&lt;br /&gt;Explanation&lt;br /&gt;Notice the semicolon at the end of the for loop. THe initial value of the i is set to 0. The inner loop executes to increment the value from 0 to 127 (the positive range of char) and then it rotates to the negative value of -128. The condition in the for loop fails and so comes out of the for loop. It prints the current value of i that is -128.&lt;br /&gt; 	&lt;br /&gt;113) main()&lt;br /&gt;    {&lt;br /&gt;       unsigned char i=0;&lt;br /&gt;       for(;i&gt;=0;i++) ;&lt;br /&gt;       printf("%d\n",i);&lt;br /&gt;    }&lt;br /&gt;Answer&lt;br /&gt;	infinite loop&lt;br /&gt;Explanation&lt;br /&gt;The difference between the previous question and this one is that the char is declared to be unsigned. So the i++ can never yield negative value and i&gt;=0 never becomes false so that it can come out of the for loop.&lt;br /&gt;&lt;br /&gt;114) main()&lt;br /&gt;    	{&lt;br /&gt;       char i=0;&lt;br /&gt;       for(;i&gt;=0;i++) ;&lt;br /&gt;       printf("%d\n",i);&lt;br /&gt;        &lt;br /&gt; }&lt;br /&gt;Answer:&lt;br /&gt;		Behavior is implementation dependent.&lt;br /&gt;Explanation:&lt;br /&gt;The detail if the char is signed/unsigned by default is implementation dependent. If the implementation treats the char to be signed by default the program will print –128 and terminate. On the other hand if it considers char to be unsigned by default, it goes to infinite loop.&lt;br /&gt;Rule:&lt;br /&gt;You can write programs that have implementation dependent behavior. But dont write programs that depend on such behavior.&lt;br /&gt;&lt;br /&gt;115) Is the following statement a declaration/definition. Find what does it mean?&lt;br /&gt;int (*x)[10];&lt;br /&gt;Answer&lt;br /&gt;		Definition.&lt;br /&gt;	x is a pointer to array of(size 10) integers.&lt;br /&gt;&lt;br /&gt;		Apply clock-wise rule to find the meaning of this definition.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;116). What is the output for the program given below &lt;br /&gt;&lt;br /&gt;     typedef enum errorType{warning, error, exception,}error;&lt;br /&gt;     main()&lt;br /&gt;    {&lt;br /&gt;        error g1;&lt;br /&gt;        g1=1; &lt;br /&gt;        printf("%d",g1);&lt;br /&gt;     }&lt;br /&gt;Answer&lt;br /&gt;		Compiler error: Multiple declaration for error&lt;br /&gt;Explanation&lt;br /&gt;The name error is used in the two meanings. One means that it is a enumerator constant with value 1. The another use is that it is a type name (due to typedef) for enum errorType. Given a situation the compiler cannot distinguish the meaning of error to know in what sense the error is used: &lt;br /&gt;	error g1;&lt;br /&gt;g1=error; &lt;br /&gt;	// which error it refers in each case?&lt;br /&gt;When the compiler can distinguish between usages then it will not issue error (in pure technical terms, names can only be overloaded in different namespaces).&lt;br /&gt;Note: the extra comma in the declaration,&lt;br /&gt;enum errorType{warning, error, exception,}&lt;br /&gt;is not an error. An extra comma is valid and is provided just for programmer’s convenience.&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt;117)    	     typedef struct error{int warning, error, exception;}error;&lt;br /&gt;     main()&lt;br /&gt;    {&lt;br /&gt;        error g1;&lt;br /&gt;        g1.error =1; &lt;br /&gt;        printf("%d",g1.error);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;Answer&lt;br /&gt;		1&lt;br /&gt;Explanation&lt;br /&gt;The three usages of name errors can be distinguishable by the compiler at any instance, so valid (they are in different namespaces).&lt;br /&gt;Typedef struct error{int warning, error, exception;}error;&lt;br /&gt;This error can be used only by preceding the error by struct kayword as in:&lt;br /&gt;struct error someError;&lt;br /&gt;typedef struct error{int warning, error, exception;}error;&lt;br /&gt;This can be used only after . (dot) or -&gt; (arrow) operator preceded by the variable name as in :&lt;br /&gt;g1.error =1; &lt;br /&gt;        	printf("%d",g1.error);&lt;br /&gt;  		typedef struct error{int warning, error, exception;}error;&lt;br /&gt;This can be used to define variables without using the preceding struct keyword as in:&lt;br /&gt;error g1;&lt;br /&gt;Since the compiler can perfectly distinguish between these three usages, it is perfectly legal and valid.&lt;br /&gt;&lt;br /&gt;Note&lt;br /&gt;This code is given here to just explain the concept behind. In real programming don’t use such overloading of names. It reduces the readability of the code. Possible doesn’t mean that we should use it!&lt;br /&gt;  &lt;br /&gt;118)	#ifdef something&lt;br /&gt;int some=0;&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int thing = 0;&lt;br /&gt;printf("%d %d\n", some ,thing);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;		Compiler error : undefined symbol some&lt;br /&gt;Explanation:&lt;br /&gt;This is a very simple example for conditional compilation. The name something is not already known to the compiler making the declaration &lt;br /&gt;int some = 0;&lt;br /&gt;effectively removed from the source code.&lt;br /&gt;&lt;br /&gt;119) 	#if something == 0&lt;br /&gt;int some=0;&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int thing = 0;&lt;br /&gt;printf("%d %d\n", some ,thing);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer&lt;br /&gt;		0 0 &lt;br /&gt;Explanation&lt;br /&gt;This code is to show that preprocessor expressions are not the same as the ordinary expressions. If a name is not known the preprocessor treats it to be equal to zero. &lt;br /&gt;&lt;br /&gt;120). What is the output for the following program&lt;br /&gt;&lt;br /&gt;      	main()&lt;br /&gt;                            {&lt;br /&gt;      int arr2D[3][3];&lt;br /&gt;       printf("%d\n", ((arr2D==* arr2D)&amp;&amp;(* arr2D == arr2D[0])) );&lt;br /&gt;               }&lt;br /&gt;Answer&lt;br /&gt;1&lt;br /&gt;Explanation&lt;br /&gt;This is due to the close relation between the arrays and pointers. N dimensional arrays are made up of (N-1) dimensional arrays. 	&lt;br /&gt;	arr2D is made up of a 3 single arrays that contains 3 integers each . &lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The name arr2D refers to the beginning of all the 3 arrays. *arr2D refers to the start of the first 1D array (of 3 integers) that is the same address as arr2D. So the expression (arr2D == *arr2D) is true (1). &lt;br /&gt;Similarly, *arr2D is nothing but *(arr2D + 0), adding a zero doesn’t change the value/meaning. Again arr2D[0] is the another way of telling *(arr2D + 0). So the expression (*(arr2D + 0) == arr2D[0]) is true (1). &lt;br /&gt;Since both parts of the expression evaluates to true the result is true(1) and the same is printed.  &lt;br /&gt;&lt;br /&gt;121) void main()&lt;br /&gt;         {&lt;br /&gt;if(~0 == (unsigned int)-1)&lt;br /&gt;printf(“You can answer this if you know how values are represented in memory”);&lt;br /&gt;         }	&lt;br /&gt; Answer&lt;br /&gt;You can answer this if you know how values are represented in memory&lt;br /&gt;Explanation&lt;br /&gt;~ (tilde operator or bit-wise negation operator) operates on 0 to produce all ones to fill the space for an integer. –1 is represented in unsigned value as all 1’s and so both are equal.&lt;br /&gt;&lt;br /&gt;122) int swap(int *a,int *b)&lt;br /&gt;{&lt;br /&gt; *a=*a+*b;*b=*a-*b;*a=*a-*b;&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;		int x=10,y=20;&lt;br /&gt;	swap(&amp;x,&amp;y);&lt;br /&gt;		printf("x= %d y = %d\n",x,y);&lt;br /&gt;}&lt;br /&gt;Answer&lt;br /&gt;	x = 20 y = 10&lt;br /&gt;Explanation&lt;br /&gt;This is one way of swapping two values. Simple checking will help understand this.&lt;br /&gt;&lt;br /&gt;123)	 main()&lt;br /&gt;{	&lt;br /&gt;char *p = “ayqm”;&lt;br /&gt;printf(“%c”,++*(p++));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;b	 &lt;br /&gt;&lt;br /&gt;124)	main()&lt;br /&gt;	{&lt;br /&gt;	 int i=5;&lt;br /&gt;	 printf("%d",++i++);&lt;br /&gt;} &lt;br /&gt;Answer:&lt;br /&gt;		Compiler error: Lvalue required in function main&lt;br /&gt;Explanation:&lt;br /&gt;		++i yields an rvalue.  For postfix ++ to operate an lvalue is required.&lt;br /&gt;&lt;br /&gt;125)	main()&lt;br /&gt;{&lt;br /&gt;char *p = “ayqm”;&lt;br /&gt;char c;&lt;br /&gt;c = ++*p++;&lt;br /&gt;printf(“%c”,c);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;b&lt;br /&gt;Explanation:&lt;br /&gt;There is no difference between the expression ++*(p++) and ++*p++. Parenthesis just works as a visual clue for the reader to see which expression is first evaluated. &lt;br /&gt;&lt;br /&gt;126)&lt;br /&gt;int aaa() {printf(“Hi”);}&lt;br /&gt;int bbb(){printf(“hello”);}&lt;br /&gt;iny ccc(){printf(“bye”);}&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int ( * ptr[3]) ();&lt;br /&gt;ptr[0] = aaa;&lt;br /&gt;ptr[1] = bbb;&lt;br /&gt;ptr[2] =ccc;&lt;br /&gt;ptr[2]();&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt; bye&lt;br /&gt;Explanation: &lt;br /&gt;int (* ptr[3])() says that ptr is an array of pointers to functions that takes no arguments and returns the type int. By the assignment ptr[0] = aaa; it means that the first function pointer in the array is initialized with the address of the function aaa. Similarly, the other two array elements also get initialized with the addresses of the functions bbb and ccc. Since ptr[2] contains the address of the function ccc, the call to the function ptr[2]() is same as calling ccc(). So it results in printing  "bye".&lt;br /&gt;&lt;br /&gt;127)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=5;&lt;br /&gt;printf(“%d”,i=++i ==6);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;1&lt;br /&gt;Explanation:&lt;br /&gt;The expression can be treated as i = (++i==6), because == is of higher precedence than = operator. In the inner expression, ++i is equal to 6 yielding true(1). Hence the result.&lt;br /&gt;&lt;br /&gt;128)	main()&lt;br /&gt;{&lt;br /&gt; 		char p[ ]="%d\n";&lt;br /&gt;p[1] = 'c';&lt;br /&gt;printf(p,65);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;A&lt;br /&gt;Explanation:&lt;br /&gt;Due to the assignment p[1] = ‘c’ the string becomes, “%c\n”. Since this string becomes the format string for printf and ASCII value of 65 is ‘A’, the same gets printed.&lt;br /&gt; &lt;br /&gt;129)	void ( * abc( int, void ( *def) () ) ) ();&lt;br /&gt;&lt;br /&gt;Answer::&lt;br /&gt; abc is a  ptr to a  function which takes 2 parameters .(a). an integer variable.(b).        a ptrto a funtion which returns void. the return type of the function is  void.&lt;br /&gt;Explanation:&lt;br /&gt;		Apply the clock-wise rule to find the result.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;130)	main()&lt;br /&gt;{&lt;br /&gt;while (strcmp(“some”,”some\0”)) &lt;br /&gt;printf(“Strings are not equal\n”);&lt;br /&gt;	}&lt;br /&gt;Answer:&lt;br /&gt;No output&lt;br /&gt;Explanation:&lt;br /&gt;Ending the string constant with \0 explicitly makes no difference. So “some” and “some\0” are equivalent. So, strcmp returns 0 (false) hence breaking out of the while loop. &lt;br /&gt;&lt;br /&gt;131)	main()&lt;br /&gt;{&lt;br /&gt;char str1[] = {‘s’,’o’,’m’,’e’};&lt;br /&gt;char str2[] = {‘s’,’o’,’m’,’e’,’\0’};&lt;br /&gt;while (strcmp(str1,str2)) &lt;br /&gt;printf(“Strings are not equal\n”);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;“Strings are not equal”&lt;br /&gt;“Strings are not equal”&lt;br /&gt;….&lt;br /&gt;Explanation:&lt;br /&gt;If a string constant is initialized explicitly with characters, ‘\0’ is not appended automatically to the string. Since str1 doesn’t have null termination, it treats whatever the values that are in the following positions as part of the string until it randomly reaches a ‘\0’. So str1 and str2 are not the same, hence the result.&lt;br /&gt; &lt;br /&gt;132)	main()&lt;br /&gt;{&lt;br /&gt;int i = 3;&lt;br /&gt;for (;i++=0;) printf(“%d”,i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;		Compiler Error: Lvalue required.&lt;br /&gt;Explanation:&lt;br /&gt;As we know that increment operators return rvalues and  hence it cannot appear on the left hand side of an assignment operation.&lt;br /&gt; &lt;br /&gt;133)	void main()&lt;br /&gt;{&lt;br /&gt;int *mptr, *cptr;&lt;br /&gt;mptr = (int*)malloc(sizeof(int));&lt;br /&gt;printf(“%d”,*mptr);&lt;br /&gt;int *cptr = (int*)calloc(sizeof(int),1);&lt;br /&gt;printf(“%d”,*cptr);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;garbage-value 0&lt;br /&gt;Explanation:&lt;br /&gt;The memory space allocated by malloc is uninitialized, whereas calloc returns the allocated memory space initialized to zeros.&lt;br /&gt;	&lt;br /&gt;134)	void main()&lt;br /&gt;{&lt;br /&gt;static int i;&lt;br /&gt;while(i&lt;=10)&lt;br /&gt;(i&gt;2)?i++:i--;&lt;br /&gt;	printf(“%d”, i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;		32767&lt;br /&gt;Explanation:&lt;br /&gt;Since i is static it is initialized to 0. Inside the while loop the conditional operator evaluates to false, executing i--. This continues till the integer value rotates to positive value (32767). The while condition becomes false and hence, comes out of the while loop, printing the i value.&lt;br /&gt;&lt;br /&gt;135)	main()&lt;br /&gt;{&lt;br /&gt;		int i=10,j=20;&lt;br /&gt;	j = i, j?(i,j)?i:j:j;&lt;br /&gt;		printf("%d %d",i,j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;10 10&lt;br /&gt;Explanation:&lt;br /&gt;		The Ternary operator ( ? : ) is equivalent for if-then-else statement. So the question can be written as:&lt;br /&gt;		if(i,j)&lt;br /&gt;	   	     {&lt;br /&gt;if(i,j)&lt;br /&gt;		     j = i;&lt;br /&gt;		else&lt;br /&gt;		    j = j;			&lt;br /&gt;		}&lt;br /&gt;	   else&lt;br /&gt;		j = j;		&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;136)	1. const char *a;&lt;br /&gt;2. char* const a; &lt;br /&gt;3. char const *a;&lt;br /&gt;-Differentiate the above declarations.&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;1. 'const' applies to char * rather than 'a' ( pointer to a constant char )&lt;br /&gt;	*a='F'       : illegal&lt;br /&gt;			a="Hi"       : legal&lt;br /&gt;&lt;br /&gt;2. 'const' applies to 'a'  rather than to the value of a (constant pointer to char )&lt;br /&gt;	*a='F'       : legal&lt;br /&gt;	a="Hi"       : illegal&lt;br /&gt;&lt;br /&gt;3. Same as 1.&lt;br /&gt;&lt;br /&gt;137)	main()&lt;br /&gt;{&lt;br /&gt;		int i=5,j=10;&lt;br /&gt;	i=i&amp;=j&amp;&amp;10;&lt;br /&gt;		printf("%d %d",i,j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;1 10&lt;br /&gt;Explanation:&lt;br /&gt;The expression can be written as i=(i&amp;=(j&amp;&amp;10)); The inner expression (j&amp;&amp;10) evaluates to 1 because j==10. i is 5. i = 5&amp;1 is 1. Hence the result. &lt;br /&gt;&lt;br /&gt;138)	main()&lt;br /&gt;{&lt;br /&gt;		int i=4,j=7;&lt;br /&gt;	j = j || i++ &amp;&amp; printf("YOU CAN");&lt;br /&gt;		printf("%d %d", i, j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;4 1 &lt;br /&gt;Explanation:&lt;br /&gt;The boolean expression needs to be evaluated only till the truth value of the expression is not known. j is not equal to zero itself means that the expression’s truth value is 1. Because it is followed by || and true || (anything) =&gt; true where (anything) will not be evaluated. So the remaining expression is not evaluated and so the value of i remains the same.&lt;br /&gt;Similarly when &amp;&amp; operator is involved in an expression, when any of the operands become false, the whole expression’s truth value becomes false and hence the remaining expression will not be evaluated.     &lt;br /&gt;	false &amp;&amp; (anything) =&gt; false where (anything) will not be evaluated.&lt;br /&gt;&lt;br /&gt;139)	main()&lt;br /&gt;{&lt;br /&gt;		register int a=2;&lt;br /&gt;	printf("Address of a = %d",&amp;a);&lt;br /&gt;		printf("Value of a   = %d",a);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compier Error: '&amp;' on register variable&lt;br /&gt;Rule to Remember:&lt;br /&gt;		 &amp; (address of ) operator cannot be applied on register variables.&lt;br /&gt;	&lt;br /&gt;140)	main()&lt;br /&gt;{&lt;br /&gt;		float i=1.5;&lt;br /&gt;	switch(i)&lt;br /&gt;		{&lt;br /&gt;		case 1: printf("1");&lt;br /&gt;			case 2: printf("2");&lt;br /&gt;			default : printf("0");&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: switch expression not integral&lt;br /&gt;Explanation:&lt;br /&gt;		Switch statements can be applied only to integral types.&lt;br /&gt;&lt;br /&gt;141)	main()&lt;br /&gt;{	&lt;br /&gt;		extern i;&lt;br /&gt;	printf("%d\n",i);&lt;br /&gt;		{&lt;br /&gt;			int i=20;&lt;br /&gt;		printf("%d\n",i);&lt;br /&gt;		}&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Linker Error : Unresolved external symbol i&lt;br /&gt;Explanation:&lt;br /&gt;The identifier i is available in the inner block and so using extern has no use in resolving it. &lt;br /&gt;&lt;br /&gt;142)	main()&lt;br /&gt;{&lt;br /&gt;		int a=2,*f1,*f2;&lt;br /&gt;	f1=f2=&amp;a;&lt;br /&gt;		*f2+=*f2+=a+=2.5;&lt;br /&gt;	printf("\n%d %d %d",a,*f1,*f2);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;16 16 16&lt;br /&gt;Explanation:&lt;br /&gt;f1 and f2 both refer to the same memory location a. So changes through f1 and f2 ultimately affects only the value of a. &lt;br /&gt;	&lt;br /&gt;143)	main()&lt;br /&gt;{&lt;br /&gt;		char *p="GOOD";&lt;br /&gt;	char a[ ]="GOOD";&lt;br /&gt;printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p));&lt;br /&gt;	printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;		sizeof(p) = 2, sizeof(*p) = 1, strlen(p) = 4&lt;br /&gt;	sizeof(a) = 5, strlen(a) = 4&lt;br /&gt;Explanation:&lt;br /&gt;		sizeof(p) =&gt; sizeof(char*) =&gt; 2&lt;br /&gt;	sizeof(*p) =&gt; sizeof(char) =&gt; 1&lt;br /&gt;		Similarly,&lt;br /&gt;	sizeof(a) =&gt; size of the character array =&gt; 5&lt;br /&gt;When sizeof operator is applied to an array it returns the sizeof the array and it is not the same as the sizeof the pointer variable. Here the sizeof(a) where a is the character array and the size of the array is 5 because the space necessary for the terminating NULL character should also be taken into account.&lt;br /&gt;&lt;br /&gt;144)	#define DIM( array, type) sizeof(array)/sizeof(type)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int arr[10];&lt;br /&gt;printf(“The dimension of the array is %d”, DIM(arr, int));    &lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;10   &lt;br /&gt;Explanation:&lt;br /&gt;The size  of integer array of 10 elements is 10 * sizeof(int). The macro expands to sizeof(arr)/sizeof(int) =&gt; 10 * sizeof(int) / sizeof(int) =&gt; 10.	&lt;br /&gt;&lt;br /&gt;145)	int DIM(int array[]) &lt;br /&gt;{&lt;br /&gt;return sizeof(array)/sizeof(int );&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int arr[10];&lt;br /&gt;printf(“The dimension of the array is %d”, DIM(arr));    &lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;1   &lt;br /&gt;Explanation:&lt;br /&gt;Arrays cannot be passed to functions as arguments and only the pointers can be passed. So the argument is equivalent to int * array (this is one of the very few places where [] and * usage are equivalent). The return statement becomes, sizeof(int *)/ sizeof(int) that happens to be equal in this case. &lt;br /&gt;&lt;br /&gt;146)	main()&lt;br /&gt;{&lt;br /&gt;	static int a[3][3]={1,2,3,4,5,6,7,8,9};&lt;br /&gt;	int i,j;&lt;br /&gt;	static *p[]={a,a+1,a+2};&lt;br /&gt;		for(i=0;i&lt;3;i++)&lt;br /&gt;	{&lt;br /&gt;			for(j=0;j&lt;3;j++)&lt;br /&gt;			printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j),&lt;br /&gt;			*(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i));&lt;br /&gt;		}&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;			1       1       1       1&lt;br /&gt;			2       4       2       4&lt;br /&gt;		3       7       3       7&lt;br /&gt;			4       2       4       2&lt;br /&gt;			5       5       5       5&lt;br /&gt;		6       8       6       8&lt;br /&gt;			7       3       7       3&lt;br /&gt;			8       6       8       6&lt;br /&gt;		9       9       9       9&lt;br /&gt;Explanation:&lt;br /&gt;		*(*(p+i)+j) is equivalent to p[i][j].&lt;br /&gt;&lt;br /&gt;147)	main()&lt;br /&gt;{&lt;br /&gt;		void swap();&lt;br /&gt;	int x=10,y=8;     &lt;br /&gt;		swap(&amp;x,&amp;y);&lt;br /&gt;	printf("x=%d y=%d",x,y);&lt;br /&gt;}&lt;br /&gt;void swap(int *a, int *b)&lt;br /&gt;{&lt;br /&gt;   *a ^= *b,  *b ^= *a, *a ^= *b; &lt;br /&gt;}	&lt;br /&gt;Answer:&lt;br /&gt;x=10 y=8&lt;br /&gt;Explanation:&lt;br /&gt;Using ^ like this is a way to swap two variables without using a temporary variable and that too in a single statement.&lt;br /&gt;Inside main(), void swap(); means that swap is a function that may take any number of arguments (not no arguments) and returns nothing. So this doesn’t issue a compiler error by the call swap(&amp;x,&amp;y); that has two arguments. &lt;br /&gt;This convention is historically due to pre-ANSI style (referred to as Kernighan and Ritchie style) style of function declaration. In that style, the swap function will be defined as follows,&lt;br /&gt;void swap()&lt;br /&gt;int *a, int *b&lt;br /&gt;{&lt;br /&gt;   *a ^= *b,  *b ^= *a, *a ^= *b; &lt;br /&gt;}&lt;br /&gt;where the arguments follow the (). So naturally the declaration for swap will look like, void swap() which means the swap can take any number of arguments.&lt;br /&gt;&lt;br /&gt;148)	main()&lt;br /&gt;{&lt;br /&gt;		int i = 257;&lt;br /&gt;	int *iPtr = &amp;i;&lt;br /&gt;		printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;		1 1 &lt;br /&gt;Explanation:&lt;br /&gt;The integer value 257 is stored in the memory as, 00000001 00000001, so the individual bytes are taken by casting it to char * and get printed.&lt;br /&gt;&lt;br /&gt;149)	main()&lt;br /&gt;{&lt;br /&gt;		int i = 258;&lt;br /&gt;	int *iPtr = &amp;i;&lt;br /&gt;		printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );&lt;br /&gt;}	&lt;br /&gt;Answer:&lt;br /&gt;		2 1 &lt;br /&gt;Explanation:&lt;br /&gt;The integer value 257 can be represented in binary as, 00000001 00000001. Remember that the INTEL machines are ‘small-endian’ machines. Small-endian means that the lower order bytes are stored in the higher memory addresses and the higher order bytes are stored in lower addresses. The integer value 258 is stored in memory as: 00000001 00000010.   &lt;br /&gt;&lt;br /&gt;150)	main()&lt;br /&gt;{&lt;br /&gt;		int i=300;&lt;br /&gt;	char *ptr = &amp;i;&lt;br /&gt;		*++ptr=2;&lt;br /&gt;	printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;556&lt;br /&gt;Explanation:&lt;br /&gt;The integer value 300  in binary notation is: 00000001 00101100. It is  stored in memory (small-endian) as: 00101100 00000001. Result of the expression *++ptr = 2 makes the memory representation as: 00101100 00000010. So the integer corresponding to it  is  00000010 00101100 =&gt; 556.&lt;br /&gt;&lt;br /&gt;151)	#include &lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char * str = "hello";&lt;br /&gt;char * ptr = str;&lt;br /&gt;char least = 127;&lt;br /&gt;while (*ptr++)&lt;br /&gt;                  least = (*ptr&lt;least ) ?*ptr :least;&lt;br /&gt;printf("%d",least);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;0&lt;br /&gt;Explanation:	&lt;br /&gt;After ‘ptr’ reaches the end of the string the value pointed by ‘str’ is ‘\0’. So the value of ‘str’ is less than that of ‘least’. So the value of ‘least’ finally is 0.&lt;br /&gt;&lt;br /&gt;152)	Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?&lt;br /&gt;Answer:&lt;br /&gt;		(char*(*)( )) (*ptr[N])( );&lt;br /&gt;&lt;br /&gt;153)	main()&lt;br /&gt;{&lt;br /&gt;struct student &lt;br /&gt;{&lt;br /&gt;char name[30];&lt;br /&gt;struct date dob;&lt;br /&gt;}stud;&lt;br /&gt;struct date&lt;br /&gt;        {	&lt;br /&gt;         int day,month,year;&lt;br /&gt;         };&lt;br /&gt;     scanf("%s%d%d%d", stud.rollno, &amp;student.dob.day, &amp;student.dob.month,      &amp;student.dob.year);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: Undefined structure date&lt;br /&gt;Explanation:&lt;br /&gt;Inside the struct definition of ‘student’ the member of type struct date is given. The compiler doesn’t have the definition of date structure (forward  reference is not allowed in C in this case) so it issues an error.&lt;br /&gt;&lt;br /&gt;154)	main()&lt;br /&gt;{&lt;br /&gt;struct date;&lt;br /&gt;struct student&lt;br /&gt;{&lt;br /&gt;char name[30];&lt;br /&gt;struct date dob;&lt;br /&gt;}stud;&lt;br /&gt;struct date&lt;br /&gt;        	{&lt;br /&gt;         int day,month,year;&lt;br /&gt; };&lt;br /&gt;scanf("%s%d%d%d", stud.rollno, &amp;student.dob.day, &amp;student.dob.month, &amp;student.dob.year);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: Undefined structure date&lt;br /&gt;Explanation:&lt;br /&gt;Only declaration of struct date is available inside the structure definition of ‘student’ but to have a variable of type struct date the definition of the structure is required. &lt;br /&gt;&lt;br /&gt;155)	There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong?&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;struct student&lt;br /&gt;{	&lt;br /&gt;char name[30], rollno[6];&lt;br /&gt;}stud;&lt;br /&gt;FILE *fp = fopen(“somefile.dat”,”r”);&lt;br /&gt;while(!feof(fp))&lt;br /&gt; {&lt;br /&gt;     		fread(&amp;stud, sizeof(stud), 1 , fp);&lt;br /&gt;puts(stud.name);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Explanation:&lt;br /&gt;fread reads 10 records and prints the names successfully. It will return EOF only when fread tries to read another record and fails reading EOF (and returning EOF). So it prints the last record again. After this only the condition feof(fp) becomes false, hence comes out of the while loop. &lt;br /&gt;&lt;br /&gt;156)	Is there any difference between the two declarations, &lt;br /&gt;1.	int foo(int *arr[]) and&lt;br /&gt;2.	int foo(int *arr[2])&lt;br /&gt;Answer:&lt;br /&gt;No &lt;br /&gt;Explanation:&lt;br /&gt;Functions can only pass pointers and not arrays. The numbers that are allowed inside the [] is just for more readability. So there is no difference between the two declarations.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;157)	What is the subtle error in the following code segment?&lt;br /&gt;void fun(int n, int arr[])&lt;br /&gt;{&lt;br /&gt;int *p=0;&lt;br /&gt;int i=0;&lt;br /&gt;while(i++&lt;n)&lt;br /&gt;		p = &amp;arr[i];&lt;br /&gt;*p = 0;&lt;br /&gt;}&lt;br /&gt;Answer &amp; Explanation:&lt;br /&gt;If the body of the loop never executes p is assigned no address. So p remains NULL where *p =0 may result in problem (may rise to runtime error “NULL pointer assignment” and terminate the program).     &lt;br /&gt;&lt;br /&gt;158)	What is wrong with the following code?  &lt;br /&gt;int *foo()&lt;br /&gt;{&lt;br /&gt;int *s = malloc(sizeof(int)100);&lt;br /&gt;assert(s != NULL);&lt;br /&gt;return s;&lt;br /&gt;}&lt;br /&gt;Answer &amp; Explanation:&lt;br /&gt;assert macro should be used for debugging and finding out bugs. The check s != NULL is for error/exception handling and for that assert shouldn’t be used. A plain if and the corresponding remedy statement has to be given.&lt;br /&gt;&lt;br /&gt;159)	What is the hidden bug with the following  statement?&lt;br /&gt;assert(val++ != 0);&lt;br /&gt;Answer &amp; Explanation:&lt;br /&gt;Assert macro is used for debugging and removed in release version. In assert, the experssion involves side-effects. So the behavior of the code becomes different in case of debug version and the release version thus leading to a subtle bug. &lt;br /&gt;Rule to Remember:&lt;br /&gt;Don’t use expressions that have side-effects in assert statements.  &lt;br /&gt;&lt;br /&gt;160)	void main()&lt;br /&gt;{&lt;br /&gt;int *i = 0x400;  // i points to the address 400&lt;br /&gt;*i = 0;		// set the value of memory location pointed by i;&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Undefined behavior &lt;br /&gt;Explanation:&lt;br /&gt;The second statement results in undefined behavior because it points to some location whose value may not be available for modification.  This type of pointer in which the non-availability of the implementation of the referenced location is known as 'incomplete type'.&lt;br /&gt;&lt;br /&gt;161)	#define assert(cond) if(!(cond)) \&lt;br /&gt;  (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\&lt;br /&gt; __FILE__,__LINE__), abort())&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int i = 10;&lt;br /&gt;if(i==0)	&lt;br /&gt;    assert(i &lt; 100); &lt;br /&gt;else&lt;br /&gt;    printf("This statement becomes else for if in assert macro");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;No output&lt;br /&gt;Explanation:&lt;br /&gt;The else part in which the printf is there becomes the else for if in the assert macro. Hence nothing is printed. &lt;br /&gt;The solution is to use conditional operator instead of if statement,&lt;br /&gt;#define assert(cond) ((cond)?(0): (fprintf (stderr, "assertion failed: \ %s, file %s, line %d \n",#cond, __FILE__,__LINE__), abort()))&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;However this problem of “matching with nearest else” cannot be solved by the usual method of placing the if statement inside a block like this,&lt;br /&gt;#define assert(cond) { \&lt;br /&gt;if(!(cond)) \&lt;br /&gt;  (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\&lt;br /&gt; __FILE__,__LINE__), abort()) \&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;162)	Is the following code legal?&lt;br /&gt;struct a&lt;br /&gt;    { &lt;br /&gt;int x;&lt;br /&gt; struct a b;&lt;br /&gt;    }&lt;br /&gt;Answer:&lt;br /&gt;		No&lt;br /&gt;Explanation:&lt;br /&gt;Is it not legal for a structure to contain a member that is of the same&lt;br /&gt;type as in this case. Because this will cause the structure declaration to be recursive without end.&lt;br /&gt;&lt;br /&gt;163)	Is the following code legal?&lt;br /&gt;struct a&lt;br /&gt;    { &lt;br /&gt;int x;&lt;br /&gt;            struct a *b;&lt;br /&gt;    }&lt;br /&gt;Answer:&lt;br /&gt;Yes.&lt;br /&gt;Explanation:&lt;br /&gt;*b is a pointer to type struct a and so is legal. The compiler knows, the size of the pointer to a structure even before the size of the structure&lt;br /&gt;is determined(as you know the pointer to any type is of same size). This type of structures is known as ‘self-referencing’ structure.&lt;br /&gt;&lt;br /&gt;164)	Is the following code legal?&lt;br /&gt;typedef struct a&lt;br /&gt;    { &lt;br /&gt;int x;&lt;br /&gt; aType *b;&lt;br /&gt;    }aType&lt;br /&gt;Answer:&lt;br /&gt;		No&lt;br /&gt;Explanation:&lt;br /&gt;The typename aType is not known at the point of declaring the structure (forward references are not made for typedefs).&lt;br /&gt;&lt;br /&gt;165)	Is the following code legal?&lt;br /&gt;typedef struct a aType;&lt;br /&gt;struct a&lt;br /&gt;{ &lt;br /&gt;int x;&lt;br /&gt;aType *b;&lt;br /&gt;};&lt;br /&gt;Answer:&lt;br /&gt;	Yes&lt;br /&gt;Explanation:&lt;br /&gt;The typename aType is known at the point of declaring the structure, because it is already typedefined.&lt;br /&gt;&lt;br /&gt;166)	Is the following code legal?&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;typedef struct a aType;&lt;br /&gt;aType someVariable;&lt;br /&gt;struct a&lt;br /&gt;{ &lt;br /&gt;int x;&lt;br /&gt;      aType *b;&lt;br /&gt;              };&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;		No&lt;br /&gt;Explanation:&lt;br /&gt;		When the declaration,&lt;br /&gt;typedef struct a aType;&lt;br /&gt;is encountered body of struct a is not known. This is known as ‘incomplete types’.&lt;br /&gt; &lt;br /&gt;167)	void main()&lt;br /&gt;{&lt;br /&gt;printf(“sizeof (void *) = %d \n“, sizeof( void *));&lt;br /&gt;	printf(“sizeof (int *)    = %d \n”, sizeof(int *));&lt;br /&gt;	printf(“sizeof (double *)  = %d \n”, sizeof(double *));&lt;br /&gt;	printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *));&lt;br /&gt;	}&lt;br /&gt;Answer	:&lt;br /&gt;sizeof (void *) = 2&lt;br /&gt;sizeof (int *)    = 2&lt;br /&gt;sizeof (double *)  =  2&lt;br /&gt;sizeof(struct unknown *) =  2&lt;br /&gt;Explanation:&lt;br /&gt;The pointer to any type is of same size.&lt;br /&gt;&lt;br /&gt;168)	char inputString[100] = {0};&lt;br /&gt;To get string input from the keyboard which one of the following is better?&lt;br /&gt;	1) gets(inputString)&lt;br /&gt;	2) fgets(inputString, sizeof(inputString), fp)&lt;br /&gt;Answer &amp; Explanation:&lt;br /&gt;The second one is better because gets(inputString) doesn't know the size of the string passed and so, if a very big input (here, more than 100 chars) the charactes will be written past the input string. When fgets is used with stdin performs the same operation as gets but is safe.&lt;br /&gt;&lt;br /&gt;169)	Which version do you prefer of the following two,&lt;br /&gt;1) printf(“%s”,str); 	// or the more curt one&lt;br /&gt;2) printf(str);&lt;br /&gt;Answer &amp; Explanation:&lt;br /&gt;Prefer the first one. If the str contains any  format characters like %d then it will result in a subtle bug. &lt;br /&gt;&lt;br /&gt;170)	void main()&lt;br /&gt;{&lt;br /&gt;int i=10, j=2;&lt;br /&gt;int *ip= &amp;i, *jp = &amp;j;&lt;br /&gt;int k = *ip/*jp;&lt;br /&gt;printf(“%d”,k);&lt;br /&gt;}	&lt;br /&gt;Answer: &lt;br /&gt;Compiler Error: “Unexpected end of file in comment started in line 5”.&lt;br /&gt;Explanation:&lt;br /&gt;The programmer intended to divide two integers, but by the “maximum munch” rule, the compiler treats the operator sequence / and * as /* which happens to be the starting of comment. To force what is intended by the programmer,&lt;br /&gt;int k = *ip/ *jp;	&lt;br /&gt;// give space explicity separating / and * &lt;br /&gt;//or&lt;br /&gt;int k = *ip/(*jp);&lt;br /&gt;// put braces to force the intention  &lt;br /&gt;will solve the problem.  &lt;br /&gt;&lt;br /&gt;171)	void main()&lt;br /&gt;{&lt;br /&gt;char ch;&lt;br /&gt;for(ch=0;ch&lt;=127;ch++)&lt;br /&gt;printf(“%c   %d \n“, ch, ch);&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;	Implementaion dependent&lt;br /&gt;Explanation:&lt;br /&gt;The char type may be signed or unsigned by default. If it is signed then ch++ is executed after ch reaches 127 and rotates back to -128. Thus ch is always smaller than 127.&lt;br /&gt;&lt;br /&gt;172)	Is this code legal?&lt;br /&gt;int *ptr; &lt;br /&gt;ptr = (int *) 0x400; Answer: &lt;br /&gt;		Yes&lt;br /&gt;Explanation:&lt;br /&gt;The pointer ptr will point at the integer in the memory location 0x400. &lt;br /&gt;173)	main()&lt;br /&gt;{&lt;br /&gt;char a[4]="HELLO";&lt;br /&gt;printf("%s",a);&lt;br /&gt;}	&lt;br /&gt;Answer: &lt;br /&gt;		Compiler error: Too many initializers&lt;br /&gt;Explanation:&lt;br /&gt;The array a is of size 4 but the string constant requires 6 bytes to get stored.&lt;br /&gt;&lt;br /&gt;174)	main()&lt;br /&gt;{	&lt;br /&gt;char a[4]="HELL";&lt;br /&gt;printf("%s",a);&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;		HELL%@!~@!@???@~~!&lt;br /&gt;Explanation:&lt;br /&gt;The character array has the memory just enough to hold the string “HELL” and doesnt have enough space to store the terminating null character. So it prints the HELL correctly and continues to print garbage values till it 	accidentally comes across a NULL character.&lt;br /&gt;&lt;br /&gt;175)	main()&lt;br /&gt;{ &lt;br /&gt;		int a=10,*j;&lt;br /&gt;	void *k; &lt;br /&gt;		j=k=&amp;a;&lt;br /&gt;  	j++;  &lt;br /&gt;		k++;&lt;br /&gt;  	printf("\n %u %u ",j,k);&lt;br /&gt;} &lt;br /&gt;Answer: &lt;br /&gt;		Compiler error: Cannot increment a void pointer&lt;br /&gt;Explanation:&lt;br /&gt;Void pointers are generic pointers and they can be used only when the type is not known and as an intermediate address storage type. No pointer arithmetic can be done on it and you cannot apply indirection operator (*) on void pointers.&lt;br /&gt;&lt;br /&gt;176)	main()&lt;br /&gt;		{&lt;br /&gt;			extern int i;&lt;br /&gt;		{ 	int i=20;&lt;br /&gt;		 { 	&lt;br /&gt;		   const volatile unsigned i=30; printf("%d",i); &lt;br /&gt;		 }&lt;br /&gt;	  	printf("%d",i);&lt;br /&gt;		}&lt;br /&gt;		  printf("%d",i);&lt;br /&gt;	}	&lt;br /&gt;	int i;&lt;br /&gt;&lt;br /&gt;177)	Printf can be implemented by using  __________ list.&lt;br /&gt;Answer: &lt;br /&gt;		Variable length argument lists&lt;br /&gt;178) char *someFun()&lt;br /&gt;		{&lt;br /&gt;		char *temp = “string constant";&lt;br /&gt;		return temp;&lt;br /&gt;		}&lt;br /&gt;		int main()&lt;br /&gt;		{&lt;br /&gt;		puts(someFun());&lt;br /&gt;		}&lt;br /&gt;Answer:&lt;br /&gt;		string constant &lt;br /&gt;Explanation:&lt;br /&gt;		The program suffers no problem and gives the output correctly because the character constants are stored in code/data area and not allocated in stack, so this doesn’t lead to dangling pointers. &lt;br /&gt;&lt;br /&gt;179) 	char *someFun1()&lt;br /&gt;		{&lt;br /&gt;		char temp[ ] = “string";&lt;br /&gt;		return temp;&lt;br /&gt;		}&lt;br /&gt;		char *someFun2()&lt;br /&gt;		{&lt;br /&gt;		char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’};&lt;br /&gt;		return temp;&lt;br /&gt;		}&lt;br /&gt;		int main()&lt;br /&gt;		{&lt;br /&gt;		puts(someFun1());&lt;br /&gt;		puts(someFun2());&lt;br /&gt;		}&lt;br /&gt;Answer:&lt;br /&gt;	Garbage values.&lt;br /&gt;Explanation:&lt;br /&gt;	Both the functions suffer from the problem of dangling pointers. In someFun1() temp is a character array and so the space for it is allocated in heap and is initialized with character string “string”. This is created dynamically as the function is called, so is also deleted dynamically on exiting the function so the string data is not available in the calling function main() leading to print some garbage values. The function someFun2() also suffers from the same problem but the problem can be easily identified in this case.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C++ Aptitude and OOPS&lt;br /&gt;Note : 	All the programs are tested under Turbo C++ 3.0, 4.5 and Microsoft VC++ 6.0 compilers.  &lt;br /&gt;It is assumed that,&lt;br /&gt;	Programs run under Windows environment,&lt;br /&gt;	The underlying machine is an x86 based system,&lt;br /&gt;	Program is compiled using Turbo C/C++ compiler.&lt;br /&gt;The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed). &lt;br /&gt;&lt;br /&gt;1) class Sample&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;        int *ptr;&lt;br /&gt;        Sample(int i)&lt;br /&gt;        {&lt;br /&gt;        ptr = new int(i);&lt;br /&gt;        }&lt;br /&gt;        ~Sample()&lt;br /&gt;        {&lt;br /&gt;        delete ptr;&lt;br /&gt;        }&lt;br /&gt;        void PrintVal()&lt;br /&gt;        {&lt;br /&gt;        cout &lt;&lt; "The value is " &lt;&lt; *ptr;&lt;br /&gt;        }&lt;br /&gt;};&lt;br /&gt;void SomeFunc(Sample x)&lt;br /&gt;{&lt;br /&gt;cout &lt;&lt; "Say i am in someFunc " &lt;&lt; endl;&lt;br /&gt;}&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;Sample s1= 10;&lt;br /&gt;SomeFunc(s1);&lt;br /&gt;s1.PrintVal();&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Say i am in someFunc &lt;br /&gt;Null pointer assignment(Run-time error)&lt;br /&gt;Explanation:&lt;br /&gt;As the object is passed by value to SomeFunc  the destructor of the object is called when the control returns from the function. So when PrintVal is called it meets up with ptr  that has been freed.The solution is to pass the Sample object  by reference to SomeFunc:&lt;br /&gt;&lt;br /&gt;void SomeFunc(Sample &amp;x)&lt;br /&gt;{&lt;br /&gt;cout &lt;&lt; "Say i am in someFunc " &lt;&lt; endl;&lt;br /&gt;}&lt;br /&gt;because when we pass objects by refernece that object is not destroyed. while returning from the function.&lt;br /&gt;&lt;br /&gt;2)	Which is the parameter that is added to every non-static member function when it is called?&lt;br /&gt;Answer:&lt;br /&gt;	‘this’ pointer&lt;br /&gt;&lt;br /&gt;3) class base&lt;br /&gt;        {&lt;br /&gt;        public:&lt;br /&gt;        int bval;&lt;br /&gt;        base(){ bval=0;}&lt;br /&gt;        };&lt;br /&gt;&lt;br /&gt;class deri:public base&lt;br /&gt;        {&lt;br /&gt;        public:&lt;br /&gt;        int dval;&lt;br /&gt;        deri(){ dval=1;}&lt;br /&gt;        };&lt;br /&gt;void SomeFunc(base *arr,int size)&lt;br /&gt;{&lt;br /&gt;for(int i=0; i&lt;size; i++,arr++)&lt;br /&gt;        cout&lt;&lt;arr-&gt;bval;&lt;br /&gt;cout&lt;&lt;endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;base BaseArr[5];&lt;br /&gt;SomeFunc(BaseArr,5);&lt;br /&gt;deri DeriArr[5];&lt;br /&gt;SomeFunc(DeriArr,5);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt; 00000&lt;br /&gt; 01010&lt;br /&gt;Explanation:  &lt;br /&gt;The function SomeFunc expects two arguments.The first one is a pointer to an array of base class objects and the second one is the sizeof the array.The first call of someFunc calls it with an array of bae objects, so it works correctly and prints the bval of all the objects. When Somefunc is called the second time the argument passed is the pointeer to an array of derived class objects and not the array of base class objects. But that is what the function expects to be sent. So the derived class pointer is promoted to base class pointer and the address is sent to the function. SomeFunc() knows nothing about this and just treats the pointer as an array of base class objects. So when arr++ is met, the size of base class object is taken into consideration and is incremented by sizeof(int) bytes for bval (the deri class objects have bval and dval as members and so is of size &gt;= sizeof(int)+sizeof(int) ). &lt;br /&gt;&lt;br /&gt;4) class base&lt;br /&gt;        {&lt;br /&gt;        public:&lt;br /&gt;        	void baseFun(){ cout&lt;&lt;"from base"&lt;&lt;endl;}&lt;br /&gt;        };&lt;br /&gt; class deri:public base&lt;br /&gt;        {&lt;br /&gt;        public:&lt;br /&gt;        	void baseFun(){ cout&lt;&lt; "from derived"&lt;&lt;endl;}&lt;br /&gt;        };&lt;br /&gt;void SomeFunc(base *baseObj)&lt;br /&gt;{&lt;br /&gt;        baseObj-&gt;baseFun();&lt;br /&gt;}&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;base baseObject;&lt;br /&gt;SomeFunc(&amp;baseObject);&lt;br /&gt;deri deriObject;&lt;br /&gt;SomeFunc(&amp;deriObject);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;	from base&lt;br /&gt;	from base&lt;br /&gt;Explanation:&lt;br /&gt;	As we have seen in the previous case, SomeFunc expects a pointer to a base class. Since a pointer to a derived class object is passed, it treats the argument only as a base class pointer and the corresponding base function is called. &lt;br /&gt;&lt;br /&gt;5) class base&lt;br /&gt;        {&lt;br /&gt;        public:&lt;br /&gt;        	virtual void baseFun(){ cout&lt;&lt;"from base"&lt;&lt;endl;}&lt;br /&gt;        };&lt;br /&gt; class deri:public base&lt;br /&gt;        {&lt;br /&gt;        public:&lt;br /&gt;        	void baseFun(){ cout&lt;&lt; "from derived"&lt;&lt;endl;}&lt;br /&gt;        };&lt;br /&gt;void SomeFunc(base *baseObj)&lt;br /&gt;{&lt;br /&gt;        baseObj-&gt;baseFun();&lt;br /&gt;}&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;base baseObject;&lt;br /&gt;SomeFunc(&amp;baseObject);&lt;br /&gt;deri deriObject;&lt;br /&gt;SomeFunc(&amp;deriObject);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;	from base&lt;br /&gt;	from derived &lt;br /&gt;Explanation:&lt;br /&gt;	Remember that baseFunc is a virtual function. That means that it supports run-time polymorphism. So the function corresponding to the derived class object is called. &lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;	int a, *pa, &amp;ra;&lt;br /&gt;	pa = &amp;a;&lt;br /&gt;	ra = a;&lt;br /&gt;	cout &lt;&lt;"a="&lt;&lt;a &lt;&lt;"*pa="&lt;&lt;*pa &lt;&lt;"ra"&lt;&lt;ra ;&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;Answer : &lt;br /&gt;	Compiler Error: 'ra',reference must be initialized&lt;br /&gt;Explanation : &lt;br /&gt;	Pointers are different from references. One of the main &lt;br /&gt;differences is that the pointers can be both initialized and assigned,&lt;br /&gt;whereas references can only be initialized. So this code issues an error.&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;const int size = 5;&lt;br /&gt;void print(int *ptr)&lt;br /&gt;{&lt;br /&gt;	cout&lt;&lt;ptr[0];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void print(int ptr[size])&lt;br /&gt;{&lt;br /&gt;	cout&lt;&lt;ptr[0];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;	int a[size] = {1,2,3,4,5};&lt;br /&gt;	int *b = new int(size);&lt;br /&gt;	print(a);&lt;br /&gt;	print(b);&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;Answer:&lt;br /&gt;	Compiler Error : function 'void print(int *)' already has a body&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;	Arrays cannot be passed to functions, only pointers (for arrays, base addresses) &lt;br /&gt;can be passed. So the arguments int *ptr and int prt[size] have no difference  &lt;br /&gt;as function arguments. In other words, both the functoins have the same signature and&lt;br /&gt;so cannot be overloaded. &lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;class some{&lt;br /&gt;public:&lt;br /&gt;	~some()&lt;br /&gt;	{&lt;br /&gt;		cout&lt;&lt;"some's destructor"&lt;&lt;endl;&lt;br /&gt;	}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;	some s;&lt;br /&gt;	s.~some();&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;Answer:&lt;br /&gt;	some's destructor&lt;br /&gt;	some's destructor&lt;br /&gt;Explanation:&lt;br /&gt;	Destructors can be called explicitly. Here 's.~some()' explicitly calls the &lt;br /&gt;destructor of 's'. When main() returns, destructor of s is called again,&lt;br /&gt;hence the result.&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;#include &lt;iostream.h&gt;&lt;br /&gt;&lt;br /&gt;class fig2d&lt;br /&gt;{&lt;br /&gt;	int dim1;&lt;br /&gt;	int dim2;&lt;br /&gt;&lt;br /&gt;public:&lt;br /&gt;	fig2d() { dim1=5; dim2=6;}&lt;br /&gt;&lt;br /&gt;	virtual void operator&lt;&lt;(ostream &amp; rhs);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void fig2d::operator&lt;&lt;(ostream &amp;rhs)&lt;br /&gt;{&lt;br /&gt;	rhs &lt;&lt;this-&gt;dim1&lt;&lt;" "&lt;&lt;this-&gt;dim2&lt;&lt;" ";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*class fig3d : public fig2d&lt;br /&gt;{&lt;br /&gt;	int dim3;&lt;br /&gt;public:&lt;br /&gt;	fig3d() { dim3=7;}&lt;br /&gt;	virtual void operator&lt;&lt;(ostream &amp;rhs);&lt;br /&gt;};&lt;br /&gt;void fig3d::operator&lt;&lt;(ostream &amp;rhs)&lt;br /&gt;{&lt;br /&gt;	fig2d::operator &lt;&lt;(rhs);&lt;br /&gt;	rhs&lt;&lt;this-&gt;dim3;&lt;br /&gt;}&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;	fig2d obj1;&lt;br /&gt;//	fig3d obj2;&lt;br /&gt;&lt;br /&gt;	obj1 &lt;&lt; cout;&lt;br /&gt;//	obj2 &lt;&lt; cout;&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;Answer : &lt;br /&gt;	5 6 &lt;br /&gt;Explanation:&lt;br /&gt;	In this program, the &lt;&lt; operator is overloaded with ostream as argument.&lt;br /&gt;This enables the 'cout' to be present at the right-hand-side. Normally, 'cout' &lt;br /&gt;is implemented as global function, but it doesn't mean that 'cout' is not possible &lt;br /&gt;to be overloaded as member function.&lt;br /&gt;    Overloading &lt;&lt; as virtual member function becomes handy when the class in which &lt;br /&gt;it is overloaded is inherited, and this becomes available to be overrided. This is as opposed &lt;br /&gt;to global friend functions, where friend's are not inherited.&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;class opOverload{&lt;br /&gt;public:&lt;br /&gt;	bool operator==(opOverload temp);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;bool opOverload::operator==(opOverload temp){&lt;br /&gt;	if(*this  == temp ){&lt;br /&gt;		cout&lt;&lt;"The both are same objects\n";&lt;br /&gt;		return true;&lt;br /&gt;	}&lt;br /&gt;	else{&lt;br /&gt;		cout&lt;&lt;"The both are different\n";&lt;br /&gt;		return false;&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void main(){&lt;br /&gt;	opOverload a1, a2;&lt;br /&gt;	a1= =a2;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer : &lt;br /&gt;	Runtime Error: Stack Overflow&lt;br /&gt;Explanation :&lt;br /&gt;	Just like normal functions, operator functions can be called recursively. This program just illustrates that point, by calling the operator == function recursively, leading to an infinite loop. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class complex{&lt;br /&gt;	double re;&lt;br /&gt;	double im;&lt;br /&gt;public:&lt;br /&gt;	complex() : re(1),im(0.5) {}&lt;br /&gt;	bool operator==(complex &amp;rhs);&lt;br /&gt;	operator int(){}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;bool complex::operator == (complex &amp;rhs){&lt;br /&gt;	if((this-&gt;re == rhs.re) &amp;&amp; (this-&gt;im == rhs.im))&lt;br /&gt;		return true;&lt;br /&gt;	else&lt;br /&gt;		return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(){&lt;br /&gt;	complex  c1;&lt;br /&gt;	cout&lt;&lt;  c1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer : Garbage value&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;	The programmer wishes to print the complex object using output&lt;br /&gt;re-direction operator,which he has not defined for his lass.But the compiler instead of giving an error sees the conversion function&lt;br /&gt;and converts the user defined object to standard object and prints&lt;br /&gt;some garbage value.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class complex{&lt;br /&gt;	double re;&lt;br /&gt;	double im;&lt;br /&gt;public:&lt;br /&gt;	complex() : re(0),im(0) {}&lt;br /&gt;	complex(double n) { re=n,im=n;};&lt;br /&gt;	complex(int m,int n) { re=m,im=n;}&lt;br /&gt;	void print() { cout&lt;&lt;re; cout&lt;&lt;im;}	&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void main(){&lt;br /&gt;	complex c3;&lt;br /&gt;	double i=5;&lt;br /&gt;	c3 = i;&lt;br /&gt;	c3.print();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: &lt;br /&gt;	5,5 &lt;br /&gt;Explanation:&lt;br /&gt;	Though no operator= function taking complex, double is defined, the double on the rhs is converted into a temporary object using the single argument constructor taking double and assigned to the lvalue.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;	int a, *pa, &amp;ra;&lt;br /&gt;	pa = &amp;a;&lt;br /&gt;	ra = a;&lt;br /&gt;	cout &lt;&lt;"a="&lt;&lt;a &lt;&lt;"*pa="&lt;&lt;*pa &lt;&lt;"ra"&lt;&lt;ra ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer : &lt;br /&gt;	Compiler Error: 'ra',reference must be initialized&lt;br /&gt;Explanation : &lt;br /&gt;	Pointers are different from references. One of the main &lt;br /&gt;differences is that the pointers can be both initialized and assigned,&lt;br /&gt;whereas references can only be initialized. So this code issues an error.&lt;br /&gt;&lt;br /&gt;Try it Yourself &lt;br /&gt;&lt;br /&gt;1) Determine the output of the 'C++' Codelet.	&lt;br /&gt;	class base&lt;br /&gt;	{  &lt;br /&gt;	public : &lt;br /&gt;		out() &lt;br /&gt;		{ &lt;br /&gt;			cout&lt;&lt;"base ";  &lt;br /&gt;		}  &lt;br /&gt;	};&lt;br /&gt;	class deri{ &lt;br /&gt;	public : out() &lt;br /&gt;	{ &lt;br /&gt;	cout&lt;&lt;"deri "; &lt;br /&gt;	}   &lt;br /&gt;	};&lt;br /&gt;	void main()&lt;br /&gt;	{ 	deri dp[3];&lt;br /&gt;		base *bp = (base*)dp;&lt;br /&gt;		for (int i=0; i&lt;3;i++)&lt;br /&gt;		(bp++)-&gt;out();&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;2)	Justify the use of virtual constructors and destructors in C++.&lt;br /&gt;&lt;br /&gt;3)	Each C++ object possesses the 4 member fns,(which can be declared by the programmer explicitly or by the implementation if they are not available). What are those 4 functions?&lt;br /&gt;&lt;br /&gt;4)	 What is wrong with this class declaration?&lt;br /&gt;	class something&lt;br /&gt;	{&lt;br /&gt;		char *str;&lt;br /&gt;		public:&lt;br /&gt;		   something(){&lt;br /&gt;		   st = new char[10]; }&lt;br /&gt;		  ~something()&lt;br /&gt;		  {&lt;br /&gt;	   		delete str; &lt;br /&gt;		  }&lt;br /&gt;	 };&lt;br /&gt;&lt;br /&gt;5) Inheritance is also known as -------- relationship. Containership as   ________ relationship.&lt;br /&gt;&lt;br /&gt;6)  When is it necessary to use member-wise initialization list  (also known as header initialization list) in C++?&lt;br /&gt;&lt;br /&gt;7) Which is the only operator in C++ which can be overloaded but NOT inherited.&lt;br /&gt;&lt;br /&gt;8) Is there anything wrong with this C++ class declaration?&lt;br /&gt;	class temp&lt;br /&gt;	{&lt;br /&gt;	  int value1; &lt;br /&gt;	  mutable int value2;&lt;br /&gt;	  public :&lt;br /&gt;	  	void fun(int val) &lt;br /&gt;		const{&lt;br /&gt;	  	((temp*) this)-&gt;value1 = 10;&lt;br /&gt;	  	value2 = 10;&lt;br /&gt;	  	}&lt;br /&gt;	 };&lt;br /&gt; &lt;br /&gt;1.  What is a modifier?&lt;br /&gt;Answer:&lt;br /&gt;          A modifier, also called a modifying function is a member function that changes the value of at least one data member. In other words, an operation that modifies the state of an object. Modifiers are also known as ‘mutators’.&lt;br /&gt;&lt;br /&gt;2.  What is an accessor?&lt;br /&gt;Answer:&lt;br /&gt;          An accessor is a class operation that does not modify the state of an object. The accessor functions need to be declared as const operations&lt;br /&gt;&lt;br /&gt;3.   Differentiate between a template class and class template.&lt;br /&gt;Answer:&lt;br /&gt;Template class:&lt;br /&gt;A generic definition or a parameterized class not instantiated until the client provides the needed information. It’s jargon for plain templates.&lt;br /&gt;Class template:&lt;br /&gt;A class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. It’s jargon for plain classes.&lt;br /&gt;&lt;br /&gt;4.   When does a name clash occur?&lt;br /&gt;Answer:&lt;br /&gt;        	A name clash occurs when a name is defined in more than one place. For example., two different class libraries could give two different classes the same name. If you try to use many class libraries at the same time, there is a fair chance that you will be unable to compile or link the program because of name clashes.&lt;br /&gt;&lt;br /&gt;5.   Define namespace.&lt;br /&gt;Answer:  &lt;br /&gt;        	It is a feature in c++ to minimize name collisions in the global name space. This namespace keyword assigns a distinct name to a library that allows other libraries to use the same identifier names without creating any name collisions. Furthermore, the compiler uses the namespace signature for differentiating the definitions.&lt;br /&gt;&lt;br /&gt;6.   What is the use of ‘using’ declaration.&lt;br /&gt;Answer: &lt;br /&gt;       	A using declaration makes it possible to use a name from a namespace without the scope operator.&lt;br /&gt;&lt;br /&gt;7.   What is an Iterator class?&lt;br /&gt;Answer:   &lt;br /&gt; 	A class that is used to traverse through the objects maintained by a container class. There are five categories of iterators:            &lt;br /&gt;	 input iterators,&lt;br /&gt;	output iterators,&lt;br /&gt;	forward iterators,&lt;br /&gt;	bidirectional iterators,&lt;br /&gt;	 random access.&lt;br /&gt;An iterator is an entity that gives access to the contents of a container object without violating encapsulation constraints. Access to the contents is granted on a one-at-a-time basis in order. The order can be storage order (as in lists and queues) or some arbitrary order (as in array indices) or according to some ordering relation (as in an ordered binary tree). The iterator is a construct, which provides an interface that, when called, yields either the next element in the container, or some value denoting the fact that there are no more elements to examine. Iterators hide the details of access to and update of the elements of a container class.&lt;br /&gt;The simplest and safest iterators are those that permit read-only access to the contents of a container class. The following code fragment shows how an iterator might appear in code:&lt;br /&gt;           cont_iter:=new cont_iterator();&lt;br /&gt;           x:=cont_iter.next();&lt;br /&gt;           while x/=none do&lt;br /&gt;                 ...&lt;br /&gt;                 s(x);&lt;br /&gt;                 ...&lt;br /&gt;                 x:=cont_iter.next();&lt;br /&gt;          end;&lt;br /&gt;         In this example, cont_iter is the name of the iterator. It is created on the first line by instantiation of cont_iterator class, an iterator class defined to iterate over some container class, cont. Succesive elements from the container are carried to x. The loop terminates when x is bound to some empty value. (Here, none)In the middle of the loop, there is s(x) an operation on x, the current element from the container. The next element of the container is obtained at the bottom of the loop.&lt;br /&gt;&lt;br /&gt;9.   List out some of the OODBMS available.&lt;br /&gt;Answer:&lt;br /&gt;	    GEMSTONE/OPAL of Gemstone systems.&lt;br /&gt;	    ONTOS of Ontos.&lt;br /&gt;	    Objectivity of  Objectivity inc.&lt;br /&gt;	    Versant of Versant object technology.&lt;br /&gt;	     Object store of Object Design.&lt;br /&gt;	     ARDENT of ARDENT software.&lt;br /&gt;	     POET of POET software.&lt;br /&gt;&lt;br /&gt;10.   List out some of the object-oriented methodologies.&lt;br /&gt;Answer:&lt;br /&gt;	     Object Oriented Development  (OOD) (Booch 1991,1994).&lt;br /&gt;	     Object Oriented Analysis and Design  (OOA/D) (Coad and Yourdon 1991).&lt;br /&gt;	     Object Modelling Techniques  (OMT)  (Rumbaugh 1991).&lt;br /&gt;	     Object Oriented Software Engineering  (Objectory) (Jacobson 1992).&lt;br /&gt;	     Object Oriented Analysis  (OOA) (Shlaer and Mellor 1992).&lt;br /&gt;	     The Fusion Method  (Coleman 1991).&lt;br /&gt;&lt;br /&gt;11.   What is an incomplete type?&lt;br /&gt;Answer:&lt;br /&gt;    	Incomplete types refers to pointers in which there is non availability of the implementation of the referenced location or it points to some location whose value is not available for modification.&lt;br /&gt;Example:&lt;br /&gt;                 int *i=0x400  // i points to address 400&lt;br /&gt;                *i=0;        //set the value of memory location pointed by i.&lt;br /&gt;Incomplete types are otherwise called uninitialized pointers.&lt;br /&gt;&lt;br /&gt;12.   What is a dangling pointer?&lt;br /&gt;Answer:&lt;br /&gt;A dangling pointer arises when you use the address of an object after its lifetime is over.&lt;br /&gt;This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed.&lt;br /&gt;&lt;br /&gt;13.   Differentiate between the message and method.&lt;br /&gt;Answer:&lt;br /&gt;          Message                                                                   Method&lt;br /&gt;Objects communicate by sending messages     Provides response to a message.&lt;br /&gt;to each other.&lt;br /&gt;A message is sent to invoke a method.             It is an implementation of an operation.&lt;br /&gt;&lt;br /&gt;14.   What is an adaptor class or Wrapper class?&lt;br /&gt;Answer:&lt;br /&gt;A class that has no functionality of its own. Its member functions hide the use of a third party software component or an object with the non-compatible interface or a non- object- oriented implementation.&lt;br /&gt;&lt;br /&gt;15.   What is a Null object?&lt;br /&gt;Answer:&lt;br /&gt;It is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member function that is supposed to return an object with some specified properties but cannot find such an object.&lt;br /&gt;&lt;br /&gt;16.   What is class invariant?&lt;br /&gt;Answer:&lt;br /&gt;A class invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the correct working of a class. Class invariants must hold when an object is created, and they must be preserved under all operations of the class. In particular all class invariants are both preconditions and post-conditions for all operations or member functions of the class.&lt;br /&gt;&lt;br /&gt;17.   What do you mean by Stack unwinding?&lt;br /&gt;Answer:&lt;br /&gt;It is a process during exception handling when the destructor is called for all local objects between the place where the exception was thrown and where it is caught.&lt;br /&gt;               &lt;br /&gt;18.   Define precondition and post-condition to a member function.&lt;br /&gt;Answer:&lt;br /&gt;Precondition:&lt;br /&gt;            A precondition is a condition that must be true on entry to a member function. A class is used correctly if preconditions are never false. An operation is not responsible for doing anything sensible if its precondition fails to hold. &lt;br /&gt;For example, the interface invariants of stack class say nothing about pushing yet another element on a stack that is already full. We say that isful() is a precondition of the push operation.&lt;br /&gt;&lt;br /&gt;Post-condition:&lt;br /&gt;            A post-condition is a condition that must be true on exit from a member function if the precondition was valid on entry to that function. A class is implemented correctly if post-conditions are never false.&lt;br /&gt;For example, after pushing an element on the stack, we know that isempty() must necessarily hold. This is a post-condition of the push operation.&lt;br /&gt;&lt;br /&gt;19.   What are the conditions that have to be met for a condition to be an invariant of the class?&lt;br /&gt;Answer:&lt;br /&gt;	The condition should hold at the end of every constructor.&lt;br /&gt;	The condition should hold at the end of every mutator(non-const) operation.&lt;br /&gt;      &lt;br /&gt;20.   What are proxy objects?&lt;br /&gt;Answer: &lt;br /&gt;            Objects that stand for other objects are called proxy objects or surrogates.&lt;br /&gt;Example:&lt;br /&gt;                  template&lt;class T&gt;&lt;br /&gt;                  class Array2D &lt;br /&gt;                  {&lt;br /&gt;                         public:&lt;br /&gt;                              class Array1D&lt;br /&gt;                               {&lt;br /&gt;            		 public:&lt;br /&gt;                                 T&amp; operator[] (int index);&lt;br /&gt;                                 const T&amp; operator[] (int index) const;&lt;br /&gt;                                 ...&lt;br /&gt;                               };&lt;br /&gt;                              Array1D operator[] (int index);&lt;br /&gt;                              const Array1D operator[] (int index) const;&lt;br /&gt;                              ...&lt;br /&gt;                   };&lt;br /&gt;       &lt;br /&gt;            The following then becomes legal:&lt;br /&gt;                   Array2D&lt;float&gt;data(10,20);&lt;br /&gt;               ........&lt;br /&gt;               cout&lt;&lt;data[3][6];     //  fine	&lt;br /&gt;&lt;br /&gt; 	Here data[3] yields an Array1D object and the operator [] invocation on that object yields the float in position(3,6) of the original two dimensional array. Clients of the Array2D class need not be aware of the presence of the Array1D class. Objects of this latter class stand for one-dimensional array objects that, conceptually, do not exist for clients of Array2D. Such clients program as if they were using real, live, two-dimensional arrays. Each Array1D object stands for a one-dimensional array that is absent from a conceptual model used by the clients of Array2D. In the above example, Array1D is a proxy class. Its instances stand for one-dimensional arrays that, conceptually, do not exist.&lt;br /&gt;       &lt;br /&gt;21.   Name some pure object oriented languages.&lt;br /&gt;Answer:&lt;br /&gt;	  Smalltalk, &lt;br /&gt;	  Java, &lt;br /&gt;	  Eiffel,  &lt;br /&gt;	  Sather.&lt;br /&gt;&lt;br /&gt;22.   Name the operators that cannot be overloaded.    &lt;br /&gt;Answer:&lt;br /&gt;sizeof	 .	.*	.-&gt;	::	?:                      &lt;br /&gt;&lt;br /&gt;23.   What is a node class?&lt;br /&gt;Answer:&lt;br /&gt;A node class is a class that,&lt;br /&gt;	relies on the base class for services and implementation,&lt;br /&gt;	provides a wider interface to te users than its base class,&lt;br /&gt;	relies primarily on virtual functions in its public interface&lt;br /&gt;	depends on all its direct and indirect base class&lt;br /&gt;	can be understood only in the context of the base class&lt;br /&gt;	can be used as base for further derivation&lt;br /&gt;	can be used to create objects.&lt;br /&gt;A node class is a class that has added new services or functionality beyond the services inherited from its base class.    &lt;br /&gt;&lt;br /&gt;24.   What is an orthogonal base class?&lt;br /&gt;Answer:&lt;br /&gt;If two base classes have no overlapping methods or data they are said to be independent of, or orthogonal to each other. Orthogonal in the sense means that two classes operate in different dimensions and do not interfere with each other in any way. The same derived class may inherit such classes with no difficulty.&lt;br /&gt;&lt;br /&gt;25. What is a container class? What are the types of container classes?&lt;br /&gt;Answer:&lt;br /&gt;A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behavior and a well-known interface. A container class is a supporting class whose purpose is to hide the topology used for maintaining the list of objects in memory. When a container class contains a group of mixed objects, the container is called a heterogeneous container; when the container is holding a group of objects that are all the same, the container is called a homogeneous container.&lt;br /&gt;&lt;br /&gt;26. What is a protocol class?&lt;br /&gt;Answer:&lt;br /&gt;An abstract class is a protocol class if:&lt;br /&gt;	it neither contains nor inherits from classes that contain member data, non-virtual functions, or private (or protected) members of any kind.&lt;br /&gt;	it has a non-inline virtual destructor defined with an empty implementation,&lt;br /&gt;	all member functions other than the destructor including inherited functions, are declared pure virtual functions and left undefined.&lt;br /&gt;&lt;br /&gt;27. What is a mixin class?&lt;br /&gt;Answer:&lt;br /&gt;A class that provides some but not all of the implementation for a virtual base class is often called mixin. Derivation done just for the purpose of redefining the virtual functions in the base classes is often called mixin inheritance. Mixin classes typically don't share common bases.&lt;br /&gt;&lt;br /&gt;28. What is a concrete class?&lt;br /&gt;Answer:&lt;br /&gt;A concrete class is used to define a useful object that can be instantiated as an automatic variable on the program stack. The implementation of a concrete class is defined. The concrete class is not intended to be a base class and no attempt to minimize dependency on other classes in the implementation or behavior of the class.&lt;br /&gt;&lt;br /&gt;29.What is the handle class?&lt;br /&gt;Answer:&lt;br /&gt;A handle is a class that maintains a pointer to an object that is programmatically accessible through the public interface of the handle class.&lt;br /&gt;Explanation:&lt;br /&gt;In case of abstract classes, unless one manipulates the objects of these classes through pointers and references, the benefits of the virtual functions are lost. User code may become dependent on details of implementation classes because an abstract type cannot be allocated statistically or on the stack without its size being known. Using pointers or references implies that the burden of memory management falls on the user. Another limitation of abstract class object is of fixed size. Classes however are used to represent concepts that require varying amounts of storage to implement them.&lt;br /&gt;A popular technique for dealing with these issues is to separate what is used as a single object in two parts: a handle providing the user interface and a representation holding all or most of the object's state. The connection between the handle and the representation is typically a pointer in the handle. Often, handles have a bit more data than the simple representation pointer, but not much more. Hence the layout of the handle is typically stable, even when the representation changes and also that handles are small enough to move around relatively freely so that the user needn’t use the pointers and the references.    &lt;br /&gt;   &lt;br /&gt; 30. What is an action class?&lt;br /&gt;Answer:&lt;br /&gt;The simplest and most obvious way to specify an action in C++ is to write a function. However, if the action has to be delayed, has to be transmitted 'elsewhere' before being performed, requires its own data, has to be combined with other actions, etc then it often becomes attractive to provide the action in the form of a class that can execute the desired action and provide other services as well. Manipulators used with iostreams is an obvious example.&lt;br /&gt;Explanation:&lt;br /&gt;	A common form of action class is a simple class containing just one virtual function.&lt;br /&gt;         class Action&lt;br /&gt;       {&lt;br /&gt;               public:&lt;br /&gt;                    virtual int do_it( int )=0;&lt;br /&gt;                    virtual ~Action( );&lt;br /&gt;         }&lt;br /&gt;Given this, we can write code say a member that can store actions for later execution without using pointers to functions, without knowing anything about the objects involved, and without even knowing the name of the operation it invokes. For example:&lt;br /&gt;class write_file : public Action&lt;br /&gt;     {&lt;br /&gt;              File&amp; f;&lt;br /&gt;              public:&lt;br /&gt;                  int do_it(int)&lt;br /&gt;                 {&lt;br /&gt;                       return fwrite( ).suceed( );&lt;br /&gt;                 }&lt;br /&gt;      };&lt;br /&gt;     class error_message: public Action&lt;br /&gt;     {&lt;br /&gt;                response_box db(message.cstr( ),"Continue","Cancel","Retry");&lt;br /&gt;                switch (db.getresponse( ))&lt;br /&gt;                {&lt;br /&gt;                        case 0: return 0;&lt;br /&gt;                        case 1: abort();&lt;br /&gt;                        case 2: current_operation.redo( );return 1;&lt;br /&gt;                 }&lt;br /&gt;      };   &lt;br /&gt;&lt;br /&gt;A user of the Action class will be completely isolated from any knowledge of derived classes such as write_file and error_message.&lt;br /&gt;&lt;br /&gt;31. When can you tell that a memory leak will occur?&lt;br /&gt;Answer:&lt;br /&gt;A memory leak occurs when a program loses the ability to free a block of dynamically allocated memory.&lt;br /&gt;&lt;br /&gt;32.What is a parameterized type?&lt;br /&gt;Answer:&lt;br /&gt;A template is a parameterized construct or type containing generic code that can use or manipulate any type. It is called parameterized because an actual type is a parameter of the code body. Polymorphism may be achieved through parameterized types. This type of polymorphism is called parameteric polymorphism. Parameteric polymorphism is the mechanism by which the same code is used on different types passed as parameters. &lt;br /&gt;&lt;br /&gt;33. Differentiate between a deep copy and a shallow copy?&lt;br /&gt;Answer:&lt;br /&gt;Deep copy involves using the contents of one object to create another instance of the same class. In a deep copy, the two objects may contain ht same information but the target object will have its own buffers and resources. the destruction of either object will not affect the remaining object. The overloaded assignment operator would create a deep copy of objects.&lt;br /&gt;Shallow copy involves copying the contents of one object into another instance of the same class thus creating a mirror image. Owing to straight copying of references and pointers, the two objects will share the same externally contained contents of the other object to be unpredictable.&lt;br /&gt;Explanation:&lt;br /&gt;Using a copy constructor we simply copy the data values member by member. This method of copying is called shallow copy. If the object is a simple class, comprised of built in types and no pointers this would be acceptable. This function would use the values and the objects and its behavior would not be altered with a shallow copy, only the addresses of pointers that are members are copied and not the value the address is pointing to. The data values of the object would then be inadvertently altered by the function. When the function goes out of scope, the copy of the object with all its data is popped off the stack. &lt;br /&gt;If the object has any pointers a deep copy needs to be executed. With the deep copy of an object, memory is allocated for the object in free store and the elements pointed to are copied. A deep copy is used for objects that are returned from a function.&lt;br /&gt;&lt;br /&gt;34. What is an opaque pointer?&lt;br /&gt;Answer:&lt;br /&gt;A pointer is said to be opaque if the definition of the type to which it points to is not included in the current translation unit. A translation unit is the result of merging an implementation file with all its headers and header files.&lt;br /&gt;&lt;br /&gt;35. What is a smart pointer?&lt;br /&gt;Answer:&lt;br /&gt;A smart pointer is an object that acts, looks and feels like a normal pointer but offers more functionality. In C++, smart pointers are implemented as template classes that encapsulate a pointer and override standard pointer operators. They have a number of advantages over regular pointers. They are guaranteed to be initialized as either null pointers or pointers to a heap object. Indirection through a null pointer is checked. No delete is ever necessary. Objects are automatically freed when the last pointer to them has gone away. One significant problem with these smart pointers is that unlike regular pointers, they don't respect inheritance. Smart pointers are unattractive for polymorphic code. Given below is an example for the implementation of smart pointers.&lt;br /&gt;Example:  &lt;br /&gt;   template &lt;class X&gt;&lt;br /&gt;   class smart_pointer&lt;br /&gt;   {&lt;br /&gt;              public:&lt;br /&gt;                   smart_pointer();                          // makes a null pointer&lt;br /&gt;                   smart_pointer(const X&amp; x)            // makes pointer to copy of x&lt;br /&gt;&lt;br /&gt;                   X&amp; operator *( );&lt;br /&gt;                   const X&amp; operator*( ) const;&lt;br /&gt;                   X* operator-&gt;() const;&lt;br /&gt;&lt;br /&gt;                   smart_pointer(const smart_pointer &lt;X&gt; &amp;);&lt;br /&gt;                   const smart_pointer &lt;X&gt; &amp; operator =(const smart_pointer&lt;X&gt;&amp;);&lt;br /&gt;                   ~smart_pointer();&lt;br /&gt;              private:&lt;br /&gt;                   //...&lt;br /&gt;    };&lt;br /&gt;This class implement a smart pointer to an object of type X. The object itself is located on the heap. Here is how to use it:&lt;br /&gt;            smart_pointer &lt;employee&gt; p= employee("Harris",1333);&lt;br /&gt;Like other overloaded operators, p will behave like a regular pointer,&lt;br /&gt;cout&lt;&lt;*p;&lt;br /&gt;p-&gt;raise_salary(0.5);&lt;br /&gt;&lt;br /&gt;36. What is reflexive association?&lt;br /&gt;Answer: &lt;br /&gt;The 'is-a' is called a reflexive association because the reflexive association permits classes to bear the is-a association not only with their super-classes but also with themselves. It differs from a 'specializes-from' as  'specializes-from' is usually used to describe the association between a super-class and a sub-class. For example:&lt;br /&gt;Printer is-a printer.&lt;br /&gt;&lt;br /&gt;37.  What is slicing?&lt;br /&gt;Answer:&lt;br /&gt;Slicing means that the data added by a subclass are discarded when an object of the subclass is passed or returned by value or from a function expecting a base class object.     &lt;br /&gt;Explanation:&lt;br /&gt;Consider the following class declaration:&lt;br /&gt;               class base&lt;br /&gt;              {&lt;br /&gt;                     ...&lt;br /&gt;                     base&amp; operator =(const base&amp;);&lt;br /&gt;                     base (const base&amp;);&lt;br /&gt;              }&lt;br /&gt;              void fun( )&lt;br /&gt;              {&lt;br /&gt;                    base e=m;&lt;br /&gt;                    e=m;&lt;br /&gt;              } &lt;br /&gt;As base copy functions don't know anything about the derived only the base part of the derived is copied. This is commonly referred to as slicing. One reason to pass objects of classes in a hierarchy is to avoid slicing. Other reasons are to preserve polymorphic behavior and to gain efficiency.&lt;br /&gt;&lt;br /&gt;38. What is name mangling?&lt;br /&gt;Answer:&lt;br /&gt;Name mangling is the process through which your c++ compilers give each function in your program a unique name. In C++, all programs have at-least a few functions with the same name. Name mangling is a concession to the fact that linker always insists on all function names being unique.&lt;br /&gt;Example:&lt;br /&gt;	In general, member names are made unique by concatenating the name of the member with that of the class e.g. given the declaration:&lt;br /&gt;    class Bar&lt;br /&gt;     {&lt;br /&gt;            public: &lt;br /&gt;                int ival;&lt;br /&gt;                ...&lt;br /&gt;      };&lt;br /&gt;ival becomes something like:&lt;br /&gt;      // a possible member name mangling&lt;br /&gt;     ival__3Bar&lt;br /&gt;Consider this derivation:&lt;br /&gt;     class Foo : public Bar &lt;br /&gt;    {  &lt;br /&gt;          public:&lt;br /&gt;              int ival;&lt;br /&gt;              ...&lt;br /&gt;    }&lt;br /&gt;The internal representation of a Foo object is the concatenation of its base and derived class members.&lt;br /&gt;     // Pseudo C++ code&lt;br /&gt;    // Internal representation of Foo&lt;br /&gt;    class Foo&lt;br /&gt;    {&lt;br /&gt;         public:&lt;br /&gt;             int ival__3Bar;&lt;br /&gt;             int ival__3Foo;&lt;br /&gt;             ...&lt;br /&gt;    };&lt;br /&gt;Unambiguous access of either ival members is achieved through name mangling. Member functions, because they can be overloaded, require an extensive mangling to provide each with a unique name. Here the compiler generates the same name for the two overloaded instances(Their argument lists make their instances unique).   &lt;br /&gt; &lt;br /&gt;39. What are proxy objects?&lt;br /&gt;Answer:&lt;br /&gt;Objects that points to other objects are called proxy objects or surrogates. Its an object that provides the same interface as its server object but does not have any functionality. During a method invocation, it routes data to the true server object and &lt;br /&gt;40. Differentiate between declaration and definition in C++.&lt;br /&gt;Answer:&lt;br /&gt;A declaration introduces a name into the program; a definition provides a unique description of an entity (e.g. type, instance, and function). Declarations can be repeated in a given scope, it introduces a name in a given scope. There must be exactly one definition of every object, function or class used in a C++ program. &lt;br /&gt;A declaration is a definition unless:&lt;br /&gt;	it declares a function without specifying its body,&lt;br /&gt;	it contains an extern specifier and no initializer or function body,&lt;br /&gt;	it is the declaration of a static class data member without a class definition,&lt;br /&gt;	it is a class name definition,&lt;br /&gt;	it is a typedef declaration.&lt;br /&gt;	A definition is a declaration unless:&lt;br /&gt;	it defines a static class data member,&lt;br /&gt;	it defines a non-inline member function.&lt;br /&gt;&lt;br /&gt;41. What is cloning?&lt;br /&gt;Answer:&lt;br /&gt;		An object can carry out copying in two ways i.e. it can set itself to be a copy of another object, or it can return a copy of itself. The latter process is called cloning.&lt;br /&gt;&lt;br /&gt;42. Describe the main characteristics of static functions.&lt;br /&gt;Answer:&lt;br /&gt;	The main characteristics of static functions include,&lt;br /&gt;	It is without the a this pointer,&lt;br /&gt;	It can't directly access the non-static members of its class&lt;br /&gt;	It can't be declared const, volatile or virtual.&lt;br /&gt;	It doesn't need to be invoked through an object of its class, although for convenience, it may.              &lt;br /&gt;&lt;br /&gt;43. Will the inline function be compiled as the inline function always? Justify.&lt;br /&gt;Answer:&lt;br /&gt;	An inline function is a request and not a command. Hence it won't be compiled as an inline function always.&lt;br /&gt;Explanation:&lt;br /&gt;	Inline-expansion could fail if the inline function contains loops, the address of an inline function is used, or an inline function is called in a complex expression. The rules for inlining are compiler dependent.&lt;br /&gt;&lt;br /&gt;44. Define a way other than using the keyword inline to make a function inline.&lt;br /&gt;Answer:&lt;br /&gt;	The function must be defined inside the class.   &lt;br /&gt;&lt;br /&gt;45. How can a '::' operator be used as unary operator?&lt;br /&gt;Answer:&lt;br /&gt;	The scope operator can be used to refer to members of the global namespace. Because the global namespace doesn’t have a name, the notation :: member-name refers to a member of the global namespace. This can be useful for referring to members of global namespace whose names have been hidden by names declared in nested local scope. Unless we specify to the compiler in which namespace to search for a declaration, the compiler simple searches the current scope, and any scopes in which the current scope is nested, to find the declaration for the name.&lt;br /&gt;&lt;br /&gt;46. What is placement new?&lt;br /&gt;Answer:&lt;br /&gt;	When you want to call a constructor directly, you use the placement new. Sometimes you have some raw memory that's already been allocated, and you need to construct an object in the memory you have. Operator new's special version placement new allows you to do it.&lt;br /&gt;           class Widget&lt;br /&gt;          {&lt;br /&gt;               public :&lt;br /&gt;                     Widget(int widgetsize);&lt;br /&gt;                      ...&lt;br /&gt;                      Widget* Construct_widget_int_buffer(void *buffer,int widgetsize)&lt;br /&gt;                       {&lt;br /&gt;                              return new(buffer) Widget(widgetsize);&lt;br /&gt;                       }&lt;br /&gt;          };&lt;br /&gt;	This function returns a pointer to a Widget object that's constructed within the buffer passed to the function. Such a function might be useful for applications using shared memory or memory-mapped I/O, because objects in such applications must be placed at specific addresses or in memory allocated by special routines.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OOAD&lt;br /&gt;&lt;br /&gt;1.	What do you mean by analysis and design?&lt;br /&gt;Analysis:&lt;br /&gt;Basically, it is the process of determining what needs to be done before how it should be done. In order to accomplish this, the developer refers the existing systems and documents. So, simply it is an art of discovery.&lt;br /&gt;     Design:&lt;br /&gt;It is the process of adopting/choosing the one among the many, which best accomplishes the users needs. So, simply, it is compromising mechanism.&lt;br /&gt;&lt;br /&gt;2.	What are the steps involved in designing?&lt;br /&gt;Before getting into the design the designer should go through the SRS prepared by the System Analyst.&lt;br /&gt;	The main tasks of design are Architectural Design and Detailed Design.&lt;br /&gt;	In Architectural Design we find what are the main modules in the problem domain.&lt;br /&gt;In Detailed Design we find what should be done within each module.&lt;br /&gt;&lt;br /&gt;3.	What are the main underlying concepts of object orientation?&lt;br /&gt;        	Objects, messages, class, inheritance and polymorphism are the main concepts of object orientation.&lt;br /&gt;&lt;br /&gt;4.	What do u meant by "SBI" of an object?&lt;br /&gt;SBI stands for State, Behavior and Identity. Since every object has the above three.&lt;br /&gt;	State:	&lt;br /&gt;It is just a value to the attribute of an object at a particular time.&lt;br /&gt;	Behaviour:	&lt;br /&gt;It describes the actions and their reactions of that object.&lt;br /&gt;	Identity: &lt;br /&gt;An object has an identity that characterizes its own existence. The identity makes it possible to distinguish any object in an unambiguous way, and independently from its state.&lt;br /&gt;&lt;br /&gt;5.	Differentiate persistent &amp; non-persistent objects?&lt;br /&gt;Persistent refers to an object's ability to transcend time or space. A persistent object stores/saves its state in a permanent storage system with out losing the information represented by the object. &lt;br /&gt;A non-persistent object is said to be transient or ephemeral. By default objects are considered as non-persistent.&lt;br /&gt;&lt;br /&gt;6.	What do you meant by active and passive objects?&lt;br /&gt;Active objects are one which instigate an interaction which owns a thread and they are responsible for handling control to other objects. In simple words it can be referred as client.&lt;br /&gt;Passive objects are one, which passively waits for the message to be processed. It waits for another object that requires its services. In simple words it can be referred as server. &lt;br /&gt;&lt;br /&gt;Diagram:&lt;br /&gt;		client     server&lt;br /&gt;            (Active)    (Passive)&lt;br /&gt;&lt;br /&gt;7.	What is meant by software development method?&lt;br /&gt;Software development method describes how to model and build software systems in a reliable and reproducible way. To put it simple, methods that are used to represent ones' thinking using graphical notations. &lt;br /&gt;&lt;br /&gt;8.	What are models and meta models?&lt;br /&gt;Model:&lt;br /&gt;It is a complete description of something (i.e. system).&lt;br /&gt;Meta model:&lt;br /&gt;It describes the model elements, syntax and semantics of the notation that allows their manipulation.&lt;br /&gt;&lt;br /&gt;9.	What do you meant by static and dynamic modeling?&lt;br /&gt;Static modeling is used to specify structure of the objects that exist in the problem domain. These are expressed using class, object and USECASE diagrams.&lt;br /&gt;  	But Dynamic modeling refers representing the object interactions during runtime. It is represented by sequence, activity, collaboration and statechart diagrams.&lt;br /&gt;&lt;br /&gt;10.	How to represent the interaction between the modeling elements?&lt;br /&gt;	  Model element is just a notation to represent (Graphically) the entities that exist in the problem domain. e.g. for modeling element is class notation, object notation etc.&lt;br /&gt;	  Relationships are used to represent the interaction between the modeling elements.&lt;br /&gt;	  The following are the Relationships.&lt;br /&gt;&lt;br /&gt;	Association: Its' just a semantic connection two classes.&lt;br /&gt;e.g.: &lt;br /&gt;					&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	Aggregation: Its' the relationship between two classes which are related in the fashion that master and slave. The master takes full rights than the slave. Since the slave works under the master. It is represented as line with diamond in the master area.&lt;br /&gt;        ex:&lt;br /&gt;           car contains wheels, etc.&lt;br /&gt;	   &lt;br /&gt;  			car       &lt;br /&gt;&lt;br /&gt;	Containment: This relationship is applied when the part contained with in the whole part, dies when the whole part dies.&lt;br /&gt;	  It is represented as darked diamond at the whole part.&lt;br /&gt;	  example: &lt;br /&gt; 		class A{&lt;br /&gt;               //some code&lt;br /&gt;		      };&lt;br /&gt;&lt;br /&gt;	      class B&lt;br /&gt;                 {&lt;br /&gt;             		A aa; // an object of class A;&lt;br /&gt;            		// some code for class B;&lt;br /&gt; 		     };&lt;br /&gt;	  In the above example we see that an object of class A is instantiated with in the class  B. so the object class A dies when the object class B dies.we can represnt it in         	  diagram like this.&lt;br /&gt;				&lt;br /&gt;		&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	Generalization: This relationship used when we want represents a class, which captures the common states of objects of different classes. It is represented as arrow line pointed at the class, which has captured the common states.&lt;br /&gt;	&lt;br /&gt;		   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; 					&lt;br /&gt;			&lt;br /&gt;	  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	Dependency: It is the relationship between dependent and independent classes. Any change in the independent class will affect the states of the dependent class.&lt;br /&gt;	   DIAGRAM:&lt;br /&gt;			class A     class B&lt;br /&gt;&lt;br /&gt;11.	Why generalization is very strong?&lt;br /&gt;	 Even though Generalization satisfies Structural, Interface, Behaviour properties. It is mathematically very strong, as it is Antisymmetric and Transitive.&lt;br /&gt;            Antisymmetric: employee is a person, but not all persons are employees. Mathematically all As’ are B, but all Bs’ not A.&lt;br /&gt;      	 Transitive: A=&gt;B, B=&gt;c then A=&gt;c.&lt;br /&gt;              A. Salesman.&lt;br /&gt;		  B. Employee. 	&lt;br /&gt;		  C. Person.&lt;br /&gt;    	 Note: All the other relationships satisfy all the properties like Structural properties, Interface properties, Behaviour properties.&lt;br /&gt;&lt;br /&gt;12.	Differentiate Aggregation and containment?&lt;br /&gt;	Aggregation is the relationship between the whole and a part. We can add/subtract some 	properties in the part (slave) side. It won't affect the whole part.&lt;br /&gt;	Best example is Car, which contains the wheels and some extra parts. Even though the parts are not there we can call it as car.&lt;br /&gt;	But, in the case of containment the whole part is affected when the part within that got affected. The human body is an apt example for this relationship. When the whole body dies the parts (heart etc) are died.&lt;br /&gt;&lt;br /&gt;13.	Can link and Association applied interchangeably?&lt;br /&gt;	No, You cannot apply the link and Association interchangeably. Since link is used represent the relationship between the two objects.&lt;br /&gt;	But Association is used represent the relationship between the two classes.&lt;br /&gt;	link ::       	 student:Abhilash         course:MCA&lt;br /&gt;	Association::  	  student                  course&lt;br /&gt;		&lt;br /&gt;14.	what is meant by "method-wars"?&lt;br /&gt;      	Before 1994 there were different methodologies like Rumbaugh, Booch, Jacobson, Meyer etc who followed their own notations to model the systems. The developers were in a dilemma to choose the method which best accomplishes their needs.     This particular span was called as "method-wars"&lt;br /&gt;&lt;br /&gt;15.	Whether unified method and unified modeling language are same or different?&lt;br /&gt;      Unified method is convergence of the Rumbaugh and Booch.&lt;br /&gt;      Unified modeling lang. is the fusion of Rumbaugh, Booch and Jacobson as well as Betrand Meyer (whose contribution is "sequence diagram"). Its' the superset of all the methodologies.&lt;br /&gt;&lt;br /&gt;16.	Who were the three famous amigos and what was their contribution  to the object community?&lt;br /&gt;      	The Three amigos namely,&lt;br /&gt;	James Rumbaugh (OMT): A veteran in analysis who came up with an idea about the 	objects and their Relationships (in particular Associations).&lt;br /&gt;	Grady Booch: A veteran in design who came up with an idea about partitioning of systems into subsystems.&lt;br /&gt;      &lt;br /&gt;	Ivar Jacobson (Objectory): The father of USECASES, who described about the user and system interaction.&lt;br /&gt;&lt;br /&gt;17.	Differentiate the class representation of Booch, Rumbaugh and UML?&lt;br /&gt;      	If you look at the class representaiton of Rumbaugh and UML, It is some what similar and both are very easy to draw.&lt;br /&gt;      Representation:   OMT  						UML.&lt;br /&gt;      Diagram:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;	Booch: In this method classes are represented as "Clouds" which are not very easy to draw as for as the developer's view is concern.&lt;br /&gt;      Diagram:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;18.	What is an USECASE? Why it is needed?&lt;br /&gt;	A Use Case is a description of a set of sequence of actions that a system performs that yields an observable result of value to a particular action.&lt;br /&gt;In SSAD process &lt;=&gt; In OOAD USECASE. It is represented elliptically.&lt;br /&gt;	Representation: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;19.	Who is an Actor?&lt;br /&gt;	An Actor is someone or something that must interact with the system.In addition to that 	an Actor initiates the process(that is USECASE).&lt;br /&gt;	It is represented as a stickman like this.&lt;br /&gt;	Diagram:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;20.	What is guard condition?&lt;br /&gt;	Guard condition is one, which acts as a firewall. The access from a particular object can be made only when the particular condition is met.&lt;br /&gt;	For Example,&lt;br /&gt;  		customer      check customer number   ATM.&lt;br /&gt;Here the object on the customer accesses the ATM facility only when the guard condition is met.&lt;br /&gt;&lt;br /&gt;21.	Differentiate the following notations?&lt;br /&gt;     		I:	:obj1               :obj2&lt;br /&gt;     &lt;br /&gt;		II:	:obj1               :obj2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	In the above representation I, obj1 sends message to obj2. But in the case of II the data is transferred from obj1 to obj2.&lt;br /&gt;&lt;br /&gt;22.	USECASE is an implementation independent notation. How will the designer give the implementation details of a particular USECASE to the programmer?&lt;br /&gt;This can be accomplished by specifying the relationship called "refinement” which 	talks about the two different abstraction of the same thing.&lt;br /&gt;	Or example,&lt;br /&gt;	&lt;br /&gt;	calculate pay		  calculate&lt;br /&gt;				&lt;br /&gt;				class1   class2 	class3&lt;br /&gt;	&lt;br /&gt;23.	Suppose a class acts an Actor in the problem domain, how to represent it in the static model?&lt;br /&gt;	In this scenario you can use “stereotype”. Since stereotype is just a string that gives extra semantic to the particular entity/model element. It is given with in the &lt;&lt;  &gt;&gt;.&lt;br /&gt;&lt;br /&gt;		class A&lt;br /&gt;		&lt;&lt; Actor&gt;&gt;&lt;br /&gt;		attributes&lt;br /&gt;	&lt;br /&gt;		methods.&lt;br /&gt;&lt;br /&gt;24.	Why does the function arguments are called as "signatures"?&lt;br /&gt;	The arguments distinguish functions with the same name (functional polymorphism). The name alone does not necessarily identify a unique function.  However, the name and its arguments (signatures) will uniquely identify a function.&lt;br /&gt;	In real life we see suppose, in class there are two guys with same name, but they can be 	easily identified by their signatures. The same concept is applied here.&lt;br /&gt;	ex:&lt;br /&gt;		class person&lt;br /&gt;		{&lt;br /&gt;	      public:&lt;br /&gt;			char getsex();&lt;br /&gt;			void setsex(char);&lt;br /&gt;			void setsex(int);&lt;br /&gt;		};&lt;br /&gt;	In the above example we see that there is a function setsex() with same name but with different signature.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Quantitative Aptitude&lt;br /&gt;Exercise 1&lt;br /&gt;Solve the following and check with the answers given at the end.&lt;br /&gt;&lt;br /&gt;1.	It was calculated that 75 men could complete a piece of work in 20 days. When work was scheduled to commence, it was found necessary to send 25 men to another project. How much longer will it take to complete the work?&lt;br /&gt;&lt;br /&gt;2.	A student divided a number by 2/3 when he required to multiply by 3/2. Calculate the percentage of error in his result.&lt;br /&gt;&lt;br /&gt;3.	A dishonest shopkeeper professes to sell pulses at the cost price, but he uses a false weight of 950gm. for a kg. His gain is …%.&lt;br /&gt;&lt;br /&gt;4.	A software engineer has the capability of thinking 100 lines of code in five minutes and can type 100 lines of code in 10 minutes. He takes a break for five minutes after every ten minutes. How many lines of codes will he complete typing after an hour?&lt;br /&gt;&lt;br /&gt;5.	A man was engaged on a job for 30 days on the condition that he would get a wage of Rs. 10 for the day he works, but he have to pay a fine of Rs. 2 for each day of his absence. If he gets Rs. 216 at the end, he was absent for work for ... days.&lt;br /&gt;&lt;br /&gt;6.	A contractor agreeing to finish a work in 150 days, employed 75 men each working 8 hours daily. After 90 days, only 2/7 of the work was completed. Increasing the number of men by¬¬ ________ each working now for 10 hours daily, the work can be completed in time.&lt;br /&gt;&lt;br /&gt;7.	what is a percent of b divided by b percent of a?&lt;br /&gt;		(a) 	a	(b)	b	(c)	1	(d)	10	(d)	100&lt;br /&gt;&lt;br /&gt;8.	A man bought a horse and a cart. If he sold the horse at 10 % loss and the cart at 20 % gain, he would not lose anything; but if he sold the horse at 5% loss and the cart at 5% gain, he would lose Rs. 10 in the bargain. The amount paid by him was Rs.¬¬¬¬_______ for the horse and Rs.________ for the cart.&lt;br /&gt;&lt;br /&gt;9.	A tennis marker is trying to put together a team of four players for a tennis tournament out of seven available. males - a, b and c; females – m, n, o and p. All players are of equal ability and there must be at least two males in the team. For a team of four, all players must be able to play with each other under the following restrictions:&lt;br /&gt;		b should not play with m,&lt;br /&gt;		c should not play with p, and&lt;br /&gt;		a should not play with o.&lt;br /&gt;	Which of the following statements must be false?&lt;br /&gt;1.	b and p cannot be selected together&lt;br /&gt;2.	c and o cannot be selected together&lt;br /&gt;3.	c and n cannot be selected together.&lt;br /&gt;&lt;br /&gt;10-12.	The following figure depicts three views of a cube. Based on this, answer questions 10-12.&lt;br /&gt;			&lt;br /&gt;6		       5			     4	&lt;br /&gt;&lt;br /&gt;				   1    		22      3		        6				&lt;br /&gt;		&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10.	The number on the face opposite to the face carrying 1 is ¬¬¬¬_______ .&lt;br /&gt;&lt;br /&gt;11.	The number on the faces adjacent to the face marked 5 are ¬¬_______ .&lt;br /&gt;&lt;br /&gt;12.	Which of the following pairs does not correctly give the numbers on the opposite faces.&lt;br /&gt;	(1)	6,5	(2)	4,1	(3)	1,3	(4)	4,2&lt;br /&gt;&lt;br /&gt;13.	Five farmers have 7, 9, 11, 13 &amp; 14 apple trees, respectively in their orchards. Last year, each of them discovered that every tree in their own orchard bore exactly the same number of apples. Further, if the third farmer gives one apple to the first, and the fifth gives three to each of the second and the fourth, they would all have exactly the same number of apples. What were the yields per tree in the orchards of the third and fourth farmers?&lt;br /&gt;&lt;br /&gt;14.	Five boys were climbing a hill. J was following H. R was just ahead of G. K was between G &amp; H. They were climbing up in a column. Who was the second?&lt;br /&gt;&lt;br /&gt;15-18	John is undecided which of the four novels to buy. He is considering a spy &lt;br /&gt;thriller, a Murder mystery, a Gothic romance and a science fiction novel. The books are written by Rothko, Gorky, Burchfield and Hopper, not necessary in that order, and published by Heron, Piegon, Blueja and sparrow, not necessary in that order.&lt;br /&gt;	(1) The book by Rothko is published by Sparrow.&lt;br /&gt;	(2) The Spy thriller is published by Heron.&lt;br /&gt;(3) The science fiction novel is by Burchfield and is not published by Blueja.&lt;br /&gt;	(4)The Gothic romance is by Hopper.&lt;br /&gt;	&lt;br /&gt;15.	Pigeon publishes ____________.&lt;br /&gt;&lt;br /&gt;16.	The novel by Gorky ________________.&lt;br /&gt;&lt;br /&gt;17.	John ¬purchases books by the authors whose names come first and third in alphabetical order. He does not buy the books ¬¬______.&lt;br /&gt;&lt;br /&gt;18.	On the basis of the first paragraph and statement (2), (3) and (4) only, it is possible to deduce that&lt;br /&gt;1.	Rothko wrote the murder mystery or the spy thriller&lt;br /&gt;2.	Sparrow published the murder mystery or the spy thriller&lt;br /&gt;3.	The book by Burchfield is published by Sparrow. &lt;br /&gt;&lt;br /&gt;19. 	If a light flashes every 6 seconds, how many times will it flash in ¾ of an hour?&lt;br /&gt;&lt;br /&gt;20.	If point P is on line segment AB, then which of the following is always true?&lt;br /&gt;	(1) AP = PB   (2) AP &gt; PB  (3) PB &gt; AP  (4) AB &gt; AP  (5) AB &gt; AP + PB&lt;br /&gt;&lt;br /&gt;21.	All men are vertebrates. Some mammals are vertebrates. Which of the following conclusions drawn from the above statement is correct.&lt;br /&gt;All men are mammals&lt;br /&gt;All mammals are men&lt;br /&gt;Some vertebrates are mammals.&lt;br /&gt;None&lt;br /&gt;&lt;br /&gt;22.	Which of the following statements drawn from the given statements are correct?&lt;br /&gt;	Given:&lt;br /&gt;All watches sold in that shop are of high standard. Some of the HMT watches are sold in that shop.&lt;br /&gt;a)	All watches of high standard were manufactured by HMT.&lt;br /&gt;b)	Some of the HMT watches are of high standard.&lt;br /&gt;c)	None of the HMT watches is of high standard.&lt;br /&gt;d)	Some of the HMT watches of high standard are sold in that shop.&lt;br /&gt;&lt;br /&gt;23-27.&lt;br /&gt;1.	Ashland is north of East Liverpool and west of Coshocton.&lt;br /&gt;2.	Bowling green is north of Ashland and west of Fredericktown.&lt;br /&gt;3.	Dover is south and east of Ashland.&lt;br /&gt;4.	East Liverpool is north of Fredericktown and east of Dover.&lt;br /&gt;5.	Fredericktown is north of Dover and west of Ashland.&lt;br /&gt;6.	Coshocton is south of Fredericktown and west of Dover.&lt;br /&gt;&lt;br /&gt;23.	Which of the towns mentioned is furthest of the north – west&lt;br /&gt;	(a) Ashland 		(b) Bowling green		(c) Coshocton	&lt;br /&gt;(d) East Liverpool	(e) Fredericktown&lt;br /&gt;&lt;br /&gt;24.	Which of the following must be both north and east of Fredericktown?&lt;br /&gt;	(a) Ashland		(b) Coshocton		(c) East Liverpool&lt;br /&gt;	I a only		II b only	III c only	IV a &amp; b	V a &amp; c&lt;br /&gt;&lt;br /&gt;25.	Which of the following towns must be situated both south and west of at least one other town?&lt;br /&gt;A.	Ashland only&lt;br /&gt;B.	Ashland and Fredericktown&lt;br /&gt;C.	Dover and Fredericktown&lt;br /&gt;D.	Dover, Coshocton and Fredericktown&lt;br /&gt;E.	Coshocton, Dover and East Liverpool.&lt;br /&gt;&lt;br /&gt;26.	Which of the following statements, if true, would make the information in the numbered statements more specific?&lt;br /&gt;(a)	Coshocton is north of Dover.&lt;br /&gt;(b)	East Liverpool is north of Dover&lt;br /&gt;(c)	Ashland is east of Bowling green.&lt;br /&gt;(d)	Coshocton is east of Fredericktown&lt;br /&gt;(e)	Bowling green is north of Fredericktown&lt;br /&gt;&lt;br /&gt;27.	Which of the numbered statements gives information that can be deduced from one or more of the other statements?&lt;br /&gt;	(A) 1		(B) 2		(C) 3		(D) 4		(E) 6	&lt;br /&gt;&lt;br /&gt;28.	Eight friends Harsha, Fakis, Balaji, Eswar, Dhinesh, Chandra, Geetha, and Ahmed are sitting in a circle facing the center. Balaji is sitting between Geetha and Dhinesh. Harsha is third to the left of Balaji and second to the right of Ahmed. Chandra is sitting between Ahmed and Geetha and Balaji and Eshwar are not sitting opposite to each other. Who is third to the left of Dhinesh?&lt;br /&gt;&lt;br /&gt;29.	If every alternative letter starting from B of the English alphabet is written in small letter, rest all are written in capital letters, how the month  “ September” be written. &lt;br /&gt;	(1)	SeptEMbEr	(2)	SEpTeMBEr	(3)	SeptembeR	&lt;br /&gt;(4)	SepteMber 	(5)	None of the above.&lt;br /&gt;&lt;br /&gt;30.	The length of the side of a square is represented by x+2. The length of the side of an equilateral triangle is 2x. If the square and the equilateral triangle have equal perimeter, then the value of x is _______.&lt;br /&gt;&lt;br /&gt;31.	It takes Mr. Karthik y hours to complete typing a manuscript. After 2 hours, he was called away. What fractional part of the assignment was left incomplete?&lt;br /&gt;&lt;br /&gt;32.	Which of the following is larger than 3/5?&lt;br /&gt;	(1) 	½	(2)	39/50	(3)	7/25	(4)	3/10	(5)	59/100&lt;br /&gt;&lt;br /&gt;33.	The number that does not have a reciprocal is ¬¬¬____________.&lt;br /&gt;&lt;br /&gt;34.	There are 3 persons Sudhir, Arvind, and Gauri. Sudhir lent cars to Arvind and Gauri as many as they had already. After some time Arvind gave as many cars to Sudhir and Gauri as many as they have. After sometime Gauri did the same thing. At the end of this transaction each one of them had 24. Find the cars each originally had.&lt;br /&gt;&lt;br /&gt;35.	A man bought a horse and a cart. If he sold the horse at 10 % loss and the cart at 20 % gain, he would not lose anything; but if he sold the horse at 5% loss and the cart at 5% gain, he would lose Rs. 10 in the bargain. The amount paid by him was Rs.¬¬¬¬_______ for the horse and Rs.________ for the cart.&lt;br /&gt;&lt;br /&gt;Answers:&lt;br /&gt;&lt;br /&gt;1.	Answer: &lt;br /&gt;30 days.&lt;br /&gt;	Explanation:&lt;br /&gt;	Before:&lt;br /&gt;	One day work			= 	1 / 20&lt;br /&gt;	One man’s one day work	= 	1 / ( 20 * 75)&lt;br /&gt;Now:&lt;br /&gt;		No. Of workers		= 	50  &lt;br /&gt;		One day work			= 	50 * 1 /  ( 20 * 75)&lt;br /&gt;&lt;br /&gt;		The total no. of days required to complete the work = (75 * 20) / 50  = 30&lt;br /&gt;&lt;br /&gt;2.	Answer:&lt;br /&gt; 0 %&lt;br /&gt;	Explanation:&lt;br /&gt;	Since 3x / 2  = x / (2 / 3)&lt;br /&gt;&lt;br /&gt;3.	Answer: &lt;br /&gt;5.3 %&lt;br /&gt;	Explanation:&lt;br /&gt;		He sells 950 grams of pulses and gains 50 grams.&lt;br /&gt;	If he sells 100 grams of pulses then he will gain (50 / 950) *100  =  5.26&lt;br /&gt;&lt;br /&gt;4.	Answer: &lt;br /&gt;250 lines of codes&lt;br /&gt;&lt;br /&gt;5.	Answer: &lt;br /&gt;7 days&lt;br /&gt;Explanation:&lt;br /&gt;The equation portraying the given problem is:&lt;br /&gt;		 10 *  x – 2 * (30 – x) =  216	where x is the number of working days.&lt;br /&gt;	Solving this we get x = 23&lt;br /&gt;	Number of days he was absent was 7 (30-23) days.&lt;br /&gt;&lt;br /&gt;6.	Answer: &lt;br /&gt;150 men.&lt;br /&gt;Explanation:&lt;br /&gt;	One day’s work 		=	2 / (7 * 90)&lt;br /&gt;	One hour’s work		=	2 / (7 * 90 * 8)&lt;br /&gt;	One man’s work		=	2 / (7 * 90 * 8 * 75)&lt;br /&gt;&lt;br /&gt;The remaining work (5/7) has to be completed within 60 days, because the total number of days allotted for the project is 150 days.&lt;br /&gt;&lt;br /&gt;	So we get the equation&lt;br /&gt;		&lt;br /&gt;		(2 * 10 * x * 60) / (7 * 90 *  8 * 75)	=  5/7  where x is the number of men working after the 90th day.&lt;br /&gt;&lt;br /&gt;	We get x = 225&lt;br /&gt;	Since we have 75 men already, it is enough to add only 150 men.&lt;br /&gt;&lt;br /&gt;7.	Answer: &lt;br /&gt;(c) 1&lt;br /&gt;Explanation: &lt;br /&gt;	a percent of b : (a/100) * b&lt;br /&gt;	b percent of a : (b/100) * a&lt;br /&gt;	a percent of b divided by b percent of a : ((a / 100 )*b) /  (b/100) * a )) = 1&lt;br /&gt;&lt;br /&gt;8.	Answer:&lt;br /&gt;Cost price of horse =  Rs. 400 &amp; the cost price of cart = 200.&lt;br /&gt;Explanation:-&lt;br /&gt;	Let x be the cost price of the horse and y be the cost price of the cart.&lt;br /&gt;	In the first sale there is no loss or profit. (i.e.) The loss obtained is equal to the gain.&lt;br /&gt;&lt;br /&gt;		Therefore	(10/100) * x 	=  (20/100) * y&lt;br /&gt;&lt;br /&gt;					X	=  2 * y     -----------------(1)&lt;br /&gt;	In the second sale, he lost Rs. 10. (i.e.) The loss is greater than the profit by Rs. 10.&lt;br /&gt;&lt;br /&gt;		Therefore	(5 / 100) * x 	=  (5 / 100) * y + 10 -------(2)&lt;br /&gt;		Substituting (1) in (2) we get&lt;br /&gt;			(10 / 100) * y 	=  (5 / 100) * y + 10&lt;br /&gt;			(5 / 100) * y 	=  10&lt;br /&gt;			y = 200	&lt;br /&gt;From (1) 2 * 200 = x = 400&lt;br /&gt;&lt;br /&gt;9.	Answer:&lt;br /&gt; 3.&lt;br /&gt;	Explanation:&lt;br /&gt;	Since inclusion of any male player will reject a female from the team. Since there should be four member in the team and only three males are available, the girl, n should included in the team always irrespective of others selection. &lt;br /&gt;&lt;br /&gt;10.	Answer: &lt;br /&gt;5&lt;br /&gt;&lt;br /&gt;11.	Answer: &lt;br /&gt;1,2,3 &amp; 4&lt;br /&gt;&lt;br /&gt;12.	Answer: &lt;br /&gt;B&lt;br /&gt;&lt;br /&gt;13.	Answer:&lt;br /&gt;11 &amp; 9 apples per tree.&lt;br /&gt;	Explanation:&lt;br /&gt;	Let a, b, c, d &amp; e be the total number of apples bored per year in A, B, C, D &amp; E ‘s orchard. Given that 	a + 1 = b + 3 = c – 1 = d + 3 = e – 6  &lt;br /&gt;But the question is to find the number of apples bored per tree in C and D ‘s orchard. If is enough to consider c – 1 = d + 3.&lt;br /&gt;	Since the number of trees in C’s orchard is 11 and that of D’s orchard is 13. Let x and y be the number of apples bored per tree in C &amp; d ‘s orchard respectively.&lt;br /&gt;	Therefore 11 x – 1 = 13 y + 3&lt;br /&gt;By trial and error method, we get the value for x and y as 11 and 9&lt;br /&gt;	&lt;br /&gt;14.	Answer: &lt;br /&gt;G.&lt;br /&gt;	Explanation: &lt;br /&gt;	The order in which they are climbing is R – G – K – H – J     &lt;br /&gt;&lt;br /&gt;15 – 18&lt;br /&gt;Answer:&lt;br /&gt;		Novel Name		Author		Publisher&lt;br /&gt;		Spy thriller		Rathko		Heron&lt;br /&gt;		Murder mystery	Gorky		Piegon&lt;br /&gt;		Gothic romance	Burchfield	Blueja&lt;br /&gt;		Science fiction		Hopper		Sparrow&lt;br /&gt;&lt;br /&gt;	Explanation: &lt;br /&gt;	Given&lt;br /&gt;		Novel Name		Author		Publisher&lt;br /&gt;		Spy thriller		Rathko		Heron&lt;br /&gt;		Murder mystery	Gorky		Piegon&lt;br /&gt;		Gothic romance	Burchfield	Blueja&lt;br /&gt;		Science fiction		Hopper		Sparrow		&lt;br /&gt;&lt;br /&gt;Since Blueja doesn’t publish the novel by Burchfield and Heron publishes the novel spy thriller, Piegon publishes the novel by Burchfield.&lt;br /&gt;Since Hopper writes Gothic romance and Heron publishes the novel spy thriller, Blueja publishes the novel by Hopper.&lt;br /&gt;Since Heron publishes the novel spy thriller and Heron publishes the novel by Gorky, Gorky writes Spy thriller and Rathko writes Murder mystery. &lt;br /&gt;&lt;br /&gt;19.	Answer:  &lt;br /&gt;451 times.&lt;br /&gt;Explanation:&lt;br /&gt;There are 60 minutes in an hour.&lt;br /&gt;	In ¾ of an hour there are (60 * ¾) minutes  = 45 minutes.&lt;br /&gt;		In ¾ of an hour there are (60 * 45) seconds = 2700 seconds.&lt;br /&gt;	Light flashed for every 6 seconds.&lt;br /&gt;		In 2700 seconds 2700/6 = 450 times.&lt;br /&gt;The count start after the first flash, the light will flashes 451 times in ¾ of an hour.&lt;br /&gt;&lt;br /&gt;20.	Answer: &lt;br /&gt;(4)&lt;br /&gt;	Explanation: &lt;br /&gt;				P	&lt;br /&gt;		A					B	&lt;br /&gt;	Since p is a point on the line segment AB, AB &gt; AP&lt;br /&gt;	&lt;br /&gt;21.	Answer:  (c)&lt;br /&gt;	&lt;br /&gt;22.	Answer:  (b) &amp; (d).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;							Ahmed&lt;br /&gt;23 - 27.Answer: &lt;br /&gt;				Fakis				Chandra&lt;br /&gt;28.	Answer: Fakis				&lt;br /&gt;Explanation:		Harsha				   	Geetha&lt;br /&gt;	&lt;br /&gt;				Eswar				Balaji	&lt;br /&gt;&lt;br /&gt;						&lt;br /&gt;Dhinesh&lt;br /&gt;&lt;br /&gt;29.	Answer: &lt;br /&gt;(5).&lt;br /&gt;Explanation: &lt;br /&gt;	Since every alternative letter starting from B of the English alphabet is written in small letter, the letters written in small letter are b, d, f...&lt;br /&gt;	In the first two answers the letter E is written in both small &amp; capital letters, so they are not the correct answers. But in third and fourth answers the letter is written in small letter instead capital letter, so they are not the answers.&lt;br /&gt; &lt;br /&gt;30.	Answer: &lt;br /&gt;x = 4&lt;br /&gt;Explanation: &lt;br /&gt;Since the side of the square is x + 2, its perimeter = 4 (x + 2) = 4x + 8&lt;br /&gt;Since the side of the equilateral triangle is 2x, its perimeter = 3 * 2x = 6x&lt;br /&gt;Also, the perimeters of both are equal.&lt;br /&gt;	(i.e.)	4x + 8 = 6x  &lt;br /&gt;	(i.e.) 	2x = 8  x = 4.&lt;br /&gt;&lt;br /&gt;31. 	Answer:&lt;br /&gt;	      (y – 2) / y.&lt;br /&gt;Explanation:  &lt;br /&gt;	To type a manuscript karthik took y hours.&lt;br /&gt;	Therefore his speed in typing  = 1/y.&lt;br /&gt;	He was called away after 2 hours of typing.&lt;br /&gt;	Therefore the work completed = 1/y * 2.&lt;br /&gt;	Therefore the remaining work to be completed = 1 – 2/y. &lt;br /&gt;	(i.e.) work to be completed  = (y-2)/y&lt;br /&gt;&lt;br /&gt;32.	Answer:&lt;br /&gt;		(2)&lt;br /&gt;&lt;br /&gt;33.	Answer:	&lt;br /&gt;1&lt;br /&gt;	Explanation: &lt;br /&gt;One is the only number exists without reciprocal because the reciprocal of one is one itself.&lt;br /&gt;&lt;br /&gt;34.	Answer:	&lt;br /&gt;Sudhir had 39 cars, Arvind had 21 cars and Gauri had 12 cars.&lt;br /&gt;	Explanation: &lt;br /&gt;				Sudhir		        Arvind		        Gauri&lt;br /&gt;&lt;br /&gt;	Finally				24			24			24&lt;br /&gt;Before Gauri’s transaction     12			12			48&lt;br /&gt;	Before Arvind’s transaction	 6			42			24&lt;br /&gt;	Before Sudhir’ s transaction 	39			21			12&lt;br /&gt;&lt;br /&gt;35.	Answer: 	&lt;br /&gt;Cost price of horse:	Rs. 400 &amp; &lt;br /&gt;Cost price of cart:	Rs. 200&lt;br /&gt;	Explanation: &lt;br /&gt;		Let x be the cost of horse &amp; y be the cost of the cart.&lt;br /&gt;		10 % of loss in selling horse = 20 % of gain in selling the cart&lt;br /&gt;			Therefore	(10 / 100) * x = (20 * 100) * y&lt;br /&gt;	x = 2y -----------(1)&lt;br /&gt;5 % of loss in selling the horse is 10 more than the 5 % gain in selling the cart.&lt;br /&gt;	Therefore 	(5 / 100) * x - 10 = (5 / 100) * y&lt;br /&gt;			5x - 1000	= 	5y&lt;br /&gt;	Substituting (1)&lt;br /&gt;			10y - 1000 = 5y&lt;br /&gt;			5y = 1000&lt;br /&gt;			y = 200&lt;br /&gt;			x = 400 	from (1)	&lt;br /&gt;&lt;br /&gt;Exercise 2.1&lt;br /&gt;For the following, find the next term in the series &lt;br /&gt;&lt;br /&gt;1.  6, 24, 60,120, 210&lt;br /&gt;&lt;br /&gt;   a) 336	b) 366		c) 330		d) 660&lt;br /&gt;&lt;br /&gt;   Answer : a) 336&lt;br /&gt;   Explanation : The series is 1.2.3, 2.3.4, 3.4.5, 4.5.6, 5.6.7, .....          ( '.' means product)&lt;br /&gt;&lt;br /&gt;2.  1, 5, 13, 25&lt;br /&gt;&lt;br /&gt;  Answer : 41&lt;br /&gt;  Explanation : The series is of the form   0^2+1^2, 1^2+2^2,...&lt;br /&gt;&lt;br /&gt;3. 0, 5, 8, 17&lt;br /&gt;&lt;br /&gt;   Answer : 24&lt;br /&gt;   Explanation : 1^2-1, 2^2+1, 3^2-1, 4^2+1, 5^2-1&lt;br /&gt;&lt;br /&gt;4. 1, 8, 9, 64, 25    (Hint : Every successive terms are related)&lt;br /&gt;&lt;br /&gt;   Answer : 216&lt;br /&gt;   Explanation : 1^2, 2^3, 3^2, 4^3, 5^2, 6^3&lt;br /&gt;&lt;br /&gt;5. 8,24,12,36,18,54&lt;br /&gt;   &lt;br /&gt;   Answer : 27&lt;br /&gt;&lt;br /&gt;6. 71,76,69,74,67,72&lt;br /&gt;   Answer : 67  &lt;br /&gt;&lt;br /&gt;7. 5,9,16,29,54&lt;br /&gt;   Answer : 103&lt;br /&gt;   Explanation : 5*2-1=9; 9*2-2=16; 16*2-3=29; 29*2-4=54; 54*2-5=103&lt;br /&gt;&lt;br /&gt;8. 1,2,4,10,16,40,64 (Successive terms are related)&lt;br /&gt;   Answer : 200&lt;br /&gt;   Explanation : The series is powers of 2 (2^0,2^1,..).&lt;br /&gt;          All digits are less than 8.  Every second number is in octal number system. &lt;br /&gt;          128 should follow 64. 128 base 10 = 200 base 8.&lt;br /&gt;&lt;br /&gt;Exercise 2.2&lt;br /&gt;&lt;br /&gt;Find the odd man out.&lt;br /&gt;&lt;br /&gt;1. 3,5,7,12,13,17,19&lt;br /&gt;    Answer : 12 &lt;br /&gt;    Explanation : All but 12 are odd numbers&lt;br /&gt;&lt;br /&gt;2. 2,5,10,17,26,37,50,64&lt;br /&gt;   Answer : 64&lt;br /&gt;   Explanation : 2+3=5; 5+5=10; 10+7=17; 17+9=26; 26+11=37; 37+13=50; 50+15=65;&lt;br /&gt;&lt;br /&gt;3. 105,85,60,30,0,-45,-90&lt;br /&gt;    Answer : 0&lt;br /&gt;    Explanation : 105-20=85; 85-25=60; 60-30=30; 30-35=-5; -5-40=-45; -45-45=-90;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Exercise 3&lt;br /&gt;Solve the following.&lt;br /&gt;&lt;br /&gt;1. What is the number of zeros at the end of the product of the numbers from 1 to 100?&lt;br /&gt;	Answer : 127&lt;br /&gt;2. A fast typist can type some matter in 2 hours and a slow typist can type the same in 3 hours. If both type combinely, in how much time will they finish?&lt;br /&gt;	Answer : 1 hr 12 min&lt;br /&gt;	Explanation :    The fast typist's work done in 1 hr = 1/2&lt;br /&gt;		           The slow typist's work done in 1 hr = 1/3&lt;br /&gt;		           If they work combinely, work done in 1 hr = 1/2+1/3 = 5/6&lt;br /&gt;So, the work will be completed in 6/5 hours. i.e., 1+1/5 hours = 1hr 12 min&lt;br /&gt;&lt;br /&gt;3. Gavaskar's average in his first 50 innings was 50. After the 51st innings, his average was 51. How many runs did he score in his 51st innings. (supposing that he lost his wicket in his 51st innings)&lt;br /&gt;	Answer : 101&lt;br /&gt;	Explanation :	Total score after 50 innings = 50*50 = 2500&lt;br /&gt;		Total score after 51 innings = 51*51 = 2601&lt;br /&gt; 		So, runs made in the 51st innings = 2601-2500 = 101	&lt;br /&gt;		If he had not lost his wicket in his 51st innings, he would have scored an unbeaten 50 in his 51st innings.&lt;br /&gt;&lt;br /&gt;4. Out of 80 coins, one is counterfeit. What is the minimum number of weighings needed to find out the counterfeit coin?&lt;br /&gt;	Answer : 4&lt;br /&gt;&lt;br /&gt;5. What can you conclude from the statement : All green are blue, all blue are red. ?&lt;br /&gt;(i)	some blue are green&lt;br /&gt;(ii)	some red are green 	&lt;br /&gt;(iii)	some green are not red	&lt;br /&gt;(iv)	all red are blue&lt;br /&gt;(a)	i or ii but not both &lt;br /&gt;(b)	i &amp; ii only	&lt;br /&gt;(c)	iii or iv but not both	&lt;br /&gt;(d)	iii &amp; iv&lt;br /&gt;&lt;br /&gt;	Answer : (b)&lt;br /&gt;&lt;br /&gt;6. A rectangular plate with length 8 inches, breadth 11 inches and thickness 2 inches is available. What is the length of the circular rod with diameter 8 inches and equal to the volume of the rectangular plate?&lt;br /&gt;	Answer : 3.5 inches&lt;br /&gt;	Explanation : Volume of the circular rod (cylinder) = Volume of the rectangular plate&lt;br /&gt;		(22/7)*4*4*h = 8*11*2&lt;br /&gt;		h = 7/2 = 3.5&lt;br /&gt;&lt;br /&gt;7. What is the sum of all numbers between 100 and 1000 which are divisible by 14 ?&lt;br /&gt;	Answer : 35392&lt;br /&gt;	Explanation : The number closest to 100 which is greater than 100 and divisible by 14  is 112, which is the first term of the series which has to be summed.&lt;br /&gt;	          The number closest to 1000 which is less than 1000 and divisible by 14 is 994, which is the last term of the series.&lt;br /&gt;		112 + 126 + .... + 994 = 14(8+9+ ... + 71) = 35392&lt;br /&gt;&lt;br /&gt;8. If s(a) denotes square root of a, find the value of s(12+s(12+s(12+ ......	upto infinity.&lt;br /&gt;	Answer : 4&lt;br /&gt;	Explanation : Let x = s(12+s(12+s(12+.....&lt;br /&gt;          We can write  x = s(12+x). i.e., x^2 = 12 + x. Solving this quadratic equation, we get x = -3 or x=4. Sum cannot be -ve and hence sum = 4.&lt;br /&gt;&lt;br /&gt;9. A cylindrical container has a radius of eight inches with a height of three inches. Compute how many inches should be added to either the radius or height to give the same increase in volume?&lt;br /&gt;	Answer : 16/3 inches&lt;br /&gt;	Explanation : Let x be the amount of increase. The volume will increase by the same amount if the radius increased or the height is increased.&lt;br /&gt;So, the effect on increasing height is equal to the effect on increasing the radius.&lt;br /&gt;	i.e., (22/7)*8*8*(3+x) = (22/7)*(8+x)*(8+x)*3&lt;br /&gt;	Solving the quadratic equation we get the x = 0 or 16/3. The possible increase would be by 16/3 inches.&lt;br /&gt;&lt;br /&gt;10. With just six weights and a balance scale, you can weigh any unit number of kgs from 1 to 364. What could be the six weights?&lt;br /&gt;	Answer : 1, 3, 9, 27, 81, 243 (All powers of 3)	&lt;br /&gt;&lt;br /&gt;11. Diophantus passed one sixth of his life in childhood, one twelfth in youth, and one seventh more as a bachelor; five years after his marriage a son was born who died four years before his father at half his final age. How old is Diophantus?&lt;br /&gt;	Answer : 84 years&lt;br /&gt;	Explanation : x/6 + x/12 + x/7 + 5 + x/2 + 4 = x&lt;br /&gt;&lt;br /&gt;12 . If time at this moment is 9 P.M., what will be the time 23999999992 hours later?&lt;br /&gt;	Answer : 1 P.M.&lt;br /&gt;	Explanation : 24 billion hours later, it would be 9 P.M. and 8 hours before that it would be 1 P.M.&lt;br /&gt;&lt;br /&gt;13. How big will an angle of one and a half degree look through a glass that magnifies things three times?&lt;br /&gt;	Answer : 1 1/2 degrees&lt;br /&gt;	Explanation : The magnifying glass cannot increase the magnitude of an angle.&lt;br /&gt;&lt;br /&gt;14. Divide 45 into four parts such that when 2 is added to the first part, 2 is subtracted from the second part, 2 is multiplied by the third part and the fourth part is divided by two, all result in the same number.&lt;br /&gt;	Answer: 8, 12, 5, 20&lt;br /&gt;	Explanation: a + b + c + d =45;	a+2 = b-2 = 2c = d/2; 	a=b-4; c = (b-2)/2; d = 2(b-2);	b-4 + b + (b-2)/2 + 2(b-2) = 45;&lt;br /&gt;&lt;br /&gt;15. I drove 60 km at 30 kmph and then an additional 60 km at 50 kmph. Compute my average speed over my 120 km.&lt;br /&gt;	Answer : 37 1/2&lt;br /&gt;	Explanation : Time reqd for the first 60 km = 120 min.; Time reqd for the second 60 km = 72 min.; Total time reqd = 192 min&lt;br /&gt;		Avg speed = (60*120)/192 = 37 1/2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Questions 16 and 17 are based on the following :&lt;br /&gt;    Five executives of European Corporation hold a Conference in Rome&lt;br /&gt;      Mr. A converses in Spanish &amp; Italian&lt;br /&gt;      Mr. B, a spaniard, knows English also&lt;br /&gt;      Mr. C knows English and belongs to Italy&lt;br /&gt;      Mr. D converses in French and Spanish&lt;br /&gt;      Mr. E , a native of Italy knows French&lt;br /&gt;&lt;br /&gt;16.   Which of the following can act as interpreter if Mr. C &amp; Mr. D wish to converse&lt;br /&gt;   	a) only Mr. A	b) Only Mr. B	c) Mr. A &amp; Mr. B	d) Any of the other three&lt;br /&gt;&lt;br /&gt;	Answer : d) Any of the other three.&lt;br /&gt;	Explanation :  From the data given, we can infer the following.&lt;br /&gt;		A knows Spanish, Italian&lt;br /&gt;		B  knows Spanish, English&lt;br /&gt;		C  knows Italian, English&lt;br /&gt;		D  knows Spanish, French&lt;br /&gt;		E   knows Italian, French&lt;br /&gt;To act as an interpreter between C and D, a person has to know one of the combinations Italian&amp;Spanish, Italian&amp;French, English&amp;Spanish,	English&amp;French&lt;br /&gt;A, B, and E know atleast one of the combinations.&lt;br /&gt; &lt;br /&gt;17. If a 6th executive is brought in, to be understood by maximum number of original five he should be fluent in&lt;br /&gt;	a) English &amp; French	b) Italian &amp; Spanish	c) English &amp; French	d) French &amp; Italian&lt;br /&gt;	Answer :  b) Italian &amp; Spanish&lt;br /&gt;	Explanation : No of executives who know&lt;br /&gt;                             i) English is 2&lt;br /&gt;	                ii) Spanish is 3&lt;br /&gt;                            iii) Italian is 3&lt;br /&gt;                            iv) French is  2&lt;br /&gt;Italian &amp; Spanish are spoken by the maximum no of executives. So, if the 6th executive is fluent in Italian &amp; Spanish, he can communicate with all the original five because everybody knows either Spanish or Italian.	&lt;br /&gt;&lt;br /&gt;18.	What is the sum of the first 25 natural odd numbers?&lt;br /&gt;Answer : 625&lt;br /&gt;Explanation : The sum of the first n natural odd nos is square(n). &lt;br /&gt;1+3 = 4 = square(2) 1+3+5 = 9 = square(3)&lt;br /&gt;&lt;br /&gt;19.	The sum of any seven consecutive numbers is divisible by&lt;br /&gt;a)	2  b) 7  c) 3  d) 11&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Exercise 3&lt;br /&gt;Try the following.&lt;br /&gt;&lt;br /&gt;1.	There are seventy clerks working in a company, of which 30 are females. Also, 30 clerks are   married; 24 clerks are above 25 years of age; 19 married clerks are above 25 years, of which 7 are males; 12 males are above 25 years of age; and 15 males are married. How many bachelor girls are there and how many of these are above 25?&lt;br /&gt;&lt;br /&gt;2.	A man sailed off from the North Pole. After covering 2,000 miles in one direction he turned West, sailed 2,000 miles, turned North and sailed ahead another 2,000 miles till he met his friend. How far was he from the North Pole and in what direction?&lt;br /&gt;&lt;br /&gt;3.	Here is a series of comments on the ages of three persons J, R, S by themselves.&lt;br /&gt;      S : The difference between R's age and mine is three years.&lt;br /&gt;      J : R is the youngest.&lt;br /&gt;      R : Either I am 24 years old or J 25 or S 26.&lt;br /&gt;      J : All are above 24 years of age.&lt;br /&gt;      S : I am the eldest if and only if R is not the youngest.&lt;br /&gt;      R : S is elder to me.&lt;br /&gt;      J : I am the eldest.&lt;br /&gt;      R : S is not 27 years old.&lt;br /&gt;      S : The sum of my age and J's is two more than twice R's age.&lt;br /&gt;One of the three had been telling a lie throughout whereas others had spoken the truth. Determine the ages of S,J,R.&lt;br /&gt;&lt;br /&gt;4.	In a group of five people, what is the probability of finding two persons with the same month of birth?&lt;br /&gt;&lt;br /&gt;5.	A father and his son go out for a 'walk-and-run' every morning around a track formed by an equilateral triangle. The father's walking speed is 2 mph and his running speed is 5 mph. The son's walking and running speeds are twice that of his father. Both start together from one apex of the triangle, the son going clockwise and the father anti-clockwise. Initially the father runs and the son walks for a certain period of time.    Thereafter, as soon as the father starts walking, the son starts running. Both complete the course in 45 minutes. For how long does the father run? Where do the two cross each other?&lt;br /&gt;&lt;br /&gt;6.	The Director of Medical Services was on his annual visit to the ENT Hospital. While going through the out patients' records he came across the following data for a particular day :  " Ear consultations 45; Nose 50; Throat 70; Ear and Nose 30; Nose and Throat 20; Ear and Throat 30; Ear, Nose and Throat 10; Total patients 100." Then he came to the conclusion that the records were bogus. Was he right?&lt;br /&gt;&lt;br /&gt;7.	Amongst Ram, Sham and Gobind are a doctor, a lawyer and a police officer. They are married to Radha, Gita and Sita (not in order). Each of the wives have a profession. Gobind's wife is an artist. Ram is not married to Gita. The lawyer's wife is a teacher. Radha is married to the police officer. Sita is an expert cook. Who's who?&lt;br /&gt;&lt;br /&gt;8.	What should come next?&lt;br /&gt;1, 2, 4, 10, 16, 40, 64, &lt;br /&gt;&lt;br /&gt;	Questions 9-12 are based on the following :&lt;br /&gt;Three adults – Roberto, Sarah and Vicky – will be traveling in a van with five children – Freddy, Hillary, Jonathan, Lupe, and Marta. The van has a driver’s seat and one passenger seat in the front, and two benches behind the front seats, one beach behind the other. Each bench has room for exactly three people. Everyone must sit in a seat or on a bench, and seating is subject to the following restrictions: 	    An adult must sit on each bench.&lt;br /&gt;    Either Roberto or Sarah must sit in the driver’s seat.&lt;br /&gt;    Jonathan must sit immediately beside Marta.&lt;br /&gt;&lt;br /&gt;9.	Of the following, who can sit in the front passenger seat ?&lt;br /&gt;(a) Jonathan	(b) Lupe	(c) Roberto	(d) Sarah	(e) Vicky&lt;br /&gt;&lt;br /&gt;10.  Which of the following groups of three can sit together on a bench? &lt;br /&gt;(a) Freddy, Jonathan and Marta	(b) Freddy, Jonathan and Vicky&lt;br /&gt;(c) Freddy, Sarah and Vicky		(d) Hillary, Lupe and Sarah&lt;br /&gt;(e) Lupe, Marta and Roberto&lt;br /&gt;&lt;br /&gt;11.	If Freddy sits immediately beside Vicky, which of the following cannot be true ?&lt;br /&gt;a.	Jonathan sits immediately beside Sarah&lt;br /&gt;b.	Lupe sits immediately beside Vicky&lt;br /&gt;c.	Hillary sits in the front passenger seat&lt;br /&gt;d.	Freddy sits on the same bench as Hillary&lt;br /&gt;e.	Hillary sits on the same bench as Roberto&lt;br /&gt;&lt;br /&gt;12.	If Sarah sits on a bench that is behind where Jonathan is sitting, which of the following must be true ?&lt;br /&gt;a.	Hillary sits in a seat or on a bench that is in front of where Marta is sitting&lt;br /&gt;b.	Lupe sits in a seat or on a bench that is in front of where Freddy is sitting&lt;br /&gt;c.	Freddy sits on the same bench as Hillary&lt;br /&gt;d.	Lupe sits on the same bench as Sarah&lt;br /&gt;e.	Marta sits on the same bench as Vicky&lt;br /&gt;&lt;br /&gt;13.	Make six squares of the same size using twelve match-sticks. (Hint : You will need an adhesive to arrange the required figure)&lt;br /&gt;&lt;br /&gt;14.	A farmer has two rectangular fields. The larger field has twice the length and 4 times the width of the smaller field. If the smaller field has area K, then the are of the larger field is greater than the area of the smaller field by what amount?&lt;br /&gt;(a) 6K	(b) 8K	(c) 12K	(d) 7K&lt;br /&gt;&lt;br /&gt;15.	Nine equal circles are enclosed in a square whose area is 36sq units. Find the area of each circle.&lt;br /&gt;&lt;br /&gt;16.	There are 9 cards. Arrange them in a 3*3 matrix. Cards are of 4 colors. They are red, yellow, blue, green. Conditions for arrangement: one red card must be in first row or second row. 2 green cards should be in 3rd column. Yellow cards must be in the 3 corners only. Two blue cards must be in the 2nd row. At least one green card in each row. &lt;br /&gt;&lt;br /&gt;17.	Is z less than w? z and w are real numbers.&lt;br /&gt;(I) z2 = 25 &lt;br /&gt;(II) w = 9&lt;br /&gt;To answer the question,&lt;br /&gt;a) Either I or II is sufficient&lt;br /&gt;b) Both I and II are sufficient but neither of them is alone sufficient&lt;br /&gt;c) I &amp; II are sufficient&lt;br /&gt;d) Both are not sufficient&lt;br /&gt;&lt;br /&gt;18.	A speaks truth 70% of the time; B speaks truth 80% of the time. What is the probability that both are contradicting each other?&lt;br /&gt;&lt;br /&gt;19.	In a family 7 children don't eat spinach, 6 don't eat carrot, 5 don't eat beans, 4 don't eat spinach &amp; carrots, 3 don't eat carrot &amp; beans, 2 don't eat beans &amp; spinach. One doesn't eat all 3. Find the no. of children.&lt;br /&gt;&lt;br /&gt;20.	Anna, Bena, Catherina and Diana are at their monthly business meeting. Their occupations are author, biologist, chemist and doctor, but not necessarily in that order. Diana just told the neighbour, who is a biologist that Catherina was on her way with doughnuts. Anna is sitting across from the doctor and next to the chemist. The doctor was thinking that Bena was a good name for parent's to choose, but didn't say anything.  What is each person's occupation?&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;UNIX Concepts&lt;br /&gt;SECTION - I  &lt;br /&gt;FILE MANAGEMENT IN UNIX&lt;br /&gt;&lt;br /&gt;1.	How are devices represented in UNIX?&lt;br /&gt;All devices are represented by files called special files that are located          in/dev directory. Thus, device files and other files are named and accessed in the same way. A 'regular file' is just an ordinary data file in the disk. A 'block special file' represents a device with characteristics similar to a disk (data transfer in terms of blocks). A 'character special file' represents a device with characteristics similar to a keyboard (data transfer is by stream of bits in sequential order).&lt;br /&gt;&lt;br /&gt;2.	What is 'inode'?&lt;br /&gt;All UNIX files have its description stored in a structure called 'inode'. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode. In addition to descriptions about the file, the inode contains pointers to the data blocks of the file. If the file is large, inode has indirect pointer to a block of pointers to additional data blocks (this further aggregates for larger files). A block is typically 8k.&lt;br /&gt;Inode consists of the following fields:&lt;br /&gt;	File owner identifier&lt;br /&gt;	File type&lt;br /&gt;	File access permissions&lt;br /&gt;	File access times&lt;br /&gt;	Number of links&lt;br /&gt;	File size&lt;br /&gt;	Location of the file data&lt;br /&gt;&lt;br /&gt;3.	Brief about the directory representation in UNIX&lt;br /&gt;A Unix directory is a file containing a correspondence between filenames and inodes. A directory is a special file that the kernel maintains. Only kernel modifies directories, but processes can read directories. The contents of a directory are a list of filename and inode number pairs. When new directories are created, kernel makes two entries named '.' (refers to the directory itself) and '..' (refers to parent directory).&lt;br /&gt;System call for creating directory is mkdir (pathname, mode).&lt;br /&gt;&lt;br /&gt;4.	What are the Unix system calls for I/O?&lt;br /&gt;	open(pathname,flag,mode) - open file&lt;br /&gt;	creat(pathname,mode) - create file&lt;br /&gt;	close(filedes) - close an open file&lt;br /&gt;	read(filedes,buffer,bytes) - read data from an open file&lt;br /&gt;	write(filedes,buffer,bytes) - write data to an open file&lt;br /&gt;	lseek(filedes,offset,from) - position an open file&lt;br /&gt;	dup(filedes) - duplicate an existing file descriptor&lt;br /&gt;	dup2(oldfd,newfd) - duplicate to a desired file descriptor&lt;br /&gt;	fcntl(filedes,cmd,arg) - change properties of an open file&lt;br /&gt;	ioctl(filedes,request,arg) - change the behaviour of an open file&lt;br /&gt;The difference between fcntl anf ioctl is that the former is intended for any open file, while the latter is for device-specific operations.&lt;br /&gt;&lt;br /&gt;5.	How do you change File Access Permissions?&lt;br /&gt;Every file has following attributes:&lt;br /&gt;	owner's user ID ( 16 bit integer )&lt;br /&gt;	owner's group ID ( 16 bit integer )&lt;br /&gt;	File access mode word &lt;br /&gt;'r w x -r w x- r w x'  &lt;br /&gt;(user permission-group permission-others permission)&lt;br /&gt;r-read, w-write, x-execute&lt;br /&gt;To change the access mode, we use chmod(filename,mode). &lt;br /&gt;Example 1: &lt;br /&gt;To change mode of myfile to 'rw-rw-r--' (ie. read, write permission for user - read,write permission for group - only read permission for others)  we give the args as:&lt;br /&gt;chmod(myfile,0664) .&lt;br /&gt;Each operation is represented by discrete values  &lt;br /&gt;'r' is 4 &lt;br /&gt;'w' is 2 &lt;br /&gt;'x' is 1&lt;br /&gt;Therefore, for 'rw' the value is 6(4+2).&lt;br /&gt;Example 2: &lt;br /&gt;To change mode of myfile to 'rwxr--r--' we give the args as:&lt;br /&gt;chmod(myfile,0744).&lt;br /&gt;&lt;br /&gt;6.	What are links and symbolic links in UNIX file system?&lt;br /&gt;A link is a second name (not a file) for a file. Links can be used to assign more than one name to a file, but cannot be used to assign a directory more than one name or link filenames on different computers.&lt;br /&gt;Symbolic link 'is' a file that only contains the name of another file.Operation on the symbolic link is directed to the file pointed by the it.Both the limitations of links are eliminated in symbolic links. &lt;br /&gt;Commands for linking files are:&lt;br /&gt;Link		ln filename1 filename2 &lt;br /&gt;Symbolic link	ln -s filename1 filename2 &lt;br /&gt;&lt;br /&gt;7.	What is a FIFO?&lt;br /&gt;FIFO are otherwise called as 'named pipes'. FIFO (first-in-first-out) is a special file which is said to be data transient. Once data is read from named pipe, it cannot be read again. Also, data can be read only in the order written. It is used in interprocess communication where a process writes to one end of the pipe (producer) and the other reads from the other end (consumer).&lt;br /&gt;&lt;br /&gt;8.	How do you create special files like named pipes and device files?&lt;br /&gt;The system call mknod creates special files in the following sequence.&lt;br /&gt;1.	kernel assigns new inode, &lt;br /&gt;2.	sets the file type to indicate that the file is a pipe, directory or special file,&lt;br /&gt;3.	If it is a device file, it makes the other entries like major, minor device numbers.&lt;br /&gt;For example: &lt;br /&gt;If the device is a disk, major device number refers to the disk controller and minor device number is the disk.&lt;br /&gt; &lt;br /&gt;9.	Discuss the mount and unmount system calls&lt;br /&gt;The privileged mount system call is used to attach a file system to a directory of another file system; the unmount system call detaches a file system. When you mount another file system on to your directory, you are essentially splicing one directory tree onto a branch in another directory tree. The first argument to mount call is the mount point, that is , a directory in the current file naming system. The second argument is the file system to mount to that point. When you insert a cdrom to your unix system's drive, the file system in the cdrom automatically mounts to /dev/cdrom in your system.&lt;br /&gt;&lt;br /&gt;10.	How does the inode map to data block of a file?&lt;br /&gt;Inode has 13 block addresses. The first 10 are direct block addresses of the first 10 data blocks in the file. The 11th address points to a one-level index block. The 12th address points to a two-level (double in-direction) index block. The 13th address points to a three-level(triple in-direction)index block. This provides a very large maximum file size with efficient access to large files, but also small files are accessed directly in one disk read.&lt;br /&gt;&lt;br /&gt;11.	What is a shell?&lt;br /&gt;A shell is an interactive user interface to an operating system services that allows an user to enter commands as character strings or through a graphical user interface. The shell converts them to system calls to the OS or forks off a process to execute the command. System call results and other information from the OS are presented to the user through an interactive interface. Commonly used shells are sh,csh,ks etc. &lt;br /&gt;&lt;br /&gt;SECTION - II  &lt;br /&gt;	PROCESS MODEL and IPC &lt;br /&gt;&lt;br /&gt;1.	Brief about the initial process sequence while the system boots up. &lt;br /&gt;While booting, special process called the 'swapper' or 'scheduler' is created with Process-ID 0. The swapper manages memory allocation for processes and influences CPU allocation. The swapper inturn creates 3 children: &lt;br /&gt;	the process dispatcher,&lt;br /&gt;	vhand and &lt;br /&gt;	dbflush &lt;br /&gt;with IDs 1,2 and 3 respectively. &lt;br /&gt;This is done by executing the file /etc/init. Process dispatcher gives birth to the shell. Unix keeps track of all the processes in an internal data structure called the Process Table (listing command is ps -el).&lt;br /&gt;&lt;br /&gt;2.	What are various IDs associated with a process?&lt;br /&gt;Unix identifies each process with a unique integer called ProcessID. The process that executes the request for creation of a process is called the 'parent process' whose PID is 'Parent Process ID'. Every process is associated with a particular user called the 'owner' who has privileges over the process. The identification for the user is 'UserID'. Owner is the user who executes the process. Process also has 'Effective User ID' which determines the access privileges for accessing resources like files.&lt;br /&gt;getpid() -process id&lt;br /&gt;getppid() -parent process id&lt;br /&gt;getuid() -user id&lt;br /&gt;geteuid() -effective user id&lt;br /&gt;&lt;br /&gt;3.	Explain fork() system call.&lt;br /&gt;The `fork()'  used to create a new process from an existing process.  The new process is called the child process, and the existing process is called the parent.  We can tell which is which by checking the return value from `fork()'.  The parent gets the child's pid returned to him, but the child gets 0 returned to him.&lt;br /&gt;&lt;br /&gt;4.	Predict the output of the following program code&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt; 	fork();&lt;br /&gt;printf("Hello World!");&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;Hello World!Hello World!&lt;br /&gt;Explanation:&lt;br /&gt;The fork creates a child that is a duplicate of the parent process. The child begins from the fork().All the statements after the call to fork() will be executed twice.(once by the parent process and other by child). The statement before fork() is executed only by the parent process.&lt;br /&gt;&lt;br /&gt;5.	Predict the output of the following program code&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;fork(); fork(); fork();&lt;br /&gt;printf("Hello World!");&lt;br /&gt;}&lt;br /&gt;Answer: &lt;br /&gt;"Hello World" will be printed 8 times.&lt;br /&gt;Explanation:&lt;br /&gt; 	2^n times where n is the number of calls to fork()&lt;br /&gt;&lt;br /&gt;6.	List the system calls used for process management:&lt;br /&gt;System calls		Description&lt;br /&gt;fork()			To create a new process&lt;br /&gt;exec()			To execute a new program in a process&lt;br /&gt;wait()			To wait until a created process completes its execution&lt;br /&gt;exit()			To exit from a process execution&lt;br /&gt;getpid()		To get a process identifier of the current process&lt;br /&gt;getppid()		To get parent process identifier&lt;br /&gt;nice()			To bias the existing priority of a process&lt;br /&gt;brk()			To increase/decrease the data segment size of a process&lt;br /&gt;&lt;br /&gt;7.	How can you get/set an environment variable from a program?&lt;br /&gt;Getting the value of an environment variable is done by using `getenv()'.&lt;br /&gt;Setting the value of an environment variable is done by using `putenv()'.&lt;br /&gt;&lt;br /&gt;8.	How can a parent and child process communicate?&lt;br /&gt;A parent and child can communicate through any of the normal inter-process communication schemes (pipes, sockets, message queues, shared memory), but also have some special ways to communicate that take advantage of their relationship as a parent and child. One of the most obvious is that the parent can get the exit status of the child.&lt;br /&gt;&lt;br /&gt;9.	What is a zombie?&lt;br /&gt;When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it - for example, the parent may need to check the child's exit status. To be able to get this information, the parent calls `wait()'; In the interval between the child terminating and the parent calling `wait()', the child is said to be a `zombie' (If you do `ps', the child will have a `Z' in its status field to indicate this.)  &lt;br /&gt;&lt;br /&gt;10.	What are the process states in Unix?&lt;br /&gt;As a process executes it changes state according to its circumstances. Unix processes have the following states: &lt;br /&gt;Running : The process is either running or it is ready to run . &lt;br /&gt;Waiting : The process is waiting for an event or for a resource. &lt;br /&gt;Stopped : The process has been stopped, usually by receiving a signal. &lt;br /&gt;Zombie : The process is dead but have not been removed from the process table.&lt;br /&gt;&lt;br /&gt;11.	What Happens when you execute a program? &lt;br /&gt;When you execute a program on your UNIX system, the system creates a special environment for that program. This environment contains everything needed for the system to run the program as if no other program were running on the system. Each process has process context, which is everything that is unique about the state of the program you are currently running. Every time you execute a program the UNIX system does a fork, which performs a series of operations to create a process context and then execute your program in that context. The steps include the following: &lt;br /&gt;	Allocate a slot in the process table, a list of currently running programs kept by UNIX. &lt;br /&gt;	Assign a unique process identifier (PID) to the process.&lt;br /&gt;	iCopy the context of the parent, the process that requested the spawning of the new process. &lt;br /&gt;	Return the new PID to the parent process. This enables the parent process to examine or control the process directly. &lt;br /&gt;After the fork is complete, UNIX runs your program. &lt;br /&gt;&lt;br /&gt;12.	What Happens when you execute a command? &lt;br /&gt;When you enter 'ls' command to look at the contents of your current working directory, UNIX does a series of things to create an environment for ls and the run it: The shell has UNIX perform a fork. This creates a new process that the shell will use to run the ls program. The shell has UNIX perform an exec of the ls program. This replaces the shell program and data with the program and data for ls and then starts running that new program. The ls program is loaded into the new process context, replacing the text and data of the shell. The ls program performs its task, listing the contents of the current directory. &lt;br /&gt;&lt;br /&gt;13.	What is a Daemon?&lt;br /&gt;A daemon is a process that detaches itself from the terminal and runs, disconnected, in the background, waiting for requests and responding to them. It can also be defined as the background process that does not belong to a terminal session. Many system functions are commonly performed by daemons, including the sendmail daemon, which handles mail, and the NNTP daemon, which handles USENET news. Many other daemons may exist. Some of the most common daemons are:&lt;br /&gt;	init: Takes over the basic running of the system when the kernel has finished the boot process. &lt;br /&gt;	inetd: Responsible for starting network services that do not have their own stand-alone daemons. For example, inetd usually takes care of incoming rlogin, telnet, and ftp connections.&lt;br /&gt;	cron: Responsible for running repetitive tasks on a regular schedule. &lt;br /&gt;&lt;br /&gt;14.	What is 'ps' command for?&lt;br /&gt;The ps command prints the process status for some or all of the running processes. The information given are the process identification number (PID),the amount of time that the process has taken to execute so far etc.&lt;br /&gt;&lt;br /&gt;15.	How would you kill a process?&lt;br /&gt;The kill command takes the PID as one argument; this identifies which process to terminate. The PID of a process can be got using 'ps' command.&lt;br /&gt;&lt;br /&gt;16.	What is an advantage of executing a process in background?&lt;br /&gt;The most common reason to put a process in the background is to allow you to do something else interactively without waiting for the process to complete. At the end of the command you add the special background symbol, &amp;. This symbol tells your shell to execute the given command in the background.&lt;br /&gt;Example: cp *.* ../backup&amp;                (cp is for copy) &lt;br /&gt;&lt;br /&gt;17.	How do you execute one program from within another?&lt;br /&gt;The system calls used for low-level process creation are execlp() and execvp(). The execlp call overlays the existing program with the new one , runs that and exits. The original program gets back control only when an error occurs.&lt;br /&gt;execlp(path,file_name,arguments..); //last argument must be NULL&lt;br /&gt;A variant of execlp called execvp is used when the number of arguments is not known in advance.&lt;br /&gt;execvp(path,argument_array);  //argument array should be terminated by NULL&lt;br /&gt;&lt;br /&gt;18.	What is IPC? What are the various schemes available? &lt;br /&gt;The term IPC (Inter-Process Communication) describes various ways by which different process running on some operating system communicate between each other. Various schemes available are as follows:&lt;br /&gt;Pipes: &lt;br /&gt;One-way communication scheme through which different process can communicate. The problem is that the two processes should have a common ancestor (parent-child relationship). However this problem was fixed with the introduction of named-pipes (FIFO).&lt;br /&gt;&lt;br /&gt;Message Queues :&lt;br /&gt;Message queues can be used between related and unrelated processes running on a machine. &lt;br /&gt;&lt;br /&gt;Shared Memory:&lt;br /&gt;This is the fastest of all IPC schemes. The memory to be shared is mapped into the address space of the processes (that are sharing). The speed achieved is attributed to the fact that there is no kernel involvement. But this scheme needs synchronization.   &lt;br /&gt;&lt;br /&gt;	Various forms of synchronisation are mutexes, condition-variables, read-write locks, 	record-locks, and semaphores.&lt;br /&gt;&lt;br /&gt;SECTION - III &lt;br /&gt;	MEMORY MANAGEMENT&lt;br /&gt;&lt;br /&gt;1.	What is the difference between Swapping and Paging?&lt;br /&gt;Swapping:	&lt;br /&gt;Whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and overhead to the system. Swapping systems does not handle the memory more flexibly as compared to the paging systems.&lt;br /&gt;	Paging:	&lt;br /&gt;Only the required memory pages are moved to main memory from the swap device for execution. Process size does not matter. Gives the concept of the virtual memory.&lt;br /&gt;It provides greater flexibility in mapping the virtual address space into the physical memory of the machine. Allows more number of processes to fit in the main memory simultaneously. Allows the greater process size than the available physical memory. Demand paging systems handle the memory more flexibly.&lt;br /&gt;&lt;br /&gt;2.	What is major difference between the Historic Unix and the new BSD release of Unix System V in terms of Memory Management?&lt;br /&gt;Historic Unix uses Swapping – entire process is transferred to the main memory from the swap device, whereas the Unix System V uses Demand Paging – only the part of the process is moved to the main memory. Historic Unix uses one Swap Device and Unix System V allow multiple Swap Devices.&lt;br /&gt;&lt;br /&gt;3.	What is the main goal of the Memory Management?&lt;br /&gt;	It decides which process should reside in the main memory,&lt;br /&gt;	Manages the parts of the virtual address space of a process which is non-core resident,&lt;br /&gt;	Monitors the available main memory and periodically write the processes into the swap device to provide more processes fit in the main memory simultaneously.&lt;br /&gt;&lt;br /&gt;4.	What is a Map?&lt;br /&gt;A Map is an Array, which contains the addresses of the free space in the swap device that are allocatable resources, and the number of the resource units available there. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This allows First-Fit allocation of contiguous blocks of a resource. Initially the Map contains one entry – address (block offset from the starting of the swap area) and the total number of resources.&lt;br /&gt;	Kernel treats each unit of Map as a group of disk blocks. On the allocation and freeing of the resources Kernel updates the Map for accurate information.&lt;br /&gt;&lt;br /&gt;5.	What scheme does the Kernel in Unix System V follow while choosing a swap device among the multiple swap devices?&lt;br /&gt;Kernel follows Round Robin scheme choosing a swap device among the multiple swap devices in Unix System V.&lt;br /&gt;&lt;br /&gt;6.	What is a Region?&lt;br /&gt;A Region is a continuous area of a process’s address space (such as text, data and stack). The kernel in a ‘Region Table’ that is local to the process maintains region. Regions are sharable among the process.&lt;br /&gt;&lt;br /&gt;7.	What are the events done by the Kernel after a process is being swapped out from the main memory?&lt;br /&gt;When Kernel swaps the process out of the primary memory, it performs the following:&lt;br /&gt;	Kernel decrements the Reference Count of each region of the process. If the reference count becomes zero, swaps the region out of the main memory,&lt;br /&gt;	Kernel allocates the space for the swapping process in the swap device,&lt;br /&gt;	Kernel locks the other swapping process while the current swapping operation is going on,&lt;br /&gt;	The Kernel saves the swap address of the region in the region table.&lt;br /&gt;&lt;br /&gt;8.	Is the Process before and after the swap are the same? Give reason.&lt;br /&gt;Process before swapping is residing in the primary memory in its original form. The regions (text, data and stack) may not be occupied fully by the process, there may be few empty slots in any of the regions and while swapping Kernel do not bother about the empty slots while swapping the process out.&lt;br /&gt;	After swapping the process resides in the swap (secondary memory) device. The regions swapped out will be present but only the occupied region slots but not the empty slots that were present before assigning.&lt;br /&gt;While swapping the process once again into the main memory, the Kernel referring to the Process Memory Map, it assigns the main memory accordingly taking care of the empty slots in the regions.&lt;br /&gt;&lt;br /&gt;9.	What do you mean by u-area (user area) or u-block?&lt;br /&gt;This contains the private data that is manipulated only by the Kernel. This is local to the Process, i.e. each process is allocated a u-area.&lt;br /&gt;&lt;br /&gt;10.	 What are the entities that are swapped out of the main memory while swapping the process out of the main memory?&lt;br /&gt;All memory space occupied by the process, process’s u-area, and Kernel stack are swapped out, theoretically.&lt;br /&gt;Practically, if the process’s u-area contains the Address Translation Tables for the process then Kernel implementations do not swap the u-area.&lt;br /&gt;&lt;br /&gt;11.	 What is Fork swap?&lt;br /&gt;	fork() is a system call to create a child process. When the parent process calls fork() system call, the child process is created and if there is short of memory then the child process is sent to the read-to-run state in the swap device, and return to the user state without swapping the parent process. When the memory will be available the child process will be swapped into the main memory.&lt;br /&gt;&lt;br /&gt;12.	What is Expansion swap?&lt;br /&gt;	At the time when any process requires more memory than it is currently allocated, the Kernel performs Expansion swap. To do this Kernel reserves enough space in the swap device. Then the address translation mapping is adjusted for the new virtual address space but the physical memory is not allocated. At last Kernel swaps the process into the assigned space in the swap device.  Later when the Kernel swaps the process into the main memory this assigns memory according to the new address translation mapping.&lt;br /&gt;&lt;br /&gt;13.	How the Swapper works?&lt;br /&gt;	The swapper is the only process that swaps the processes. The Swapper operates only in the Kernel mode and it does not uses System calls instead it uses internal Kernel functions for swapping. It is the archetype of all kernel process.&lt;br /&gt;&lt;br /&gt;14.	What are the processes that are not bothered by the swapper? Give Reason.&lt;br /&gt;	Zombie process: They do not take any up physical memory.&lt;br /&gt;	Processes locked in memories that are updating the region of the process.&lt;br /&gt;	Kernel swaps only the sleeping processes rather than the ‘ready-to-run’ processes, as they have the higher probability of being scheduled than the Sleeping processes.&lt;br /&gt;&lt;br /&gt;15.	What are the requirements for a swapper to work?&lt;br /&gt;	The swapper works on the highest scheduling priority. Firstly it will look for any sleeping process, if not found then it will look for the ready-to-run process for swapping. But the major requirement for the swapper to work the ready-to-run process must be core-resident for at least 2 seconds before swapping out. And for swapping in the process must have been resided in the swap device for at least 2 seconds. If the requirement is not satisfied then the swapper will go into the wait state on that event and it is awaken once in a second by the Kernel.&lt;br /&gt;&lt;br /&gt;16.	What are the criteria for choosing a process for swapping into memory from the swap device? &lt;br /&gt;	The resident time of the processes in the swap device, the priority of the processes and the amount of time the processes had been swapped out.&lt;br /&gt;&lt;br /&gt;17.	What are the criteria for choosing a process for swapping out of the memory to the swap device?&lt;br /&gt;	The process’s memory resident time,&lt;br /&gt;	Priority of the process and &lt;br /&gt;	The nice value.&lt;br /&gt;&lt;br /&gt;18.	What do you mean by nice value?&lt;br /&gt;	Nice value is the value that controls {increments or decrements} the priority of the process. This value that is returned by the nice () system call. The equation for using nice value is: &lt;br /&gt;Priority = (“recent CPU usage”/constant) + (base- priority) + (nice value)&lt;br /&gt;Only the administrator can supply the nice value. The nice () system call works for the running process only. Nice value of one process cannot affect the nice value of the other process.&lt;br /&gt;&lt;br /&gt;19.	What are conditions on which deadlock can occur while swapping the processes?&lt;br /&gt;	All processes in the main memory are asleep.&lt;br /&gt;	All ‘ready-to-run’ processes are swapped out.&lt;br /&gt;	There is no space in the swap device for the new incoming process that are swapped out of the main memory.&lt;br /&gt;	There is no space in the main memory for the new incoming process.&lt;br /&gt;&lt;br /&gt;20.	What are conditions for a machine to support Demand Paging?&lt;br /&gt;	Memory architecture must based on Pages, &lt;br /&gt;	The machine must support the ‘restartable’ instructions.&lt;br /&gt;&lt;br /&gt;21.	What is ‘the principle of locality’?&lt;br /&gt;It’s the nature of the processes that they refer only to the small subset of the total data space of the process. i.e. the process frequently calls the same subroutines or executes the loop instructions.&lt;br /&gt;&lt;br /&gt;22.	What is the working set of a process?&lt;br /&gt;The set of pages that are referred by the process in the last ‘n’, references, where ‘n’ is called the window of the working set of the process.&lt;br /&gt;&lt;br /&gt;23.	What is the window of the working set of a process?&lt;br /&gt;The window of the working set of a process is the total number in which the process had referred the set of pages in the working set of the process.&lt;br /&gt;&lt;br /&gt;24.	What is called a page fault?&lt;br /&gt;Page fault is referred to the situation when the process addresses a page in the working set of the process but the process fails to locate the page in the working set. And on a page fault the kernel updates the working set by reading the page from the secondary device.&lt;br /&gt;&lt;br /&gt;25.	What are data structures that are used for Demand Paging?&lt;br /&gt;	Kernel contains 4 data structures for Demand paging. They are,&lt;br /&gt;	Page table entries,&lt;br /&gt;	Disk block descriptors,&lt;br /&gt;	Page frame data table (pfdata),&lt;br /&gt;	Swap-use table.&lt;br /&gt; &lt;br /&gt;26.	What are the bits that support the demand paging?&lt;br /&gt;Valid, Reference, Modify, Copy on write, Age. These bits are the part of the page table entry, which includes physical address of the page and protection bits.&lt;br /&gt;&lt;br /&gt;Page address&lt;br /&gt;	Age	Copy on write	Modify	Reference	Valid	Protection&lt;br /&gt;&lt;br /&gt;27.	How the Kernel handles the fork() system call in traditional Unix and in the System V Unix, while swapping?&lt;br /&gt;	Kernel in traditional Unix, makes the duplicate copy of the parent’s address space and attaches it to the child’s process, while swapping. Kernel in System V Unix, manipulates the region tables, page table, and pfdata table entries, by incrementing the reference count of the region table of shared regions.&lt;br /&gt;&lt;br /&gt;28.	Difference between the fork() and vfork() system call?&lt;br /&gt;	During the fork() system call the Kernel makes a copy of the parent process’s address space and attaches it to the child process.&lt;br /&gt;	But the vfork() system call do not makes any copy of the parent’s address space, so it is faster than the fork() system call. The child process as a result of the vfork() system call executes exec() system call. The child process from vfork() system call executes in the parent’s address space (this can overwrite the parent’s data and stack ) which suspends the parent process until the child process exits.&lt;br /&gt;&lt;br /&gt;29.	What is BSS(Block Started by Symbol)?&lt;br /&gt;	A data representation at the machine level, that has initial values when a program starts and tells about how much space the kernel allocates for the un-initialized data. Kernel initializes it to zero at run-time.&lt;br /&gt;&lt;br /&gt;30.	What is Page-Stealer process?&lt;br /&gt;	This is the Kernel process that makes rooms for the incoming pages, by swapping the memory pages that are not the part of the working set of a process. Page-Stealer is created by the Kernel at the system initialization and invokes it throughout the lifetime of the system. Kernel locks a region when a process faults on a page in the region, so that page stealer cannot steal the page, which is being faulted in.&lt;br /&gt;&lt;br /&gt;31.	Name two paging states for a page in memory?&lt;br /&gt;The two paging states are:&lt;br /&gt;	The page is aging and is not yet eligible for swapping,&lt;br /&gt;	The page is eligible for swapping but not yet eligible for reassignment to other virtual address space.&lt;br /&gt;&lt;br /&gt;32.	What are the phases of swapping a page from the memory?&lt;br /&gt;	Page stealer finds the page eligible for swapping and places the page number in the list of pages to be swapped.&lt;br /&gt;	Kernel copies the page to a swap device when necessary and clears the valid bit in the page table entry, decrements the pfdata reference count, and places the pfdata table entry at the end of the free list if its reference count is 0.&lt;br /&gt;&lt;br /&gt;33.	What is page fault? Its types?&lt;br /&gt;	Page fault refers to the situation of not having a page in the main memory when any process references it.&lt;br /&gt;There are two types of page fault :&lt;br /&gt;	Validity fault, 	&lt;br /&gt;	Protection fault.&lt;br /&gt;&lt;br /&gt;34.	In what way the Fault Handlers and the Interrupt handlers are different?&lt;br /&gt;	Fault handlers are also an interrupt handler with an exception that the interrupt handlers cannot sleep. Fault handlers sleep in the context of the process that caused the memory fault. The fault refers to the running process and no arbitrary processes are put to sleep.&lt;br /&gt;&lt;br /&gt;35.	What is validity fault?&lt;br /&gt;If a process referring a page in the main memory whose valid bit is not set, it results in validity fault.&lt;br /&gt;	The valid bit is not set for those pages:&lt;br /&gt;	that are outside the virtual address space of a process,&lt;br /&gt;	that are the part of the virtual address space of the process but no physical address is assigned to it.&lt;br /&gt;&lt;br /&gt;36.	What does the swapping system do if it identifies the illegal page for swapping?&lt;br /&gt;If the disk block descriptor does not contain any record of the faulted page, then this causes the attempted memory reference is invalid and the kernel sends a “Segmentation violation” signal to the offending process. This happens when the swapping system identifies any invalid memory reference.&lt;br /&gt;&lt;br /&gt;37.	What are states that the page can be in, after causing a page fault?&lt;br /&gt;	On a swap device and not in memory,&lt;br /&gt;	On the free page list in the main memory,&lt;br /&gt;	In an executable file,&lt;br /&gt;	Marked “demand zero”,&lt;br /&gt;	Marked “demand fill”. &lt;br /&gt;&lt;br /&gt;38.	In what way the validity fault handler concludes?&lt;br /&gt;	It sets the valid bit of the page by clearing the modify bit.&lt;br /&gt;	It recalculates the process priority.&lt;br /&gt;&lt;br /&gt;39.	At what mode the fault handler executes?&lt;br /&gt;	At the Kernel Mode.&lt;br /&gt;&lt;br /&gt;40.	What do you mean by the protection fault?&lt;br /&gt;	Protection fault refers to the process accessing the pages, which do not have the access permission. A process also incur the protection fault when it attempts to write a page whose copy on write bit was set during the fork() system call.&lt;br /&gt;&lt;br /&gt;41.	How the Kernel handles the copy on write bit of a page, when the bit is set?&lt;br /&gt;	In situations like, where the copy on write bit of a page is set and that page is shared by more than one process, the Kernel allocates new page and copies the content to the new page and the other processes retain their references to the old page. After copying the Kernel updates the page table entry with the new page number. Then Kernel decrements the reference count of the old pfdata table entry.&lt;br /&gt;	In cases like, where the copy on write bit is set and no processes are sharing the page, the Kernel allows the physical page to be reused by the processes. By doing so, it clears the copy on write bit and disassociates the page from its disk copy (if one exists), because other process may share the disk copy. Then it removes the pfdata table entry from the page-queue as the new copy of the virtual page is not on the swap device. It decrements the swap-use count for the page and if count drops to 0, frees the swap space.&lt;br /&gt;&lt;br /&gt;42.	For which kind of fault the page is checked first?&lt;br /&gt;	The page is first checked for the validity fault, as soon as it is found that the page is invalid (valid bit is clear), the validity fault handler returns immediately, and the process incur the validity page fault. Kernel handles the validity fault and the process will incur the protection fault if any one is present.&lt;br /&gt;&lt;br /&gt;43.	In what way the protection fault handler concludes?&lt;br /&gt;	After finishing the execution of the fault handler, it sets the modify and protection bits and clears the copy on write bit. It recalculates the process-priority and checks for signals.&lt;br /&gt;&lt;br /&gt;44.	How the Kernel handles both the page stealer and the fault handler?&lt;br /&gt;The page stealer and the fault handler thrash because of the shortage of the memory. If the sum of the working sets of all processes is greater that the physical memory then the fault handler will usually sleep because it cannot allocate pages for a process. This results in the reduction of the system throughput because Kernel spends too much time in overhead, rearranging the memory in the frantic pace.    &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RDBMS Concepts&lt;br /&gt;1.	What is database?&lt;br /&gt;A database is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and which is designed, built and populated with data for a specific purpose.&lt;br /&gt;&lt;br /&gt;2.	What is DBMS?&lt;br /&gt;It is a collection of programs that enables user to create and maintain a database. In other words it is general-purpose software that provides the users with the processes of defining, constructing and manipulating the database for various applications.&lt;br /&gt;&lt;br /&gt;3.	What is a Database system?&lt;br /&gt;The database and DBMS software together is called as Database system.&lt;br /&gt;&lt;br /&gt;4.	Advantages of DBMS?&lt;br /&gt;	Redundancy is controlled.&lt;br /&gt;	Unauthorised access is restricted.&lt;br /&gt;	Providing multiple user interfaces.&lt;br /&gt;	Enforcing integrity constraints.&lt;br /&gt;	Providing backup and recovery.&lt;br /&gt;&lt;br /&gt;5.	Disadvantage in File Processing System?&lt;br /&gt;	Data redundancy &amp; inconsistency.&lt;br /&gt;	Difficult in accessing data.&lt;br /&gt;	Data isolation.&lt;br /&gt;	Data integrity.&lt;br /&gt;	Concurrent access is not possible. &lt;br /&gt;	Security Problems.&lt;br /&gt;&lt;br /&gt;6.	Describe the three levels of data abstraction?&lt;br /&gt;The are three levels of abstraction:&lt;br /&gt;	Physical level: The lowest level of abstraction describes how data are stored.&lt;br /&gt;	Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data.  &lt;br /&gt;	View level: The highest level of abstraction describes only part of entire database.&lt;br /&gt;7.	Define the "integrity rules"&lt;br /&gt;There are two Integrity rules.&lt;br /&gt;	Entity Integrity: States that “Primary key cannot have NULL value”&lt;br /&gt;	Referential Integrity: States that “Foreign Key can be either a NULL value or should be Primary Key value of other relation.&lt;br /&gt;&lt;br /&gt;8.	What is extension and intension?&lt;br /&gt;Extension - &lt;br /&gt;It is the number of tuples present in a table at any instance. This is time dependent.&lt;br /&gt;Intension - &lt;br /&gt;It is a constant value that gives the name, structure of table and the constraints laid on it.&lt;br /&gt;&lt;br /&gt;9.	What is System R? What are its two major subsystems?&lt;br /&gt;System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center. It is a prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be used in a real life environment to solve real life problems, with performance at least comparable to that of existing system. &lt;br /&gt;Its two subsystems are &lt;br /&gt;	Research Storage &lt;br /&gt;	System Relational Data System.&lt;br /&gt;&lt;br /&gt;10.	How is the data structure of System R different from the relational structure? &lt;br /&gt;Unlike Relational systems in System R &lt;br /&gt;	Domains are not supported&lt;br /&gt;	Enforcement of candidate key uniqueness is optional&lt;br /&gt;	Enforcement of entity integrity is optional&lt;br /&gt;	Referential integrity is not enforced&lt;br /&gt;&lt;br /&gt;11.	What is Data Independence?&lt;br /&gt;	Data independence means that “the application is independent of the storage structure and access strategy of data”. In other words, The ability to modify the schema definition in one level should not affect the schema definition in the next higher level.&lt;br /&gt;Two types of Data Independence:&lt;br /&gt;	Physical Data Independence: Modification in physical level should not affect the logical level.    &lt;br /&gt;	Logical Data Independence: Modification in logical level should affect the view level.    &lt;br /&gt;     NOTE:  Logical Data Independence is more difficult to achieve&lt;br /&gt;&lt;br /&gt;12.	What is a view? How it is related to data independence?&lt;br /&gt;A view may be thought of as a virtual table, that is, a table that does not really exist in its own right but is instead derived from one or more underlying base table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary.&lt;br /&gt;Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the effects of restructuring and growth in the database. Hence accounts for logical data independence.&lt;br /&gt;&lt;br /&gt;13.	What is Data Model?&lt;br /&gt; A collection of conceptual tools for describing data, data relationships data semantics and constraints.&lt;br /&gt;&lt;br /&gt;14.	What is E-R model?&lt;br /&gt;This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entities are described in a database by a set of attributes.&lt;br /&gt;&lt;br /&gt;15.	What is Object Oriented model?&lt;br /&gt;This model is based on collection of objects. An object contains values stored in instance variables with in the 	object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes.&lt;br /&gt;&lt;br /&gt;16.	What is an Entity?&lt;br /&gt;It is a 'thing' in the real world with an independent existence.&lt;br /&gt;&lt;br /&gt;17.	What is an Entity type?&lt;br /&gt;It is a collection (set) of entities that have same attributes.&lt;br /&gt;&lt;br /&gt;18.	What is an Entity set?&lt;br /&gt;It is a collection of all entities of particular entity type in the database.&lt;br /&gt;&lt;br /&gt;19.	What is an Extension of entity type?&lt;br /&gt;The collections of entities of a particular entity type are grouped together into an entity set.&lt;br /&gt;&lt;br /&gt;20.	What is Weak Entity set?&lt;br /&gt;An entity set may not have sufficient attributes to form a primary key, and its primary key compromises of its partial key and primary key of its parent entity, then it is said to be Weak Entity set.&lt;br /&gt;&lt;br /&gt;21.	What is an attribute?&lt;br /&gt;It is a particular property, which describes the entity. &lt;br /&gt;&lt;br /&gt;22.	What is a Relation Schema and a Relation?&lt;br /&gt;A relation Schema denoted by R(A1, A2, …, An) is made up of the relation name R and the list of attributes Ai that it contains. A relation is defined as a set of tuples. Let r be the relation which contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list of n-values t=(v1,v2, ..., vn).&lt;br /&gt;&lt;br /&gt;23.	What is degree of a Relation?&lt;br /&gt;It is the number of attribute of its relation schema.&lt;br /&gt;&lt;br /&gt;24.	What is Relationship?&lt;br /&gt;It is an association among two or more entities.&lt;br /&gt;&lt;br /&gt;25.	What is Relationship set? &lt;br /&gt;The collection (or set) of similar relationships.&lt;br /&gt;&lt;br /&gt;26.	What is Relationship type?   &lt;br /&gt;Relationship type defines a set of associations or a relationship set  among a given set of entity types.   &lt;br /&gt; &lt;br /&gt;27.	What is degree of Relationship type? &lt;br /&gt;It is the number of entity type participating.&lt;br /&gt;&lt;br /&gt;25.	What is DDL (Data Definition Language)?&lt;br /&gt;A data base schema is specifies by a set of definitions expressed by a special language called DDL.&lt;br /&gt;&lt;br /&gt;26.	What is VDL (View Definition Language)?&lt;br /&gt;It specifies user views and their mappings to the conceptual schema.&lt;br /&gt;&lt;br /&gt;27.	What is SDL (Storage Definition Language)?&lt;br /&gt;This language is to specify the internal schema. This language may specify the mapping between two schemas.&lt;br /&gt;&lt;br /&gt;28.	What is Data Storage - Definition Language?&lt;br /&gt;The storage structures and access methods used by database system are specified by a set of definition in a special type of DDL called data storage-definition language.&lt;br /&gt;&lt;br /&gt;29.	What is DML (Data Manipulation Language)?&lt;br /&gt;This language that enable user to access or manipulate data as organised by appropriate data model.&lt;br /&gt;	Procedural DML or Low level: DML requires a user to specify what data are needed and how to get those data.&lt;br /&gt;	Non-Procedural DML or High level:  DML requires a user to specify what data are needed without specifying how to get those data.&lt;br /&gt;&lt;br /&gt;31.	What is DML Compiler?&lt;br /&gt;It translates DML statements in a query language into low-level instruction that the query evaluation engine can understand.&lt;br /&gt;&lt;br /&gt;32.	What is Query evaluation engine?&lt;br /&gt;It executes low-level instruction generated by compiler.&lt;br /&gt;&lt;br /&gt;33.	What is DDL Interpreter?&lt;br /&gt;It interprets DDL statements and record them in tables containing metadata.&lt;br /&gt;&lt;br /&gt;34.	What is Record-at-a-time?&lt;br /&gt;The Low level or Procedural DML can specify and retrieve each record from a set of records. This retrieve of a record is said to be Record-at-a-time.&lt;br /&gt;&lt;br /&gt;35.	What is Set-at-a-time or Set-oriented?&lt;br /&gt;The High level or Non-procedural DML can specify and retrieve many records in a single DML statement. This retrieve of a record is said to be Set-at-a-time or Set-oriented.&lt;br /&gt;&lt;br /&gt;36.	What is Relational Algebra?&lt;br /&gt;It is procedural query language. It consists of a set of operations that take one or two relations as input and produce a new relation. &lt;br /&gt;&lt;br /&gt;37.	What is Relational Calculus?&lt;br /&gt;It is an applied predicate calculus specifically tailored for relational databases proposed by E.F. Codd. E.g. of languages based on it are DSL ALPHA, QUEL.&lt;br /&gt;&lt;br /&gt;38.	How does Tuple-oriented relational calculus differ from domain-oriented relational calculus&lt;br /&gt;The tuple-oriented calculus uses a tuple variables i.e., variable whose only permitted values are tuples of that relation. E.g. QUEL&lt;br /&gt;The domain-oriented calculus has domain variables i.e., variables that range over the underlying domains instead of over relation. E.g. ILL, DEDUCE.&lt;br /&gt;&lt;br /&gt;39.	What is normalization? &lt;br /&gt;It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties&lt;br /&gt;	Minimizing redundancy&lt;br /&gt;	Minimizing insertion, deletion and update anomalies.   &lt;br /&gt;&lt;br /&gt;40.	What is Functional Dependency?   &lt;br /&gt;A Functional dependency is denoted by X     Y between two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely determines the value of component Y.&lt;br /&gt;&lt;br /&gt;41.	When is a functional dependency F said to be minimal? &lt;br /&gt;	Every dependency in F has a single attribute for its right hand side.&lt;br /&gt;	We cannot replace any dependency X    A in F with a dependency Y   A where Y is a proper subset of X and still have a set of dependency that is equivalent to F.&lt;br /&gt;	We cannot remove any dependency from F and still have set of dependency that is equivalent to F.&lt;br /&gt;&lt;br /&gt;42.	What is Multivalued dependency?&lt;br /&gt;Multivalued dependency denoted by X        Y specified on relation schema R, where X and Y are both subsets of R, specifies the following constraint on any relation r of R: if two tuples t1 and t2 exist in r such that t1[X] = t2[X] then t3 and t4 should also exist in r with the following properties&lt;br /&gt;	t3[x] = t4[X] = t1[X] = t2[X]&lt;br /&gt;	t3[Y] = t1[Y] and t4[Y] = t2[Y]&lt;br /&gt;	t3[Z] = t2[Z] and t4[Z] = t1[Z]  &lt;br /&gt;where [Z = (R-(X U Y)) ]&lt;br /&gt;             &lt;br /&gt;43.	What is Lossless join property?&lt;br /&gt;It guarantees that the spurious tuple generation does not occur with respect to relation schemas after decomposition.&lt;br /&gt;&lt;br /&gt;44.	What is 1 NF (Normal Form)?&lt;br /&gt;The domain of attribute must include only atomic (simple, indivisible) values. &lt;br /&gt;&lt;br /&gt;45.	What is Fully Functional dependency? &lt;br /&gt;It is based on concept of full functional dependency. A functional dependency     X    Y is full functional dependency if removal of any attribute A from X means that the dependency does not hold any more.&lt;br /&gt;&lt;br /&gt;46.	What is 2NF? &lt;br /&gt;A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key.&lt;br /&gt;&lt;br /&gt;47.	What is 3NF?&lt;br /&gt;A relation schema R is in 3NF if it is in 2NF and for every FD X    A either of the following is true&lt;br /&gt;	X is a Super-key of R.&lt;br /&gt;	A is a prime attribute of R.&lt;br /&gt;In other words, if every non prime attribute is non-transitively dependent on primary key.&lt;br /&gt;&lt;br /&gt;48.	What is BCNF (Boyce-Codd Normal Form)?&lt;br /&gt;	A relation schema R is in BCNF if it is in 3NF and satisfies an additional constraint that for every FD X     A, X must be a candidate key.&lt;br /&gt;       &lt;br /&gt;49.	What is 4NF?&lt;br /&gt;A relation schema R is said to be in 4NF if for every Multivalued dependency         X         Y that holds over R, one of following is true&lt;br /&gt;	X is subset or equal to (or) XY = R.&lt;br /&gt;	X is a super key.&lt;br /&gt;&lt;br /&gt;50.	What is 5NF?&lt;br /&gt;A Relation schema R is said to be 5NF if for every join dependency  {R1, R2, ..., Rn} that holds R, one the following is true &lt;br /&gt;	Ri = R for some i.&lt;br /&gt;	The join dependency is implied by the set of FD, over R in which the left side is key of R.   &lt;br /&gt;51.	What is Domain-Key Normal Form?&lt;br /&gt;A relation is said to be in DKNF if all constraints and dependencies that should hold on the the constraint can be enforced by simply enforcing the domain constraint and key constraint on the relation. &lt;br /&gt; &lt;br /&gt;52.	What are partial, alternate,, artificial, compound and natural key?&lt;br /&gt;Partial Key:&lt;br /&gt;It is a set of attributes that can uniquely identify weak entities and that are related to same owner entity. It is sometime called as Discriminator.&lt;br /&gt;Alternate Key:&lt;br /&gt;	All Candidate Keys excluding the Primary Key are known as Alternate Keys.&lt;br /&gt;Artificial Key:&lt;br /&gt; If no obvious key, either stand alone or compound is available, then the last resort is to simply create a key, by assigning a unique number to each record or occurrence. Then this is known as developing an artificial key.&lt;br /&gt;	Compound Key:&lt;br /&gt;		If no single data element uniquely identifies occurrences within a construct, then combining multiple elements to create a unique identifier for the construct is known as creating a compound key.&lt;br /&gt;	Natural Key:&lt;br /&gt;	When one of the data elements stored within a construct is utilized as the primary key, then it is called the natural key.&lt;br /&gt;&lt;br /&gt;53.	What is indexing and what are the different kinds of indexing?&lt;br /&gt;Indexing is a technique for determining how quickly specific data can be found.&lt;br /&gt;Types:&lt;br /&gt;	Binary search style indexing&lt;br /&gt;	B-Tree indexing&lt;br /&gt;	Inverted list indexing&lt;br /&gt;	Memory resident table&lt;br /&gt;	Table indexing&lt;br /&gt;&lt;br /&gt;54.	What is system catalog or catalog relation? How is better known as?&lt;br /&gt;A RDBMS maintains a description of all the data that it contains, information about every relation and index that it contains. This information is stored in a collection of relations maintained by the system called metadata. It is also called data dictionary.&lt;br /&gt;&lt;br /&gt;55.	What is meant by query optimization?&lt;br /&gt;The phase that identifies an efficient execution plan for evaluating a query that has the least estimated cost is referred to as query optimization.&lt;br /&gt;&lt;br /&gt;56.	What is join dependency and inclusion dependency?&lt;br /&gt;Join Dependency:&lt;br /&gt;		A Join dependency is generalization of Multivalued dependency.A JD {R1, R2, ..., Rn} is said to hold over a relation R if R1, R2, R3, ..., Rn is a lossless-join decomposition of R . There is no set of sound and complete inference rules for JD.&lt;br /&gt;	Inclusion Dependency:&lt;br /&gt;		An Inclusion Dependency is a statement of the form that some columns of a relation are contained in other columns. A foreign key constraint is an example of inclusion dependency.&lt;br /&gt;&lt;br /&gt;57.	What is durability in DBMS?&lt;br /&gt;Once the DBMS informs the user that a transaction has successfully completed, its effects should persist even if the system crashes before all its changes are reflected on disk. This property is called durability.&lt;br /&gt;&lt;br /&gt;58.	What do you mean by atomicity and aggregation?&lt;br /&gt;Atomicity:&lt;br /&gt;Either all actions are carried out or none are. Users should not have to worry about the effect of incomplete transactions. DBMS ensures this by undoing the actions of incomplete transactions.&lt;br /&gt;	Aggregation:&lt;br /&gt;	A concept which is used to model a relationship between a collection of entities and relationships. It is used when we need to express a relationship among relationships.&lt;br /&gt;&lt;br /&gt;59.	What is a Phantom Deadlock?&lt;br /&gt;In distributed deadlock detection, the delay in propagating local information might cause the deadlock detection algorithms to identify deadlocks that do not really exist. Such situations are called phantom deadlocks and they lead to unnecessary aborts.&lt;br /&gt;&lt;br /&gt;60.	What is a checkpoint and When does it occur?&lt;br /&gt;A Checkpoint is like a snapshot of the DBMS state. By taking checkpoints, the DBMS can reduce the amount of work to be done during restart in the event of subsequent crashes.&lt;br /&gt;&lt;br /&gt;61.	What are the different phases of transaction?&lt;br /&gt;Different phases are&lt;br /&gt;	Analysis phase&lt;br /&gt;	Redo Phase&lt;br /&gt;	Undo phase&lt;br /&gt;&lt;br /&gt;62.	What do you mean by flat file database?&lt;br /&gt;It is a database in which there are no programs or user access languages. It has no cross-file capabilities but is user-friendly and provides user-interface management.&lt;br /&gt;&lt;br /&gt;63.	What is "transparent DBMS"?&lt;br /&gt;It is one, which keeps its Physical Structure hidden from user.&lt;br /&gt;&lt;br /&gt;64.	Brief theory of Network, Hierarchical schemas and their properties&lt;br /&gt;Network schema uses a graph data structure to organize records example for such a database management system is CTCG while a hierarchical schema uses a tree data structure example for such a system is IMS.&lt;br /&gt;&lt;br /&gt;65.	What is a query?&lt;br /&gt;	A query with respect to DBMS relates to user commands that are used to interact with a data base. The query language can be classified into data definition language and data manipulation language.&lt;br /&gt;&lt;br /&gt;66.	What do you mean by Correlated subquery?&lt;br /&gt;	Subqueries, or nested queries, are used to bring back a set of rows to be used by the parent query. Depending on how the subquery is written, it can be executed once for the parent query or it can be executed once for each row returned by the parent query. If the subquery is executed for each row of the parent, this is called a correlated subquery. &lt;br /&gt;A correlated subquery can be easily identified if it contains any references to the parent subquery columns in its WHERE clause. Columns from the subquery cannot be referenced anywhere else in the parent query. The following example demonstrates a non-correlated subquery. &lt;br /&gt; E.g. Select * From CUST Where '10/03/1990' IN (Select ODATE From ORDER Where CUST.CNUM = ORDER.CNUM)&lt;br /&gt;&lt;br /&gt;67.	What are the primitive operations common to all record management systems?&lt;br /&gt;Addition, deletion and modification.&lt;br /&gt;&lt;br /&gt;68.	Name the buffer in which all the commands that are typed in are stored&lt;br /&gt;	‘Edit’ Buffer&lt;br /&gt;&lt;br /&gt;69.	What are the unary operations in Relational Algebra?&lt;br /&gt;	PROJECTION and SELECTION.&lt;br /&gt;&lt;br /&gt;70.	Are the resulting relations of PRODUCT and JOIN operation the same?&lt;br /&gt;	No.&lt;br /&gt;	PRODUCT: Concatenation of every row in one relation with every row in another.&lt;br /&gt;	JOIN: Concatenation of rows from one relation and related rows from another.&lt;br /&gt;&lt;br /&gt;71.	What is RDBMS KERNEL?&lt;br /&gt;	Two important pieces of RDBMS architecture are the kernel, which is the software, and the data dictionary, which consists of the system-level data structures used by the kernel to manage the database&lt;br /&gt;	You might think of an RDBMS as an operating system (or set of subsystems), designed specifically for controlling data access; its primary functions are storing, retrieving, and securing data. An RDBMS maintains its own list of authorized users and their associated privileges; manages memory caches and paging; controls locking for concurrent resource usage; dispatches and schedules user requests; and manages space usage within its table-space structures&lt;br /&gt;.&lt;br /&gt;72.	Name the sub-systems of a RDBMS&lt;br /&gt;	I/O, Security, Language Processing, Process Control, Storage Management, Logging and Recovery, Distribution Control, Transaction Control, Memory Management, Lock Management&lt;br /&gt;&lt;br /&gt;73.	Which part of the RDBMS takes care of the data dictionary? How&lt;br /&gt;	Data dictionary is a set of tables and database objects that is stored in a special area of the database and maintained exclusively by the kernel.&lt;br /&gt;&lt;br /&gt;74.	What is the job of the information stored in data-dictionary?&lt;br /&gt;	The information in the data dictionary validates the existence of the objects, provides access to them, and maps the actual physical storage location. &lt;br /&gt;&lt;br /&gt;75.	Not only RDBMS takes care of locating data it also &lt;br /&gt;	determines an optimal access path to store or retrieve the data&lt;br /&gt;&lt;br /&gt;76.	How do you communicate with an RDBMS?&lt;br /&gt;	You communicate with an RDBMS using Structured Query Language (SQL)&lt;br /&gt;&lt;br /&gt;77.	Define SQL and state the differences between SQL and other conventional programming Languages&lt;br /&gt;SQL is a nonprocedural language that is designed specifically for data access operations on normalized relational database structures. The primary difference between SQL and other conventional programming languages is that SQL statements specify what data operations should be performed rather than how to perform them. &lt;br /&gt;&lt;br /&gt;78.	Name the three major set of files on disk that compose a database in Oracle&lt;br /&gt;There are three major sets of files on disk that compose a database. All the files are binary.  These are&lt;br /&gt;	Database files &lt;br /&gt;	Control files &lt;br /&gt;	Redo logs &lt;br /&gt;The most important of these are the database files where the actual data resides. The control files and the redo logs support the functioning of the architecture itself. &lt;br /&gt;All three sets of files must be present, open, and available to Oracle for any data on the database to be useable. Without these files, you cannot access the database, and the database administrator might have to recover some or all of the database using a backup, if there is one. &lt;br /&gt;&lt;br /&gt;79.	What is an Oracle Instance?&lt;br /&gt;The Oracle system processes, also known as Oracle background processes, provide functions for the user processes—functions that would otherwise be done by the user processes themselves&lt;br /&gt;Oracle database-wide system memory is known as the SGA, the system global area or shared global area. The data and control structures in the SGA are shareable, and all the Oracle background processes and user processes can use them. &lt;br /&gt;The combination of the SGA and the Oracle background processes is known as an Oracle instance&lt;br /&gt;&lt;br /&gt;80.	What are the four Oracle system processes that must always be up and running for the database to be useable&lt;br /&gt;	The four Oracle system processes that must always be up and running for the database to be useable include DBWR (Database Writer), LGWR (Log Writer), SMON (System Monitor), and PMON (Process Monitor). &lt;br /&gt;&lt;br /&gt;81.	What are database files, control files and log files. How many of these files should a database have at least? Why?&lt;br /&gt;Database Files &lt;br /&gt;The database files hold the actual data and are typically the largest in size. Depending on their sizes, the tables (and other objects) for all the user accounts can go in one database file—but that's not an ideal situation because it does not make the database structure very flexible for controlling access to storage for different users, putting the database on different disk drives, or backing up and restoring just part of the database. &lt;br /&gt;You must have at least one database file but usually, more than one files are used. In terms of accessing and using the data in the tables and other objects, the number (or location) of the files is immaterial. &lt;br /&gt;The database files are fixed in size and never grow bigger than the size at which they were created&lt;br /&gt;Control Files &lt;br /&gt;The control files and redo logs support the rest of the architecture. Any database must have at least one control file, although you typically have more than one to guard against loss. The control file records the name of the database, the date and time it was created, the location of the database and redo logs, and the synchronization information to ensure that all three sets of files are always in step. Every time you add a new database or redo log file to the database, the information is recorded in the control files. &lt;br /&gt;Redo Logs &lt;br /&gt;Any database must have at least two redo logs. These are the journals for the database; the redo logs record all changes to the user objects or system objects. If any type of failure occurs, the changes recorded in the redo logs can be used to bring the database to a consistent state without losing any committed transactions. In the case of non-data loss failure, Oracle can apply the information in the redo logs automatically without intervention from the DBA. &lt;br /&gt;The redo log files are fixed in size and never grow dynamically from the size at which they were created. &lt;br /&gt;&lt;br /&gt;82.	What is ROWID?&lt;br /&gt;	The ROWID is a unique database-wide physical address for every row on every table. Once assigned (when the row is first inserted into the database), it never changes until the row is deleted or the table is dropped. &lt;br /&gt;The ROWID consists of the following three components, the combination of which uniquely identifies the physical storage location of the row. &lt;br /&gt;	Oracle database file number, which contains the block with the rows&lt;br /&gt;	Oracle block address, which contains the row &lt;br /&gt;	The row within the block (because each block can hold many rows) &lt;br /&gt;The ROWID is used internally in indexes as a quick means of retrieving rows with a particular key value. Application developers also use it in SQL statements as a quick way to access a row once they know the ROWID&lt;br /&gt;&lt;br /&gt;83.	What is Oracle Block? Can two Oracle Blocks have the same address?&lt;br /&gt;	Oracle "formats" the database files into a number of Oracle blocks when they are first created—making it easier for the RDBMS software to manage the files and easier to read data into the memory areas. &lt;br /&gt;The block size should be a multiple of the operating system block size. Regardless of the block size, the entire block is not available for holding data; Oracle takes up some space to manage the contents of the block. This block header has a minimum size, but it can grow. &lt;br /&gt;These Oracle blocks are the smallest unit of storage. Increasing the Oracle block size can improve performance, but it should be done only when the database is first created. &lt;br /&gt;Each Oracle block is numbered sequentially for each database file starting at 1. Two blocks can have the same block address if they are in different database files. &lt;br /&gt;&lt;br /&gt;84.	What is database Trigger?&lt;br /&gt;	A database trigger is a PL/SQL block that can defined to automatically execute for insert, update, and delete statements against a table. The trigger can e defined to execute once for the entire statement or once for every row that is inserted, updated, or deleted. For any one table, there are twelve events for which you can define database triggers. A database trigger can call database procedures that are also written in PL/SQL. &lt;br /&gt;&lt;br /&gt;85.	Name two utilities that Oracle provides, which are use for backup and recovery.&lt;br /&gt;	Along with the RDBMS software, Oracle provides two utilities that you can use to back up and restore the database. These utilities are Export and Import. &lt;br /&gt;The Export utility dumps the definitions and data for the specified part of the database to an operating system binary file. The Import utility reads the file produced by an export, recreates the definitions of objects, and inserts the data&lt;br /&gt;If Export and Import are used as a means of backing up and recovering the database, all the changes made to the database cannot be recovered since the export was performed. The best you can do is recover the database to the time when the export was last performed. &lt;br /&gt;&lt;br /&gt;86.	What are stored-procedures? And what are the advantages of using them.&lt;br /&gt;Stored procedures are database objects that perform a user defined operation. A stored procedure can have a set of compound SQL statements. A stored procedure executes the SQL commands and returns the result to the client. Stored procedures are used to reduce network traffic.&lt;br /&gt;&lt;br /&gt;87.	How are exceptions handled in PL/SQL? Give some of the internal exceptions' name&lt;br /&gt;	PL/SQL exception handling is a mechanism for dealing with run-time errors encountered during procedure execution. Use of this mechanism enables execution to continue if the error is not severe enough to cause procedure termination. &lt;br /&gt;The exception handler must be defined within a subprogram specification. Errors cause the program to raise an exception with a transfer of control to the exception-handler block. After the exception handler executes, control returns to the block in which the handler was defined. If there are no more executable statements in the block, control returns to the caller. &lt;br /&gt;User-Defined Exceptions &lt;br /&gt;PL/SQL enables the user to define exception handlers in the declarations area of subprogram specifications. User accomplishes this by naming an exception as in the following example: &lt;br /&gt;		ot_failure  EXCEPTION;&lt;br /&gt;In this case, the exception name is ot_failure. Code associated with this handler is written in the EXCEPTION specification area as follows: &lt;br /&gt;EXCEPTION&lt;br /&gt;      when OT_FAILURE then&lt;br /&gt;        out_status_code := g_out_status_code;&lt;br /&gt;        out_msg         := g_out_msg;&lt;br /&gt;The following is an example of a subprogram exception: &lt;br /&gt;EXCEPTION&lt;br /&gt;      when NO_DATA_FOUND then&lt;br /&gt;        g_out_status_code := 'FAIL';&lt;br /&gt;        RAISE ot_failure;&lt;br /&gt;Within this exception is the RAISE statement that transfers control back to the ot_failure exception handler. This technique of raising the exception is used to invoke all user-defined exceptions. &lt;br /&gt;System-Defined Exceptions &lt;br /&gt;Exceptions internal to PL/SQL are raised automatically upon error. NO_DATA_FOUND is a system-defined exception. Table below gives a complete list of internal exceptions. &lt;br /&gt;&lt;br /&gt;PL/SQL internal exceptions. &lt;br /&gt;&lt;br /&gt;Exception Name&lt;br /&gt;Oracle Error&lt;br /&gt;CURSOR_ALREADY_OPEN	ORA-06511&lt;br /&gt;DUP_VAL_ON_INDEX	ORA-00001&lt;br /&gt;INVALID_CURSOR	ORA-01001&lt;br /&gt;INVALID_NUMBER	ORA-01722&lt;br /&gt;LOGIN_DENIED	ORA-01017&lt;br /&gt;NO_DATA_FOUND	ORA-01403&lt;br /&gt;NOT_LOGGED_ON	ORA-01012&lt;br /&gt;PROGRAM_ERROR	ORA-06501&lt;br /&gt;STORAGE_ERROR	ORA-06500&lt;br /&gt;TIMEOUT_ON_RESOURCE	ORA-00051&lt;br /&gt;TOO_MANY_ROWS	ORA-01422&lt;br /&gt;TRANSACTION_BACKED_OUT	ORA-00061&lt;br /&gt;VALUE_ERROR	ORA-06502&lt;br /&gt;ZERO_DIVIDE	ORA-01476&lt;br /&gt;&lt;br /&gt;In addition to this list of exceptions, there is a catch-all exception named OTHERS that traps all errors for which specific error handling has not been established.&lt;br /&gt;&lt;br /&gt;88.	Does PL/SQL support "overloading"? Explain&lt;br /&gt;	The concept of overloading in PL/SQL relates to the idea that you can define procedures and functions with the same name. PL/SQL does not look only at the referenced name, however, to resolve a procedure or function call. The count and data types of formal parameters are also considered. &lt;br /&gt;PL/SQL also attempts to resolve any procedure or function calls in locally defined packages before looking at globally defined packages or internal functions. To further ensure calling the proper procedure, you can use the dot notation. Prefacing a procedure or function name with the package name fully qualifies any procedure or function reference. &lt;br /&gt;&lt;br /&gt;89.	Tables derived from the ERD &lt;br /&gt;	a) Are totally unnormalised&lt;br /&gt;	b) Are always in 1NF&lt;br /&gt;	c) Can be further denormalised&lt;br /&gt;	d) May have multi-valued attributes&lt;br /&gt;&lt;br /&gt; (b) Are always in 1NF&lt;br /&gt;&lt;br /&gt;90.	Spurious tuples may occur due to&lt;br /&gt;       i. Bad normalization  &lt;br /&gt;      ii. Theta joins&lt;br /&gt;     iii. Updating tables from join&lt;br /&gt;	a) i &amp; ii			b) ii &amp; iii&lt;br /&gt;	c) i &amp; iii			d) ii &amp; iii&lt;br /&gt;&lt;br /&gt; (a) i &amp; iii  because  theta joins are joins made on keys that are not primary keys.&lt;br /&gt;&lt;br /&gt;91.	A B C is a set of attributes. The functional dependency is as follows&lt;br /&gt;      AB  -&gt;   B&lt;br /&gt;      AC -&gt;    C&lt;br /&gt;         C -&gt;    B&lt;br /&gt;	a) is in 1NF&lt;br /&gt;	b) is in 2NF&lt;br /&gt;	c) is in 3NF&lt;br /&gt;	d) is in BCNF&lt;br /&gt;&lt;br /&gt; (a) is in 1NF since (AC)+ = { A, B, C} hence AC is the primary key. Since         C       B is a FD given, where neither C is a Key nor B is a prime attribute, this it is not in 3NF. Further B is not functionally dependent on key AC thus it is not in 2NF.  Thus the given FDs is in 1NF. &lt;br /&gt;&lt;br /&gt;92.	In mapping of ERD to DFD &lt;br /&gt;	a) entities in ERD should correspond to an existing entity/store in DFD&lt;br /&gt;	b) entity in DFD is converted to attributes of an entity in ERD&lt;br /&gt;	c) relations in ERD has 1 to 1 correspondence to processes in DFD&lt;br /&gt;	d) relationships in ERD has 1 to 1 correspondence to flows in DFD&lt;br /&gt;&lt;br /&gt; (a) entities in ERD should correspond to an existing entity/store in DFD&lt;br /&gt;&lt;br /&gt;93.	A dominant entity is the entity&lt;br /&gt;	a) on the N side in a 1 : N relationship&lt;br /&gt;	b) on the 1 side in a 1 : N relationship&lt;br /&gt;	c) on either side in a 1 : 1 relationship&lt;br /&gt;	d) nothing to do with 1 : 1 or 1 : N relationship&lt;br /&gt;&lt;br /&gt;(b) on the 1 side in a 1 : N relationship&lt;br /&gt;&lt;br /&gt;94.	Select  'NORTH', CUSTOMER From CUST_DTLS Where REGION = 'N' Order By &lt;br /&gt;CUSTOMER Union Select  'EAST', CUSTOMER From CUST_DTLS Where REGION = 'E' Order By CUSTOMER&lt;br /&gt;The above is&lt;br /&gt;	a) Not an error&lt;br /&gt;	b) Error - the string in single quotes 'NORTH' and 'SOUTH'&lt;br /&gt;	c) Error - the string should be in double quotes&lt;br /&gt;	d) Error -  ORDER BY clause&lt;br /&gt;&lt;br /&gt;(d)  Error - the ORDER BY clause. Since ORDER BY clause cannot be used in UNIONS&lt;br /&gt;&lt;br /&gt;95.	What is Storage Manager?  &lt;br /&gt;It is a program module that provides the interface between the low-level data stored in database, application programs and queries submitted to the system.    &lt;br /&gt;  &lt;br /&gt;96.	What is Buffer Manager?&lt;br /&gt;It is
