<?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-9179416692752405527</id><updated>2011-12-17T20:36:14.129-08:00</updated><category term='Adobe'/><category term='Microsoft'/><category term='Data Structures and Algorithms'/><category term='NetApp'/><category term='Amazon'/><category term='Interviews'/><category term='Hughes systique'/><category term='Sun Microsystems'/><category term='Sasken'/><category term='Cisco'/><category term='DEShaw'/><category term='Citrix'/><category term='Avishkar08'/><category term='Yahoo'/><category term='Google'/><category term='Solid Core'/><title type='text'>programming Interviews</title><subtitle type='html'>Welcome to Programming interviews blog</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>92</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3064903968927468278</id><published>2008-11-04T23:00:00.000-08:00</published><updated>2008-11-04T23:01:20.713-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Citrix'/><title type='text'>Citrix interview questions</title><content type='html'>1)Explain an algorithm for path planning in a given map.&lt;br /&gt;&lt;br /&gt;2)Write a code to find the shortest path in a given graph.&lt;br /&gt;&lt;br /&gt;3)Write a code for minimal spanning tree&lt;br /&gt;&lt;br /&gt;4)How do you find existence of a cycle in the given graph.&lt;br /&gt;&lt;br /&gt;5)Explain OSI model.&lt;br /&gt;&lt;br /&gt;6)How do you find out the sizeof an object in Java.&lt;br /&gt;&lt;br /&gt;7)Given a byte, write a code to swap every two bits. [Using bit operators] Eg: Input: 10 01 11 01 Output: 01 10 11 10&lt;br /&gt;&lt;br /&gt;8)Write a Shell code which takes in as input several files and replaces each occurance of word “Nishant” with word “reddy”.&lt;br /&gt;&lt;br /&gt;9)What is VPN ?&lt;br /&gt;&lt;br /&gt;10)What are TCP/IP protocol , Routing algorithms , P2P file sharing , Routing protocols.&lt;br /&gt;&lt;br /&gt;11)Implement the above protocols in C.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3064903968927468278?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3064903968927468278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3064903968927468278' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3064903968927468278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3064903968927468278'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/11/citrix-interview-questions_04.html' title='Citrix interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5908955751702844220</id><published>2008-11-04T22:59:00.000-08:00</published><updated>2008-11-04T23:00:19.934-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Citrix'/><title type='text'>Citrix Written exam</title><content type='html'>11. Find the slope of the line joining the points (0,2) and (3, -2)&lt;br /&gt;a. -4/3&lt;br /&gt;b. ¾&lt;br /&gt;c. -3/4&lt;br /&gt;d. 4/3&lt;br /&gt;&lt;br /&gt;12. Solve for x in x^3+3x^2+5x+9=6&lt;br /&gt;a. -1&lt;br /&gt;b. 1&lt;br /&gt;c. -2&lt;br /&gt;d. -3&lt;br /&gt;&lt;br /&gt;13. 73 to the base x is equivalent to 51 to the base y. which of the following may be the possible values of x and y&lt;br /&gt;a. 10, 12&lt;br /&gt;b. 8, 16&lt;br /&gt;c. 9, 13&lt;br /&gt;d. 8, 12&lt;br /&gt;&lt;br /&gt;14. Which of the following is independent of the operating system and machine architecture&lt;br /&gt;a. linker&lt;br /&gt;b. loader&lt;br /&gt;c. compiler&lt;br /&gt;d. debugger&lt;br /&gt;&lt;br /&gt;15. Which of the following restricts a process to the memory allocated to it&lt;br /&gt;a. stack pointers&lt;br /&gt;b. memory allocation hardware&lt;br /&gt;c. kernel&lt;br /&gt;d. none of these&lt;br /&gt;&lt;br /&gt;16. When a user logs out, what happens to the processes created by him?&lt;br /&gt;a. they’ll be killed&lt;br /&gt;b. aborted&lt;br /&gt;c. hang&lt;br /&gt;d. none of these&lt;br /&gt;&lt;br /&gt;17. What is the output of&lt;br /&gt;Main()&lt;br /&gt;{&lt;br /&gt;Struct node {&lt;br /&gt;Int a;&lt;br /&gt;Int b;&lt;br /&gt;Int c;&lt;br /&gt;};&lt;br /&gt;Struct node a = {2,4,5};&lt;br /&gt;Struct node *st;&lt;br /&gt;St = &amp;a;&lt;br /&gt;Printf(“%d”, *(int *)st);&lt;br /&gt;}&lt;br /&gt;a. 2&lt;br /&gt;b. 3&lt;br /&gt;c. 7&lt;br /&gt;d. 11&lt;br /&gt;&lt;br /&gt;18. What is the output of&lt;br /&gt;Struct outer{&lt;br /&gt;Struct inner{&lt;br /&gt;Int a = 10;&lt;br /&gt;}&lt;br /&gt;Int b = 5;&lt;br /&gt;}&lt;br /&gt;Main()&lt;br /&gt;{&lt;br /&gt;Struct inner new;&lt;br /&gt;Printf(“%d”, new.a)&lt;br /&gt;}&lt;br /&gt;a. It will give a compilation error&lt;br /&gt;b. 10&lt;br /&gt;c. 5&lt;br /&gt;d. 15earrange?blogID=9179416692752405527&lt;br /&gt;&lt;br /&gt;19. Thrashing is solved by&lt;br /&gt;a. increasing cpu bound processes&lt;br /&gt;b. reducing the degree of multi-programming&lt;br /&gt;c. increasing user processes&lt;br /&gt;d. none of these&lt;br /&gt;&lt;br /&gt;20. If t` is the reverse of t then what is the reverse of trs&lt;br /&gt;a. s’r’t’&lt;br /&gt;b. srt&lt;br /&gt;c. t’r’s’&lt;br /&gt;d. t’rs’&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5908955751702844220?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5908955751702844220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5908955751702844220' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5908955751702844220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5908955751702844220'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/11/citrix-written-exam.html' title='Citrix Written exam'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-751079662001119711</id><published>2008-11-04T22:28:00.000-08:00</published><updated>2008-11-04T22:52:09.674-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Citrix'/><title type='text'>Citrix Interview questions</title><content type='html'>&lt;p style="margin: 9px 0pt 3px; color: rgb(85, 85, 85); font-family: Georgia,Helvetica,Arial,Sans-Serif; line-height: 140%; font-size: 13px;"&gt; &lt;span&gt;Posted:&lt;/span&gt; 04 Nov 2008 07:44 AM CST&lt;/p&gt; 1. What is the output of this statement ?&lt;br /&gt;Printf(“%d”,printf(“%d %d”,2,2) &amp;amp; printf(“%d %d ”, 2, 2));&lt;br /&gt;a. 22222&lt;br /&gt;b. 22221&lt;br /&gt;c. It will give an error during compilation&lt;br /&gt;&lt;br /&gt;2. What is the output of this code snippet&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;main()&lt;br /&gt;{        int *p[10];&lt;br /&gt;        printf("%d %d\n",sizeof(*p),sizeof(p));&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. Function inlining is best used when&lt;br /&gt;a. In a small recursive function&lt;br /&gt;b. In large function where number of variables used is small&lt;br /&gt;c. In a large function where there are many loops and number of variables used is small&lt;br /&gt;d. None of these&lt;br /&gt;&lt;br /&gt;4. If there is a large quantum in round robin it will be equivalent to&lt;br /&gt;a. First come first serve&lt;br /&gt;b. Shortest job first&lt;br /&gt;c. Least recently used&lt;br /&gt;d. None of these&lt;br /&gt;&lt;br /&gt;5 . which of the following will lead to starvation&lt;br /&gt;a. Fifo&lt;br /&gt;b. Shortest job first&lt;br /&gt;c. Round robin&lt;br /&gt;d. Least recently used&lt;br /&gt;&lt;br /&gt;6 . if the address space is 192.168.36.16/28 which of the following  is the broadcast ip&lt;br /&gt;a. 192.168.36.0&lt;br /&gt;b. 192.168.36.1&lt;br /&gt;c. 192.168.36.255&lt;br /&gt;d. 192.168.36.31&lt;br /&gt;&lt;br /&gt;7. if there are 9 yellow balls, 3 red balls and 2 green balls. What is the probability that the second ball picked is yellow given the first ball is yellow&lt;br /&gt;a. 8/13&lt;br /&gt;b. 9/13&lt;br /&gt;c. 8/14&lt;br /&gt;d. 9/14&lt;br /&gt;&lt;br /&gt;8.  How many processes are created in this snippet?&lt;br /&gt;Main()&lt;br /&gt;{&lt;br /&gt; Fork();&lt;br /&gt; Fork() &amp;amp;&amp;amp; fork () || fork ();&lt;br /&gt; Fork ();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a. 15&lt;br /&gt;b.  19&lt;br /&gt;c.  21&lt;br /&gt;d.  27&lt;br /&gt;e. 31&lt;br /&gt;&lt;br /&gt;9. which of the following is TRUE about the declaration const char * p&lt;br /&gt;a. the pointer cannot be changed but the value to which it points can be changed&lt;br /&gt;b. the value is constant but the pointer can be changed&lt;br /&gt;c. neither the value nor the pointer can be changed&lt;br /&gt;d. none of these&lt;br /&gt;&lt;br /&gt;10. If F and L are the pointers to the first and last elements in a linked list, then which of the following operations is dependent on the length of the list?&lt;br /&gt;a. delete the first element in the list&lt;br /&gt;b. insert a new element as a first element&lt;br /&gt;c. delete the last element of the list&lt;br /&gt;d. add a new element at the end of the list&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-751079662001119711?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/751079662001119711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=751079662001119711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/751079662001119711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/751079662001119711'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/11/citrix-interview-questions.html' title='Citrix Interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2767449183655163502</id><published>2008-09-06T17:43:00.000-07:00</published><updated>2008-09-06T17:49:03.388-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Avishkar08'/><title type='text'>Its Avishkar 08  Time at MNNIT Allahabad</title><content type='html'>&lt;p style="text-align: justify;"&gt;&lt;strong&gt;&lt;a href="http://avishkar.mnnit.ac.in"&gt;Avishkar&lt;/a&gt; &lt;/strong&gt;is  the annual techno-management symposium of &lt;a href="http://www.mnnit.ac.in"&gt;&lt;strong&gt;MNNIT  Allahabad&lt;/strong&gt;&lt;/a&gt;. Avishkar hosts a galaxy of events aimed at boosting the technological and managerial skills inherent in today's youth. It provides them with an opportunity to showcase their innovative ideas as well as learn and implement new skills in the fields of technology and management. &lt;/p&gt;             &lt;p&gt;Apart from events Avishkar also hosts a series of guest lectures and workshops by eminent personalities from the industry and the academia. The latest edition of the festival is scheduled to be held from &lt;strong&gt;17th September – 19th September  2008.&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;please don't miss it .&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Check out the site : &lt;a href="http://avishkar.mnnit.ac.in"&gt;www.avishkar.mnnit.ac.in&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Don't miss the &lt;a href="http://avishkar.mnnit.ac.in/avishkar2008/programming_contest.html"&gt;Online Programming Cont&lt;/a&gt;&lt;a href="http://avishkar.mnnit.ac.in/avishkar2008/programming_contest.html"&gt;est&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2767449183655163502?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2767449183655163502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2767449183655163502' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2767449183655163502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2767449183655163502'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/09/its-avishkar-08-time-at-mnnit-allahabad.html' title='Its Avishkar 08  Time at MNNIT Allahabad'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7327859369488971925</id><published>2008-09-06T17:40:00.000-07:00</published><updated>2008-09-06T17:54:11.447-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NetApp'/><title type='text'>NETAPP interview questions MNNIT Allahabad</title><content type='html'>&lt;span style="font-weight: bold;"&gt;NETAPP-AUGUST 2008 MNNIT ALLAHABAD&lt;/span&gt;&lt;br /&gt;---------------------------------------------------&lt;br /&gt;&lt;span style="font-size:130%;"&gt;1.WRITTEN-1:30 min&lt;/span&gt;&lt;br /&gt;--------------------------------------------------&lt;br /&gt;(Courtesy Utsav Kumar Goyal)&lt;br /&gt;it consisted of 4 sections.&lt;br /&gt;1st section was quantitative aptitude. questions on pipe-cistern,work,percentages,profit loss etc.,&lt;br /&gt;&lt;br /&gt;2nd section was c. this was the easiest of all as nearly all questions were from test ur c skills...but all good questions only.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3rd section was ADA.. i.e algorithms. questions were mixed easy as well as hard. some basic questions like a tree is given wat is inorder traversal. some complex questions like the complexity. there were even questions on Graphs.&lt;br /&gt;&lt;br /&gt;4th section was Systems. questions were tricky. questions on race conditions.segmentation faults.code was given and race condition wat is final output.&lt;br /&gt;int a[100];&lt;br /&gt;for(i=0;i&lt;=100;i++) a[i]=i; wat will happen?? questions on signals.... &lt;span style="font-size:130%;"&gt;&lt;br /&gt;------------INTERVIEW- -----------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The written was followed by interviews. 1st- it was 20-25 min interview. mostly on c and systems(my aoi) questions&lt;br /&gt;1)THEY ASKED A CODE FROM C SECTION.&lt;br /&gt;char *func(char *p)&lt;br /&gt;{&lt;br /&gt; p=p+3;//change local variable&lt;br /&gt;  return p;&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt; char *y="HELLO";&lt;br /&gt;  y=func(y);//although call by value but u end up changing original variable&lt;br /&gt;  printf("%d",y);&lt;br /&gt;}&lt;br /&gt;ans:LO now he asked is this call by value or call by reference.this is tricky because u end up changing ptr y. although this is call by value. this is because u r returning value and storing in same variable y.&lt;br /&gt;2)then wat is difference in file pointer and file descriptor.(read K-R unix interface chapter).&lt;br /&gt;3)i give u a 512 mb ram. wat will be there in it??&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;2nd interview 2 puzzles&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1- u have a scooter. and 3 tyres. each tyre has a max life of 1 yr. wat is the max tym u can run ur scooter.&lt;br /&gt;ans: 1.5 yrs 1-6 nnths 1,2 tyre replace 1st with 3rd after 1 yr 2nd finished. so replace it by 1st after 1.5 yrs total tyre=0:&lt;br /&gt;2-u r given a disk. half black half white. its rotating. u have to make sum system using sensors etc. so that a computer can tell the direction in which the disc is rotating.&lt;br /&gt;&lt;br /&gt;3-He asked me about the question from the written paper about race conditions and segmentation fault. this discussion went on and on.&lt;br /&gt;what is segmentation fault?? who gets to know that there is segmentation fault. i said kernel. i said it sends a SIGSEGV signal. if u have a[100] array wat will happen when u assign a[102]?? ok now if i have a[100] and b[100] wat will happen now when i acess a[102]??? the correct answrs were ...there are segment registers in hardware..they give an exceptions to kernel which then generate SIGSEV...........read M.J Bach for furthur reference.&lt;br /&gt;so all in all the interview was Fucked..... :(&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;3rd interview)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ist question on project. around 10 mins on that. then write a code that will for sure generate segmentation fault.write a code to delete any node in a link list. with all test cases and boundary conditions.(easy stuff)&lt;br /&gt;&lt;br /&gt;4th) Hr-- why u want to join netapp,about urself... i was the last person to be interviewed so this was very short interview.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7327859369488971925?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7327859369488971925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7327859369488971925' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7327859369488971925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7327859369488971925'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/09/netapp-interview-questios-mnnit.html' title='NETAPP interview questions MNNIT Allahabad'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-9214581741092228988</id><published>2008-09-04T18:10:00.000-07:00</published><updated>2008-09-04T18:11:33.786-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Solid Core'/><title type='text'>Solid Core Interview Questions at MNNIT (NIT Allahabad)</title><content type='html'>SOLIDCORE: R&amp;D AUG-2008 MNNIT(Courtesy -Utsav Kumar Goyal)&lt;br /&gt;WRITTEN- 1hour&lt;br /&gt;------------&lt;br /&gt;18 objective type questions to be solved in 1 hr. Questions were too good, most of them were from Probability ,permutations and combinations.(this pattern may nt repeat. pls dont take it for granted)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-----------------------&lt;br /&gt;1st Interview 1.5 hours&lt;br /&gt;-----------------------&lt;br /&gt;--&gt;&gt;why do u wanna join solidcore??&lt;br /&gt;&lt;br /&gt;---&gt;&gt;c questions having compiler related issues.&lt;br /&gt;1.wat is output&lt;br /&gt;&lt;br /&gt;i=0;&lt;br /&gt;printf("%d",i++,++i);&lt;br /&gt;or&lt;br /&gt;while(i)&lt;br /&gt;printf("%d",i++);&lt;br /&gt;or&lt;br /&gt;i=i++ + ++i;&lt;br /&gt;or&lt;br /&gt;i=i++*i++; etc. etc.&lt;br /&gt;&lt;br /&gt;---&gt; area of interest: mine was ds+os...wat book u study for ds...my answer sartaj sahni and herbert&lt;br /&gt;&lt;br /&gt;schildt...&lt;br /&gt;what about tenenbaum??.....mine answer i studied queues and stacks from it.&lt;br /&gt;&lt;br /&gt;---&gt;ur aoi is ds..wat was the code u liked the most interesting??&lt;br /&gt;mine ans: i developed a rat and maze prob. that i liked most...on this there was a ques in written&lt;br /&gt;&lt;br /&gt;about a square grid 9*9 in wat max ways can u reach from one corner to other.u can only move down or&lt;br /&gt;&lt;br /&gt;right.&lt;br /&gt;ans: at each square u can have only 2 moves down(say 0) or right(say 1)..total moves in any path =16&lt;br /&gt;so make make all possible permutations of 8 1's and 8' 0s...&lt;br /&gt;they asked me to write a code for it.&lt;br /&gt;&lt;br /&gt;---&gt;write a code for inorder traversal using recursion(easy haan??)...ok now remove the left&lt;br /&gt;&lt;br /&gt;recursion only....good now remove the right recursion only....&lt;br /&gt;&lt;br /&gt;---&gt;print a matrix helically..code&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---&gt;write a standard string reversal function...code&lt;br /&gt;some other ques i don't remember&lt;br /&gt;&lt;br /&gt;FEEDBACK:GOOD! :) BUT U CODE SLOW :(&lt;br /&gt;&lt;br /&gt;---------------------&lt;br /&gt;2nd Interview 1 hours&lt;br /&gt;---------------------&lt;br /&gt;---&gt;about urself&lt;br /&gt;&lt;br /&gt;---&gt;what is deadlock,livelock,spinlock,conditions for deadlock,mechanism for synchronisation,virtual&lt;br /&gt;&lt;br /&gt;memory etc etc. i.e all basic stuff.&lt;br /&gt;&lt;br /&gt;---&gt;area of interest os-so wat is malloc...is malloc a system call...wat it returns (explained brk&lt;br /&gt;&lt;br /&gt;sys call etc. )?? ..how does free() gets to know that how many bytes it has to free(read ritchie&lt;br /&gt;&lt;br /&gt;unix interface chapter)..&lt;br /&gt;&lt;br /&gt;---&gt;what is segmentation faults??who gets to know that seg fault occurs&lt;br /&gt;&lt;br /&gt;---&gt;what are system calls??&lt;br /&gt;---&gt;what is need of system calls??&lt;br /&gt;---&gt;when process swithes mode what happens??&lt;br /&gt;&lt;br /&gt;---&gt;what is difference in file pointer and filedescriptor...??discussed a lot on this&lt;br /&gt;---&gt;why do u need to close a file??(i gave funde like a file can have max. desc. fixed etc.)&lt;br /&gt;---&gt;what is page fault??&lt;br /&gt;---&gt;who brings in the page when page fault occurs...&lt;br /&gt;&lt;br /&gt;process makes MMU bring the page ...who is in between??&lt;br /&gt;---&gt;write a code to check if a no. is palindrome&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---&gt;a puzzle:u have 100 coins on a table 80 tails up and 20 heads up. u are blindfolded. u have to&lt;br /&gt;&lt;br /&gt;split these in two heaps not necessary of equal size so that they have equal number of tails.u can't&lt;br /&gt;&lt;br /&gt;make out a coin is heads up or tails up by feeling it or smelling it :P :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-9214581741092228988?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/9214581741092228988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=9214581741092228988' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/9214581741092228988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/9214581741092228988'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/09/solid-core-interview-questions-at-mnnit.html' title='Solid Core Interview Questions at MNNIT (NIT Allahabad)'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1805013217879748761</id><published>2008-08-31T13:40:00.000-07:00</published><updated>2008-08-31T13:41:31.206-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>Yahoo interview questions at NIT Allahabad</title><content type='html'>Yahoo questions:&lt;br /&gt;&lt;br /&gt;Written Round :&lt;br /&gt;&lt;br /&gt;1) diff betwn char *p char p[]&lt;br /&gt;&lt;br /&gt;2) min no of comparision to find min and max in an array on n elements&lt;br /&gt;&lt;br /&gt;3)least common ancestor code was given you should identify what it was&lt;br /&gt;&lt;br /&gt;4)question on recursion&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    int n=5;&lt;br /&gt;    fun(n);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;fun(int n)&lt;br /&gt;{&lt;br /&gt;    if( n = 0 )&lt;br /&gt;        return 0;&lt;br /&gt;    else&lt;br /&gt;        fun(n-1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;5)&lt;br /&gt;&lt;br /&gt;for(i=0;i&lt;10;i++);&lt;br /&gt;{&lt;br /&gt;    printf("%d",i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;6)&lt;br /&gt;&lt;br /&gt;for(i=0;i&lt;10;i++)&lt;br /&gt;{&lt;br /&gt;    for(j=0;j&lt;100;j++)&lt;br /&gt;    {&lt;br /&gt;        //do somthing&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;for(i=0;i&lt;100;i++)&lt;br /&gt;{&lt;br /&gt;    for(j=0;j&lt;10;j++)&lt;br /&gt;    {&lt;br /&gt;        //do something&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;which is fast ?&lt;br /&gt;&lt;br /&gt;7) shell script to print the total disk usage in a directory&lt;br /&gt;&lt;br /&gt;8) can 2 users have same uid and explain the file ownership and process ownership if it is possible&lt;br /&gt;&lt;br /&gt;9) command to find the network delay between 2 hosts&lt;br /&gt;&lt;br /&gt;10) what is SUID bit&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;......&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Programming round :&lt;br /&gt;unix profile:&lt;br /&gt;&lt;br /&gt;1) Given a master node computer and many slave computers you have to monitor the given parameters like disk usage , memory usage , cpu usage  and alert the master node if they cross a paticular threshold&lt;br /&gt;&lt;br /&gt;2) given a direcotry in host computer and another directory in a remote computer implement rsync between those two&lt;br /&gt;&lt;br /&gt;ds profile:&lt;br /&gt;&lt;br /&gt;3) create a simple database using file . your database should support basic operatins like insert , remove , query ( most imp ) .&lt;br /&gt;&lt;br /&gt;4) implement the grep command in C . your program should handle basic regular expressions like * , . , ^ , $&lt;br /&gt;&lt;br /&gt;Interview :&lt;br /&gt;&lt;br /&gt;1) write a program to remove blank spaces from a file&lt;br /&gt;&lt;br /&gt;2) using sed print last 10 lines from a file&lt;br /&gt;&lt;br /&gt;3) what is the techincal differences between windows and linux&lt;br /&gt;&lt;br /&gt;4) what is a daemon and what are the steps to be followed for creating a daemon&lt;br /&gt;&lt;br /&gt;5) sql queries ..( dont remember )&lt;br /&gt;&lt;br /&gt;6) regular expressions&lt;br /&gt;&lt;br /&gt;7) about project&lt;br /&gt;&lt;br /&gt;8) gave 2 puzzles one was to join 9 points uisng 4 lines and another was simple related to areas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1805013217879748761?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1805013217879748761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1805013217879748761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1805013217879748761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1805013217879748761'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/yahoo-interview-questions-at-nit.html' title='Yahoo interview questions at NIT Allahabad'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-66385203929318554</id><published>2008-08-30T19:57:00.001-07:00</published><updated>2008-08-31T13:41:50.882-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft interview questions round 5</title><content type='html'>Programming round&lt;br /&gt;Problem:&lt;br /&gt;        Input: s= “aaabbbaacc”&lt;br /&gt;        Output s=”a3b3a2c2”&lt;br /&gt;1) You are given an ambiguous problem, just a single string one statement and what is&lt;br /&gt;the output. Ask as many questions as you can ask to get a clear idea about the problem.&lt;br /&gt;2) Write the complete program for that problem.&lt;br /&gt;3) Generate the test cases and verify them.&lt;br /&gt;Answer:&lt;br /&gt;  Possible questions can be asked.&lt;br /&gt;             1) Weather the input and output are in the same variable?&lt;br /&gt;             2) Suppose you have only one element at a time like (abc) what should be&lt;br /&gt;the output weather (a1b1c1) or (abc). In first case the size of the string is increased, so of&lt;br /&gt;we use the same variable to store the output, it may access memory out of the allotted&lt;br /&gt;memory for the array?&lt;br /&gt;             3) What if digits are there in the input string?&lt;br /&gt;Those who didn’t satisfy them where taken one more round and puzzles where asked for&lt;br /&gt;them. (The person who didn’t ask any question for the above problem was given to the&lt;br /&gt;next round).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-66385203929318554?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/66385203929318554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=66385203929318554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/66385203929318554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/66385203929318554'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/ms-round-5.html' title='Microsoft interview questions round 5'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-315131688598082907</id><published>2008-08-30T19:56:00.000-07:00</published><updated>2008-08-31T13:42:38.662-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>microsoft interview questions round 4</title><content type='html'>Puzzle round&lt;br /&gt;1) There are 25 horses which runs at different speed, and you have to find out the top&lt;br /&gt;three horses, in one race you can race not more than 5 horses, find the no. of races&lt;br /&gt;required minimum.&lt;br /&gt;Answer: 7 races&lt;br /&gt;2) Question about compiler (Phases of compiler, storage of variables of different scope&lt;br /&gt;and difference between stack and heap)&lt;br /&gt;(Const, static and other types)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-315131688598082907?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/315131688598082907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=315131688598082907' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/315131688598082907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/315131688598082907'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/ms-round-4.html' title='microsoft interview questions round 4'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1115155651413210589</id><published>2008-08-30T19:55:00.000-07:00</published><updated>2008-08-31T13:43:13.693-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft interview questions round 2</title><content type='html'>Interview round&lt;br /&gt;3 panels (2 technical panels, asking to write programs and 1 panel asking to solve&lt;br /&gt;puzzles)&lt;br /&gt;1) Write a program which prints the last n lines from a file. You are given only one file&lt;br /&gt;pointer fp.&lt;br /&gt;I was asked to write all possible solutions in different ways. (I gave him 8 to 9 solutions&lt;br /&gt;for that problem).&lt;br /&gt;You can travel a file only once and you can use extra memory space.&lt;br /&gt;Use a circular queue. (Best solution)&lt;br /&gt;2) What is virtual memory?&lt;br /&gt;3) What is address space?&lt;br /&gt;4) Two processes are communicating through a socket on the same machine, in one&lt;br /&gt;program you are storing a string and passing the address of that string to other program&lt;br /&gt;through socket and the other program is printing the value at that address, what is the&lt;br /&gt;value printed&lt;br /&gt;Ans. (Different string)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1115155651413210589?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1115155651413210589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1115155651413210589' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1115155651413210589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1115155651413210589'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/ms-round-2_30.html' title='Microsoft interview questions round 2'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-75939831028939385</id><published>2008-08-30T19:54:00.002-07:00</published><updated>2008-08-30T19:55:31.801-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft interview questions round 2</title><content type='html'>Different problems were given to different persons.&lt;br /&gt;*1) You are given an Array of N size. It contains 0s and 1s only. You have to arrange all&lt;br /&gt;0s before all 1s (In the program you can’t travel more than one. Try to minimize the&lt;br /&gt;complexity).&lt;br /&gt;  e.g. Don’t swap the numbers just assign the other one to the element.&lt;br /&gt;2) Verify whether a given tree is a Binary Search Tree or Not. Write the function for it.&lt;br /&gt;*3) You are given two sorted link list A and B, merge them into single list without using&lt;br /&gt;a 3rd link list (i .e. Merge both link lists into A).&lt;br /&gt;*4) Find the angle between 2 different hand of the clock at any given time. Write the&lt;br /&gt;proper code.&lt;br /&gt;5) Now the minute hand of the clock is made 10 faster. Find the angle between them at&lt;br /&gt;any given time. E.g. At 3 o’clock the minute hand will be at 2 and the hour hand will be&lt;br /&gt;at 3.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-75939831028939385?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/75939831028939385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=75939831028939385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/75939831028939385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/75939831028939385'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/microsoft-interview-questions-round-2.html' title='Microsoft interview questions round 2'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5972346374943293069</id><published>2008-08-30T19:54:00.001-07:00</published><updated>2008-08-30T19:54:49.558-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft interview questions Round 1</title><content type='html'>1) Simple program having a function with a static variable, and the function calculates&lt;br /&gt;the sum of the digits passed to that, and stores it in the static variable (little bit modified&lt;br /&gt;sum), find the output.&lt;br /&gt;     Int main()&lt;br /&gt;   {&lt;br /&gt;    printf(“%d\n”,fun(1234));&lt;br /&gt;    printf(“%d\n”,fun(1234));&lt;br /&gt;   }&lt;br /&gt;  int fun(int num)&lt;br /&gt;  {&lt;br /&gt;   static int s;&lt;br /&gt;   while(num)&lt;br /&gt;     {&lt;br /&gt;       s = s+ num%10;&lt;br /&gt;       num = num/10;&lt;br /&gt;      if(s&gt;=10)&lt;br /&gt;        s= s%10;&lt;br /&gt;     }&lt;br /&gt; return s;&lt;br /&gt;}&lt;br /&gt;2) Consider the following code...&lt;br /&gt;char* fun(char *str)&lt;br /&gt;{&lt;br /&gt;char array[1024];&lt;br /&gt;int i =strlen(str);&lt;br /&gt;strcpy(array,str);&lt;br /&gt; array[i]='\n';&lt;br /&gt;return array;&lt;br /&gt;}&lt;br /&gt;find out the bugs in the code.(Memory Leak).&lt;br /&gt;1) Array is a local variable.(it will be deleted after the function returns, Memory leak)&lt;br /&gt;2) The size of the array is fixed.&lt;br /&gt;3) A matrix is rotated as given in the figure; find the relation between the two matrix’s.&lt;br /&gt;   Find A’[i][j]=A[__][__]&lt;br /&gt;4) Write a function that takes a single link list as input and an integer n , the function&lt;br /&gt;deletes all the nth nodes in the link list.&lt;br /&gt;For example if n=3 means delete 3rd, 6th, 9th ... nodes from the list.&lt;br /&gt;5) Write all the test cases for the above program and what errors will u take into account?&lt;br /&gt;6) You are given a document; write the algorithm for the function that counts the no. of&lt;br /&gt;occurrences of words in the document. Suppose you are provided with the function&lt;br /&gt;GetNextWord() which provides you the next word in the document and advances the&lt;br /&gt;pointer by one word.&lt;br /&gt;1) What data structure will you use for the given problem?&lt;br /&gt;2) Write the algorithm for the function?&lt;br /&gt;3) What is the complexity for your program?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5972346374943293069?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5972346374943293069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5972346374943293069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5972346374943293069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5972346374943293069'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/microsoft-interview-questions-round-1.html' title='Microsoft interview questions Round 1'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6930962897540296026</id><published>2008-08-30T19:50:00.000-07:00</published><updated>2008-08-31T13:43:44.254-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft interview questions round 3</title><content type='html'>A hi-funda tech round that I have ever been in. The atmosphere was tense; it was&lt;br /&gt;just 2 minutes before the interview that I came to know that this was going to be&lt;br /&gt;technical. I had expected atleast the last round to be HR&lt;br /&gt;    1) Code a string tokenizer&lt;br /&gt;    char* strtok(char* str, char* delimiter). Give me all the test cases.&lt;br /&gt;    Managed this nicely, felt I was the best coder on earth!&lt;br /&gt;    2) Give me a function which will print the all possible permutations (words)&lt;br /&gt;       of a sequence of digits pressed while SMSing on a mobile phone.&lt;br /&gt;Remember SMSing: 2=abc, 3=def,...9=wxyz. If the input is “239”, output should&lt;br /&gt;be:&lt;br /&gt;adw&lt;br /&gt;adx&lt;br /&gt;ady&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;cfz&lt;br /&gt;You got it right? Please imagine my situation when I was told to code this in ten&lt;br /&gt;minutes. On top of it all, I hadn’t gone through string permutation recursion the&lt;br /&gt;last night. (Last night - 18th night - was spent only on OS, after the shocker of a&lt;br /&gt;semaphore in the first round -18th evening. Not one OS question came in 2nd and&lt;br /&gt;3rd rounds – on 19th morning- though ).&lt;br /&gt;As usual, started coding with int main() {... when he cautioned me to think of an&lt;br /&gt;algo first and then code. Wrote in some code, which would never compile. But I&lt;br /&gt;love explaining my algos. Gave him a gist of my thought process, but he was&lt;br /&gt;barely happy. That guy is a compiler himself as one of my friends had told me.&lt;br /&gt;He could make out any error faster than a compiler!&lt;br /&gt;BTW, the best part was this. As I started writing my code on paper, he started&lt;br /&gt;typing something on his laptop faster than my writing speed. After 8 mins, he&lt;br /&gt;stopped to ask me if I had finished and to have a look at his output for the same&lt;br /&gt;code. I was happy that I had completed 1/4th of my code!&lt;br /&gt;&lt;br /&gt;  Thank you for the guy sharing this info&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6930962897540296026?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6930962897540296026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6930962897540296026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6930962897540296026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6930962897540296026'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/ms-round-3.html' title='Microsoft interview questions round 3'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-4710822551224211378</id><published>2008-08-30T19:49:00.000-07:00</published><updated>2008-08-31T13:44:02.388-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>microsoft interview questions round 2</title><content type='html'>This was the best round of interview I've ever had in my short life so far. It was&lt;br /&gt;partly non-tech which was a welcome change. The guy who took this is a bigshot&lt;br /&gt;at Windows kernel as I learnt only later.&lt;br /&gt;     1) He gave me a Math puzzle, walked me through the answer. Though I&lt;br /&gt;        hardly had any idea about the answer at the beginning, he kept giving me&lt;br /&gt;        so many hints that the answer became obvious to me. Now, the question&lt;br /&gt;        was to generalize this and give an algorithm to solve.&lt;br /&gt;I don’t have to the patience to type the whole question, but it was on N bags&lt;br /&gt;containing infinite balls of equal weight (1 kg each), with M (not given) bags&lt;br /&gt;containing only defective balls (900 g each). With just one weighing on an&lt;br /&gt;electronic balance, find out which M bags have defective balls.&lt;br /&gt;Hint: My answer was that picking 1+2+3+...+i+...+n balls from each ith bag would&lt;br /&gt;lead to a linear dependency problem, and the equations can’t be solved.&lt;br /&gt;(Remember Determinant != 0 to solve simultaneous equations?). So the best&lt;br /&gt;series would be a linearly independent 1+2+4+...+2^(i-1)+...2^(n-1).&lt;br /&gt;     2) He has installed an expensive, state-of-the-art parking lot system on MG&lt;br /&gt;        Road in Bangalore (wish there was one ). It parks one car every 2&lt;br /&gt;        seconds and returns it to the user, when he swipes his card. I am hired as&lt;br /&gt;        for testing this system (which made it obvious that I might be hired for&lt;br /&gt;        testing in MS). Question is whether I am ready to accept the challenge and&lt;br /&gt;        get him profits.&lt;br /&gt;He wanted me to use words like capacity, protection &amp;amp; security, user interface&lt;br /&gt;and “stress testing” (remember sitting in my Software Engineering class). I used&lt;br /&gt;all these words, and he was happy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-4710822551224211378?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/4710822551224211378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=4710822551224211378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4710822551224211378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4710822551224211378'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/ms-round-2.html' title='microsoft interview questions round 2'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1554288250219413516</id><published>2008-08-30T19:48:00.000-07:00</published><updated>2008-08-31T13:45:06.473-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsfot interview questions round 1</title><content type='html'>1) Discuss all the test cases for problem 2 in your answer paper. Does your code&lt;br /&gt;work for all these cases? If not modify them on the spot.&lt;br /&gt;(The interviewer kept staring at my pen for really long. Thankfully I didn't&lt;br /&gt;become self-conscious, since I hate people seeing my answer as I am writing )&lt;br /&gt;Initially, with full enthu, I threw some obscure test cases, only later to realize that&lt;br /&gt;my code doesn’t handle any of those.&lt;br /&gt;2) Convert the same code to a recursive one now!&lt;br /&gt;(I was like "Oh My God!" But then, after some ten minutes with the interviewer&lt;br /&gt;carefully scanning every of my letters, had something to show on the paper. He&lt;br /&gt;smiled at the end of it all ☺)&lt;br /&gt;3) Your favorite topic in the class?&lt;br /&gt;I wanted to say none, since I just wanted to get out of the room, but somehow&lt;br /&gt;i managed to say OS and DSA. He started drilling me on Semaphores and&lt;br /&gt;Monitors. Could somehow manage, though I hadn't touched OS book since IBM&lt;br /&gt;Extreme Blue interview last sem ☺. Thankfully, I managed to divert his attention&lt;br /&gt;form coding Dining Philosophers' problem! Shouldn't I be proud of that?&lt;br /&gt;Please remember: Skill to divert the interviewer's attention from the stuff you&lt;br /&gt;don't know to the stuff you know is important. This works wonders as it did to&lt;br /&gt;me. And no one expects you to know everything. So, got through round 1.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1554288250219413516?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1554288250219413516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1554288250219413516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1554288250219413516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1554288250219413516'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/ms-round-1.html' title='Microsfot interview questions round 1'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2600471236032663363</id><published>2008-08-30T19:43:00.000-07:00</published><updated>2008-08-30T19:48:19.196-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>MS interview questions</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Selection process: 1 C-Apti + 3 rounds of interview&lt;/span&gt;&lt;br /&gt;C-Aptitude TEST (5 q, 1:15 hrs)&lt;br /&gt; 1) What's the output?&lt;br /&gt;      #include &lt;stdio.h&gt;&lt;br /&gt;     e(int n)&lt;br /&gt;     {&lt;br /&gt;         if(n&gt;0)&lt;br /&gt;        {&lt;br /&gt;              e(--n);&lt;br /&gt;              printf("%d", n);&lt;br /&gt;              e(--n);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    int a=5;&lt;br /&gt;    e(a);&lt;br /&gt;    printf("%d",a);&lt;br /&gt;   }&lt;br /&gt;Ans: 0120301401205&lt;br /&gt;&lt;br /&gt;It's damn difficult to follow the stack trace unless you are patient, which I wasn't.&lt;br /&gt;Please remember, all those who made it to the interview round had written&lt;br /&gt;correct answer to this question. Though, I'm not sure if I included the last but one&lt;br /&gt;0. I might have since I made it to the interview round.&lt;br /&gt;&lt;br /&gt;2) Write a C code to swap the positions of two consecutive words in a sentence.&lt;br /&gt;Eg: "ramu is good boy"&lt;br /&gt;        "is ramu boy good"&lt;br /&gt;     Discuss the elegance of your algorithm.&lt;br /&gt;     Ans: I wrote a code with O(n) time and O(1) space complexity. This impressed     them in the interview, since many had used up a temporary space.&lt;br /&gt;    Think a bit and you will get the answer yourself.&lt;br /&gt;    3) Provide all the test cases for int atoi(char*) function in C.&lt;br /&gt;    Ans: Please try to give all possible test cases including NULL string,&lt;br /&gt;    arbitrarily huge string etc. For those of you Java freaks, this function works&lt;br /&gt;    similar to Integer.ParseInt().&lt;br /&gt;    4) Correct all the code defects in a given piece of code.&lt;br /&gt;Ans: I don't remember the whole code, but it had some strings without '\0' at the&lt;br /&gt;end etc. Was very easy to correct. (The cheapest one so far.☺)&lt;br /&gt;5) Write a function bool isBST(Tree* root) which takes a binary tree as&lt;br /&gt;input and says whether it's a binary search tree or not.&lt;br /&gt;(D E Shaw had asked this just the previous evening. So had little problem&lt;br /&gt;finishing it off in 2 min! )&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2600471236032663363?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2600471236032663363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2600471236032663363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2600471236032663363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2600471236032663363'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/ms-interview-questions.html' title='MS interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2472067756493787900</id><published>2008-08-18T22:39:00.000-07:00</published><updated>2008-08-18T23:02:33.989-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hughes systique'/><title type='text'>Hughes systique</title><content type='html'>Networking company ,package 4.0&lt;br /&gt;&lt;br /&gt;written was lil lengthy , one apti paper(30 Questions in 45min ,questions were good  ) and one technical&lt;br /&gt;&lt;br /&gt;in technical dey covered almost all subjects like OS,networking,java,c,c++&lt;br /&gt;&lt;br /&gt;interviews:&lt;br /&gt;&lt;br /&gt;2 technical interviews there was no HR (in my coll,there is no guarantee that it will be same every where).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1st round:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;tell me about urself [:P]&lt;br /&gt;&lt;br /&gt;1 .i told i love to work in Linux , so dey asked about all those distributions that i m familiar wih,like wats the difference between fedora and ubuntu,&lt;br /&gt;wat are the technical differences apart from GUI.&lt;br /&gt;have u done any big projects in linux, i told writing simple device drivers [:P].&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;den jumped to C &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2 .why size of int depends on the machine architecture (a lil bit discussion continued on that [:(])&lt;br /&gt;den wats the best sorting algo and y ?&lt;br /&gt;den to C++&lt;br /&gt;&lt;br /&gt;3. y c++ ?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;encapsulation &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4. virtual functions, base class pointer,derived class pointer,biding references.&lt;br /&gt; a reference is defined as private variable in a class. den he told me to write a constructor . asked me how the initialition is done for the reference (a lil bit discussion).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;shell scrpting &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5. find all those files that are modified since yesterday [:P]&lt;br /&gt;&lt;br /&gt;and some more in shell scripting&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;den networking &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;6. wat happens when we enter www.google.com ( i told all those how the DNS is resolved , gave an example of our college website [:P])&lt;br /&gt;7. y http protocol [:P]&lt;br /&gt;8. RPC how it works ?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;DBMS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;9. SQL query&lt;br /&gt;10. Normalization&lt;br /&gt;and a lil discussion&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;OS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;11. Dead lock avoidance,bankers algorithm&lt;br /&gt;Sheduling, the best sheduling algo ?&lt;br /&gt;&lt;br /&gt;haan thank god dey didn't ask IMP ,Environtment and ecology all those :P  hehe ..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Second round&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;some other guy took this time&lt;br /&gt;&lt;br /&gt;he was very very cool and friendly&lt;br /&gt;&lt;br /&gt;12. tell me about urself&lt;br /&gt;same here i love to work in linux&lt;br /&gt;13. he asked y like that ?&lt;br /&gt;&lt;br /&gt;14. some kernel questions&lt;br /&gt;grep ,pipe,command line mode in VIM (how to copy line, replace some pattern)&lt;br /&gt;&lt;br /&gt;15. write a code to implement memcpy() function&lt;br /&gt;&lt;br /&gt;it was only for 20 mins&lt;br /&gt;&lt;br /&gt;finally got through yaar [:P] [:D]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2472067756493787900?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2472067756493787900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2472067756493787900' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2472067756493787900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2472067756493787900'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/08/hughes-systique.html' title='Hughes systique'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6052723495922873021</id><published>2008-07-15T11:44:00.000-07:00</published><updated>2008-07-15T11:47:39.945-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>courtesy geek interview yahoo model</title><content type='html'>&lt;span class="tdvamseel"&gt;&lt;p&gt;1. In a village in each family they give birth to children till they get a boy. IF girl child they try again. What is the ratio of boys to girls.&lt;br /&gt;2. 2n+1 numbers in a list except for 1 num all had duplicates, how to find duplicate in O(n)&lt;br /&gt;3. In 1000 wine bottles stack 10 are poisoned given 10 rats what is the minimum number of tries to find the poisoned one. Rat dies once it licks the poisoned wine.&lt;br /&gt;4. Write 1,3,6,4 using +,-,*,/ to get 24 (no repeat of numbers)&lt;br /&gt;5. Which is the DS used in dictionary mode in mobile (t9)&lt;br /&gt;6. Which is DS used for chess program...to predict move each and every time..&lt;br /&gt;7. There are $1070 dollars how to split them into bags such that asked for any denomination from $1 to $1070 , u must b able to give without opening bag...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Another paper:&lt;br /&gt;1. First fit issues...&lt;br /&gt;2. Algorithm to partition set of numbers into two s.t. diff bw their sum is min and they hav equal num of elements&lt;br /&gt;3. Prog: given Numerator &amp;amp; Denominator.... print 0.3333333333 as .(3) 0.123123 as .(123)&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6052723495922873021?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6052723495922873021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6052723495922873021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6052723495922873021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6052723495922873021'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/07/courtesy-geek-interview-yahoo-model.html' title='courtesy geek interview yahoo model'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-4891009948601379249</id><published>2008-07-14T20:26:00.000-07:00</published><updated>2008-07-14T20:28:45.383-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>Yahoo interview Questions</title><content type='html'>1)Design a data structure such that given a stream of numbers, you can find the maximum of the numbers at any point and also all the numbers.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2)Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions.&lt;br /&gt;&lt;br /&gt;3)Find the common ancestor of two given nodes in a binary tree, how do you exploit the properties of a given BST for the same problem.&lt;br /&gt;&lt;br /&gt;4)Given a function getsort(data),that sorts the data given. The function sorts in place and does not use any extra memory. How do you validate the function with respect to 1)it sorts 2) it does not use extra memory&lt;br /&gt;&lt;br /&gt;5)Explain the Traveling Salesman problem? What is an NP-complete problem? What is the Hamiltonian cycle problem?&lt;br /&gt;&lt;br /&gt;6)Find out the least common ancestor in a binary tree.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-4891009948601379249?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/4891009948601379249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=4891009948601379249' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4891009948601379249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4891009948601379249'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/07/yahoo-interview-questions.html' title='Yahoo interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6923875309317520623</id><published>2008-06-29T21:55:00.001-07:00</published><updated>2008-06-29T21:55:48.923-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>Yahooooo</title><content type='html'>&lt;ol&gt;&lt;br /&gt;&lt;li&gt;A modified insertion sort uses binary search to find the position of insertion. What would be the improvement in order realized?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;class a{};&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;count &lt;&lt;&gt;&lt;br /&gt;}&lt;br /&gt;What is the output?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The linked list size is unknown and it is very large. Find out the N th element from the back end.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What happens in the following code?&lt;br /&gt;char x[10],y[10];&lt;br /&gt;x=y;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Design a stack which supports push, pop, min and max operations in O(1).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Design an NFA to accept a string of 0s and 1s.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Given a balanced BST tree, write a function to replace the root with a node that belongs to the original tree.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Explain what this function does&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;char *mystrcpy(char *s)&lt;br /&gt;{&lt;br /&gt;char des=char [MAXLEN];&lt;br /&gt;char * t=des;&lt;br /&gt;while(*s)&lt;br /&gt;{&lt;br /&gt;*++t=*++s;&lt;br /&gt;}&lt;br /&gt;return t;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Given that you have a server hit by around 400 million users, and you have log files that contain the user ids of all of them. How do you find the frequency of login of each user. (The log files are very huge!!)&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Explain Polymorphism, Encapsulation, Inheritance, operator overloading?&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6923875309317520623?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6923875309317520623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6923875309317520623' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6923875309317520623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6923875309317520623'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/06/yahooooo.html' title='Yahooooo'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2711722137420847048</id><published>2008-06-29T18:37:00.000-07:00</published><updated>2008-06-29T18:39:16.616-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DEShaw'/><title type='text'>Deshaw</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Question1&lt;/span&gt;: Differentiate HTTP and HTTPS&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question2&lt;/span&gt;: Discuss ACID properties of a database system.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question3&lt;/span&gt;: Given a table Employee with only one field: Names, report all names with multiple entries.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question4&lt;/span&gt;:Given two sequences s1,s2 and another sequence s3, find if s3 is formed by interleaving s1 and s2.[Example: s1:abcd s2:bcaa s3:abbccdaa].&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question5&lt;/span&gt;: If a class B is inherited from a class A, B has a function foo which is also in A, how do you call foo function in A??&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question6&lt;/span&gt;: If a class B is inherited public from a class A, what all the variables that can be accesses and those that cannot be.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question7&lt;/span&gt;: List out the additional features of C++ over C when the latter is already available as a good programming language?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question8&lt;/span&gt;: Can classes,protected variables or other features in C++ be implemented using C?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question9&lt;/span&gt;: Define Deadlock&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question20&lt;/span&gt;:Given a multi-threaded program How can you make it  run on a system that supports only a single thread execution?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question11&lt;/span&gt;:What are the Differences between a const char * and char const *?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question12&lt;/span&gt;:What are the Differences between a reference variable and pointer variable in C++?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question13&lt;/span&gt;What is a register variable and what are the limitations on it? What is an automatic variable?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question14&lt;/span&gt;What are the Differences in memory allocation in array and pointer(stack and heap)?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question15&lt;/span&gt;Find the missing element in a sorted array in most optimum running time (O(log n))&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2711722137420847048?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2711722137420847048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2711722137420847048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2711722137420847048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2711722137420847048'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/06/deshaw.html' title='Deshaw'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2995094424304448136</id><published>2008-06-21T02:42:00.000-07:00</published><updated>2008-06-21T02:43:16.222-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><title type='text'>amazon</title><content type='html'>&lt;p&gt;1. How would you find the second largest element in an array using minimum no of comparisons?&lt;br /&gt;&lt;br /&gt;2. Write a C program for  level order traversal of a tree?&lt;br /&gt;&lt;br /&gt;3. You are given: 3 types of vehicles: Motorbike, Car, and a special type of &lt;a id="KonaLink0" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;car&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; for the handicapped.&lt;br /&gt;3 types of parking: Motorbike parking, Car parking, handicapped car parking.&lt;br /&gt;&lt;br /&gt;Motorbikes and cars can only park in their designated parkings, while the handicapped cars can park either in their own parking or the regular car parking.&lt;br /&gt;How would you model this as classes? Explain your methods.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Given 2 tables: Employee(Employee_Name,Dept_No) Department(Dept_No, Dept_Name)&lt;br /&gt;&lt;br /&gt;Write an SQL query which outputs all the employees, and their department nos and names, including all those departments which have no employees working for them.&lt;br /&gt;&lt;br /&gt;6. Explain about Inodes?&lt;br /&gt;&lt;br /&gt;7.Give a &lt;a id="KonaLink1" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;Linux&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; shell command to find all files in a directory which contain ip addresses.&lt;br /&gt;&lt;br /&gt;8. Given a table Employee which has columns name and salary, write an SQL query to find the employee with the second highest salary.&lt;br /&gt;&lt;br /&gt;9. Given a table of Player which contains Sno and player name, write a query which finds all possible Table Tennis doubles pairings.&lt;br /&gt;&lt;br /&gt;10.Given a string A, and a string B, and a dictionary, how would you convert A to B in the minimum no of operations, given that:&lt;br /&gt;&lt;br /&gt;i) All the intermediate words must be from the dictionary&lt;br /&gt;&lt;br /&gt;ii) An ‘operation’ is defined as:&lt;br /&gt;&lt;br /&gt;a) Delete any character from a string ex dog → do&lt;br /&gt;&lt;br /&gt;b) Insert any character into a string ex cat → cart&lt;br /&gt;&lt;br /&gt;c) Replace any character in the string with another ex cat → cot&lt;/p&gt;   &lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-9635880310720873"; /* Right_links */ google_ad_slot = "1804554347"; google_ad_width = 200; google_ad_height = 90; //--&gt; &lt;/script&gt; &lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt; &lt;/script&gt;&lt;br /&gt;&lt;/td&gt; &lt;td&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-9635880310720873"; /* Right_links */ google_ad_slot = "1804554347"; google_ad_width = 200; google_ad_height = 90; //--&gt; &lt;/script&gt; &lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt; &lt;/script&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2995094424304448136?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2995094424304448136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2995094424304448136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2995094424304448136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2995094424304448136'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/06/amazon_21.html' title='amazon'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6406341483767873649</id><published>2008-06-10T01:27:00.000-07:00</published><updated>2008-06-10T01:28:28.195-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><title type='text'>Amazon ..!!!</title><content type='html'>1.Given a string,find the first un-repeated character in it? Give some test cases&lt;br /&gt;&lt;br /&gt;2.You are given a dictionary of all valid words. You have the following 3 operations permitted on a word:&lt;br /&gt;&lt;br /&gt;a) Delete a character&lt;br /&gt;&lt;br /&gt;b) Insert a character&lt;br /&gt;&lt;br /&gt;c) Replace a character&lt;br /&gt;&lt;br /&gt;Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.&lt;br /&gt;&lt;br /&gt;4.What is a C array and illustrate the how is it different from a list.&lt;br /&gt;&lt;br /&gt;5. What is the time and space complexities of merge sort and when is it preferred  over quick sort?&lt;br /&gt;&lt;br /&gt;6. Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.&lt;br /&gt;&lt;br /&gt;7. Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that.&lt;br /&gt;&lt;br /&gt;8.Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.&lt;br /&gt;&lt;br /&gt;9. Given an array of size n ,containing every element from 1 to n+1, except one. Find the missing element.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6406341483767873649?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6406341483767873649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6406341483767873649' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6406341483767873649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6406341483767873649'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/06/amazon.html' title='Amazon ..!!!'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-4904525523638563304</id><published>2008-06-03T20:40:00.000-07:00</published><updated>2008-06-03T20:42:57.331-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><title type='text'>Amazon latest interview Questions</title><content type='html'>&lt;span&gt;&lt;/span&gt; 1. How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same&lt;br /&gt;&lt;br /&gt;2. Explain polymorphism  citing an example.&lt;br /&gt;&lt;br /&gt;3. What are the 4 basics of OOP?&lt;br /&gt;&lt;br /&gt;4. Define Data Abstraction. What is its importance?&lt;br /&gt;&lt;br /&gt;5. Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array.&lt;br /&gt;&lt;br /&gt;Eg.&lt;br /&gt;&lt;br /&gt;i) 3 2 7 10 should return 13 (sum of 3 and 10)&lt;br /&gt;&lt;br /&gt;ii) 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can’t pass the value k to any function also.&lt;br /&gt;&lt;br /&gt;7.You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?&lt;br /&gt;&lt;br /&gt;8.Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number.&lt;br /&gt;&lt;br /&gt;9.Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.&lt;br /&gt;&lt;br /&gt;10.Given an array of size n. It contains numbers in the range 1 to n. Find the  numbers which aren't present.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-4904525523638563304?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/4904525523638563304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=4904525523638563304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4904525523638563304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4904525523638563304'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/06/amazon-latest-interview-questions.html' title='Amazon latest interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-8455900772446469580</id><published>2008-05-31T14:37:00.000-07:00</published><updated>2008-05-31T14:38:23.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google interview Questions</title><content type='html'>&lt;span style="color: rgb(51, 51, 51); font-weight: bold; font-family: arial;"&gt;GOOGLE PAPER - JAN 2005&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Google Placement Paper and Sample Paper&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;1. Solve this cryptic equation, realizing of course that values for M and E could be interchanged. No leading zeros are allowed.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;WWWDOT - GOOGLE = DOTCOM&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;This can be solved through systematic application of logic. For example, cannot be equal to 0, since . That would make , but , which is not possible.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Here is a slow brute-force method of solution that takes a few minutes on a relatively fast machine:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;This gives the two solutions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;777589 - 188106 == 589483&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;777589 - 188103 == 589486&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Here is another solution using Mathematica's Reduce command:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;A faster (but slightly more obscure) piece of code is the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Faster still using the same approach (and requiring ~300 MB of memory):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Even faster using the same approach (that does not exclude leading zeros in the solution, but that can easily be weeded out at the end):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Here is an independent solution method that uses branch-and-prune techniques:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;And the winner for overall fastest:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;2. Write a haiku describing possible methods for predicting search traffic seasonality.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;MathWorld's search engine&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;seemed slowed this May. Undergrads&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;prepping for finals.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;3. 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;1 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;2 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;1 2 1 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;1 1 1 2 2 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;What's the next line?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;312211. This is the "look and say" sequence in which each term after the first describes the previous term: one 1 (11); two 1s (21); one 2 and one 1 (1211); one 1, one 2, and two 1's (111221); and so on. See the look and say sequence entry on MathWorld for a complete write-up and the algebraic form of a fascinating related quantity known as Conway's constant.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;4. You are in a maze of twisty little passages, all alike. There is a dusty laptop here with a weak wireless connection. There are dull, lifeless gnomes strolling around. What dost thou do?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;A) Wander aimlessly, bumping into obstacles until you are eaten by a grue.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;B) Use the laptop as a digging device to tunnel to the next level.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;C) Play MPoRPG until the battery dies along with your hopes.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;D) Use the computer to map the nodes of the maze and discover an exit path.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;E) Email your resume to Google, tell the lead gnome you quit and find yourself in whole different world [sic].&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;In general, make a state diagram . However, this method would not work in certain pathological cases such as, say, a fractal maze. For an example of this and commentary, see Ed Pegg's column about state diagrams and mazes .&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;5. What's broken with Unix?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Their reproductive capabilities.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;How would you fix it?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;6. On your first day at Google, you discover that your cubicle mate wrote the textbook you used as a primary resource in your first year of graduate school. Do you:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;A) Fawn obsequiously and ask if you can have an autograph.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;B) Sit perfectly still and use only soft keystrokes to avoid disturbing her concentration chetanasinterview.com&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;C) Leave her daily offerings of granola and English toffee from the food bins.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;D) Quote your favorite formula from the textbook and explain how it's now your mantra.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;E) Show her how example 17b could have been solved with 34 fewer lines of code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;7. Which of the following expresses Google's over-arching philosophy?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;A) "I'm feeling lucky"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;B) "Don't be evil"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;C) "Oh, I already fixed that"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;D) "You should never be more than 50 feet from food"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;E) All of the above&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;8. How many different ways can you color an icosahedron with one of three colors on each face?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;For an asymmetric 20-sided solid, there are possible 3-colorings . For a symmetric 20-sided object, the Polya enumeration theorem can be used to obtain the number of distinct colorings. Here is a concise Mathematica implementation:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;What colors would you choose?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;9. This space left intentionally blank. Please fill it with something that improves upon emptiness.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;For nearly 10,000 images of mathematical functions, see The Wolfram Functions Site visualization gallery .&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;10. On an infinite, two-dimensional, rectangular lattice of 1-ohm resistors, what is the resistance between two nodes that are a knight's move away?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;This problem is discussed in J. Cserti's 1999 arXiv preprint . It is also discussed in The Mathematica GuideBook for Symbolics, the forthcoming fourth volume in Michael Trott's GuideBook series, the first two of which were published just last week by Springer-Verlag. The contents for all four GuideBooks, including the two not yet published, are available on the DVD distributed with the first two GuideBooks.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;11. It's 2PM on a sunny Sunday afternoon in the Bay Area. You're minutes from the Pacific Ocean, redwood forest hiking trails and world class cultural attractions. What do you do?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;12. In your opinion, what is the most beautiful math equation ever derived?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;There are obviously many candidates. The following list gives ten of the authors' favorites:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;1. Archimedes' recurrence formula : , , ,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;2. Euler formula :&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;3. Euler-Mascheroni constant :&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;4. Riemann hypothesis: and implies&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;5. Gaussian integral :&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;6. Ramanujan's prime product formula:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;7. Zeta-regularized product :&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;8. Mandelbrot set recursion:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;9. BBP formula :&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;10. Cauchy integral formula:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;http://www.ChetanaS.com&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;An excellent paper discussing the most beautiful equations in physics is Daniel Z. Freedman's " Some beautiful equations of mathematical physics ." Note that the physics view on beauty in equations is less uniform than the mathematical one. To quote the not-necessarily-standard view of theoretical physicist P.A.M. Dirac, "It is more important to have beauty in one's equations than to have them fit experiment."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;13. Which of the following is NOT an actual interest group formed by Google employees?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;A. Women's basketball        B. Buffy fans      C. Cricketeers      D. Nobel winners            E. Wine club&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;14. What will be the next great improvement in search technology?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Semantic searching of mathematical formulas. See http://functions.wolfram.com/About/ourvision.html for work currently underway at Wolfram Research that will be made available in the near future.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;15. What is the optimal size of a project team, above which additional members do not contribute productivity equivalent to the percentage increase in the staff size?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;A) 1     B) 3        C) 5      D) 11         E) 24&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;16. Given a triangle ABC, how would you use only a compass and straight edge to find a point P such that triangles ABP, ACP and BCP have equal perimeters? (Assume that ABC is constructed so that a solution does exist.)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;This is the isoperimetric point , which is at the center of the larger Soddy circle. It is related to Apollonius' problem . The three tangent circles are easy to construct: The circle around has diameter , which gives the other two circles. A summary of compass and straightedge constructions for the outer Soddy circle can be found in " Apollonius' Problem: A Study of Solutions and Their Connections" by David Gisch and Jason M. Ribando.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;17. Consider a function which, for a given whole number n, returns the number of ones required when writing out all numbers between 0 and n. For example, f(13)=6. Notice that f(1)=1. What is the next largest n such that f(n)=n?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;The following Mathematica code computes the difference between [the cumulative number of 1s in the positive integers up to n] and [the value of n itself] as n ranges from 1 to 500,000:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;http://www.ChetanaSinterview.com&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;The solution to the problem is then the first position greater than the first at which data equals 0:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;which are the first few terms of sequence A014778 in the On-Line Encyclopedia of Integer Sequences.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Checking by hand confirms that the numbers from 1 to 199981 contain a total of 199981 1s:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;18. What is the coolest hack you've ever written?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;While there is no "correct" answer, a nice hack for solving the first problem in the SIAM hundred-dollar, hundred-digit challenge can be achieved by converting the limit into the strongly divergent series:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;and then using Mathematica's numerical function SequenceLimit to trivially get the correct answer (to six digits),&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;You must tweak parameters a bit or write your own sequence limit to get all 10 digits.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;19. 'Tis known in refined company, that choosing K things out of N can be done in ways as many as choosing N minus K from N: I pick K, you the remaining.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;This simply states the binomial coefficient identity .&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;Find though a cooler bijection, where you show a knack uncanny, of making your choices contain all K of mine. Oh, for pedantry: let K be no more than half N.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;'Tis more problematic to disentangle semantic meaning precise from the this paragraph of verbiage peculiar.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;20. What number comes next in the sequence: 10, 9, 60, 90, 70, 66, ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;A) 96&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;B) 1000000000000000000000000000000000\&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;0000000000000000000000000000000000\&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;000000000000000000000000000000000&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;C) Either of the above&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;D) None of the above&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;This can be looked up and found to be sequence A052196 in the On-Line Encyclopedia of Integer Sequences, which gives the largest positive integer whose English name has n letters. For example, the first few terms are ten, nine, sixty, ninety, seventy, sixty-six, ninety-six, . A more correct sequence might be ten, nine, sixty, googol, seventy, sixty-six, ninety-six, googolplex. And also note, incidentally, that the correct spelling of the mathematical term " googol" differs from the name of the company that made up this aptitude test.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;The first few can be computed using the NumberName function in Eric Weisstein's MathWorld packages:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;A mathematical solution could also be found by fitting a Lagrange interpolating polynomial to the six known terms and extrapolating:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: arial;"&gt;21. In 29 words or fewer, describe what you would strive to accomplish if you worked at Google Labs.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-8455900772446469580?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/8455900772446469580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=8455900772446469580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8455900772446469580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8455900772446469580'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/05/google-interview-questions.html' title='Google interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7961156532941623234</id><published>2008-05-31T14:28:00.000-07:00</published><updated>2008-05-31T14:29:11.858-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>MS intern</title><content type='html'>Hi all&lt;br /&gt;&lt;br /&gt;1)wap to merge 2 BSTs without using malloc.&lt;br /&gt;2)wap to eliminate all the duplicates of an array with order preserving in o(n) time.you can use extra space.&lt;br /&gt;eg. for aabbccccdddeeabcd&lt;br /&gt;the answer should be abcde&lt;br /&gt;&lt;br /&gt;3)given a 2D array of only 0's and 1's.Find an algorithm for converting all the rows and columns of elements which are 1 to 1 without using extra space.&lt;br /&gt;&lt;br /&gt;for ex. if a[2][3]=1 then every element of 3rd row and 4th column should be set to 1&lt;br /&gt;&lt;br /&gt;(plz notice that these are bits)&lt;br /&gt;&lt;br /&gt;4) given 2 sorted linked lists,wap to find the intersection of these lists and preserve these intersections as a separate list.Don't use malloc.&lt;br /&gt;&lt;br /&gt;5) wap to traverse a 2d array of bits in a spiral order.Don't include floating point computations/multiplication/division operations.&lt;br /&gt;&lt;br /&gt;6)wap to insert a node in a sorted circular linked list in most efficient time.&lt;br /&gt;&lt;br /&gt;rest was some discussion on projects and general talk.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7961156532941623234?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7961156532941623234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7961156532941623234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7961156532941623234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7961156532941623234'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/05/ms-intern.html' title='MS intern'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7194407581443107826</id><published>2008-05-30T22:55:00.001-07:00</published><updated>2008-05-30T22:55:48.967-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>Cool Question from Yahoo!</title><content type='html'>&lt;h3 class="smller"&gt;Yahoo question - Friendship Graph of Orkut&lt;/h3&gt; &lt;div class="para"&gt; Given the relationship graph of friends in orkut suppose the immediate friend list is stored in file sytem of database,&lt;br /&gt;1) What algorithm you will use to find all unique 2nd level friends of a given user&lt;br /&gt;2) Given 2 users give an algorithm which tells whether they are connected through common friends or not.&lt;br /&gt;3) The solution should have optimum memory usage &amp;amp; running complexity.&lt;br /&gt;&lt;br /&gt;The question has been discussed in the community but could not find any thread which has solved it. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7194407581443107826?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7194407581443107826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7194407581443107826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7194407581443107826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7194407581443107826'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/05/cool-question-from-yahoo.html' title='Cool Question from Yahoo!'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7616687995300346418</id><published>2008-05-30T22:52:00.001-07:00</published><updated>2008-05-30T22:55:06.316-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><title type='text'>Amazon interview Questions</title><content type='html'>Q.1: Given a string construct a new string containing the occurrences of unique characters in it. You can&lt;br /&gt;assume that only a-z &amp;amp; A-Z appear in the string with 'a' being different from 'A'. Also the letters in the output string must be in the order of their occurrence in the input string.&lt;br /&gt;e.g. for the string "ThunderBirdFirefox" you must return the string "T1h1u1n1d2e2r3B1i2F1f1o1x1".&lt;br /&gt;&lt;br /&gt; Q.2: Given an integer array of which both first half and second half are sorted. Write a function to merge the two parts to create one single sorted array in place [do not use any extra space].&lt;br /&gt;e.g. If input array is [1,3,6,8,-5,-2,3,8] It should be converted to: [-5,-2,1,3,3,6,8,8]&lt;br /&gt;&lt;br /&gt; Q.3: Given a set of 1 Trillion integers on hard disk, find the smallest 1 million of them. You can fit at most 1 million integers in memory at a time. State the fastest solution you can think of.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; Q.4: There is a matrix of integers where every row and every column is sorted. How will you find whether a given number exists in the matrix? (Just present the pseudo code).&lt;br /&gt;&lt;br /&gt; Q.5: There are N people in a room and one of them is a celebrity. Everybody knows at least the celebrity while the celebrity knows no one. You enter the room to find the celebrity. You are only allowed to pick a person, point to another person, and ask whether the first person knows the second one. How will you find the celebrity in minimum number of questions?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7616687995300346418?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7616687995300346418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7616687995300346418' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7616687995300346418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7616687995300346418'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/05/amazon-interview-questions.html' title='Amazon interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6380391167725113354</id><published>2008-05-27T22:41:00.001-07:00</published><updated>2008-05-27T22:43:05.392-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><title type='text'>Amazon off campus</title><content type='html'>Design a 7 sided dice from a 5 sided dice i..e given a dice which will give results in the range of 1-5 how do you get results in the range of 1-7 from the same dice.&lt;br /&gt;&lt;br /&gt;In other words, given random5 impelement random7 using random5. I searched community but could not understand the logic. If anyone can give a try&lt;br /&gt;&lt;br /&gt;&lt;h3 class="smller"&gt;&lt;span style="font-size:100%;"&gt;Link List addition&lt;/span&gt;&lt;/h3&gt; &lt;div class="para"&gt; 2 integers r given in the form of link lists.&lt;br /&gt;eg..14567..is tored as..1-&gt;4-&gt;5-&gt;6-&gt;7-&gt;nul&lt;br /&gt;how to add 2 such integers..assume..there sum is in integer range&lt;br /&gt;IMP..use single link lists and not doubly linklists..&lt;br /&gt;al exixtings solutions r have been done using doubly link lists..&lt;br /&gt;and also plssss..us e rcursion...&lt;br /&gt;this was asked in amazon off campus &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6380391167725113354?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6380391167725113354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6380391167725113354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6380391167725113354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6380391167725113354'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/05/amazon-7-sided-dice.html' title='Amazon off campus'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-9102689294827183649</id><published>2008-05-27T00:14:00.000-07:00</published><updated>2008-05-27T00:15:00.084-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Lets discuss</title><content type='html'>&lt;h3 style="font-family: courier new;" class="smller"&gt;&lt;span style="font-size:130%;"&gt;google telephonic interview question&lt;/span&gt;&lt;/h3&gt;  &lt;div class="para"&gt; given an input n write a code to generate all possible parenthesizations&lt;br /&gt;for ex if n=3&lt;br /&gt;then print&lt;br /&gt;&lt;br /&gt;((()))&lt;br /&gt;(())()&lt;br /&gt;()()()&lt;br /&gt;(()())&lt;br /&gt;()(()) &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-9102689294827183649?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/9102689294827183649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=9102689294827183649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/9102689294827183649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/9102689294827183649'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/05/lets-discuss.html' title='Lets discuss'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6241813819065597604</id><published>2008-05-15T21:01:00.000-07:00</published><updated>2008-05-15T21:02:05.954-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Crazy google</title><content type='html'>&lt;ol&gt; &lt;li&gt;How many golf balls can fit in a school bus?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; The point of the question isn't to see how golf balls you think are in the bus, but to see what your deduction skills are like. Do you just make a random guess or try to cop out by saying a lot, or do you actually try to come up with a legitimate answer by going through a logical series of steps.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty &lt;a id="KonaLink0" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;glass&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; blender. The blades will start moving in 60 seconds. What do you do?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;You simply jump out. As you are scaled down, the ratio of muscle mass to total mass remains the same. Potential energy is given by E = mgh. So, if E/m is unchanged (where E is the energy expended in expanding your leg muscles, and m is your mass), then h is unchanged. Mini-me jumps as high as me. This is the reason why grass-hoppers can jump about as high as people.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;How much should you charge to wash all the windows in Seattle?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;As crazy as it might sound, questions like these demonstrate your ability to think through a complex problem with little or no information. They expect you to take an educated guess. Most of the time you can ask them questions like - how many buildings are there in Seattle.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;How would you find out if a machine’s stack grows up or down in memory?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;Instantiate a local variable. Call another function with a local. Look at the address of that function and then compare. If the function's local is higher, the stack grows away from address location 0; if the function's local is lower, the stack grows towards address location 0.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Explain a &lt;a id="KonaLink1" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;database&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; in three sentences to your eight-year-old nephew.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;A database is like a file cabinet. The files, or data, is stored in it and can be arranged in categories. But unlike an actual file cabinet, you can do a lot more cool stuff with a database like being able to make it accessible through the &lt;a id="KonaLink2" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;internet&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;How many times a day does a clock’s hands overlap?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;The Hour hand and Minute hand would be meeting exactly 11 times in 12 hours (Hour hand would have taken 1 clockwise round and Minute hand would have taken 12 clockwise rounds, so 12 - 1 = 11 rounds).&lt;br /&gt;&lt;br /&gt;result: First time hour and minute hands overlap will be 12 Hours / 11 = 01:05:27.27. So at this time only hour and minute hands would be overlapping and second hand will not be any near to them. Similarly for 2nd, 3rd, 4th, 5th, 6th, 7th, 8th, 9th and 10th overlap of hour and minute hand the Second hand wont be any nearby. So all 3 hands (hour, minute and Second) overlap only 2 times i.e. (0:0:0 and 12:0:0).&lt;br /&gt;&lt;br /&gt;Also we all know when we get our watches repaired, normally the repairman overlaps all the three hands to 12.&lt;br /&gt;&lt;br /&gt;If we are considering that the second hand is not present, then the rest two overlaps 22 times in 24 hours.&lt;br /&gt;&lt;br /&gt;There again is a catch, if we check the angles by which the hour hand and minute hand moves.&lt;br /&gt;&lt;br /&gt;The second hand moves 6 degree in a second. In that time the minute hand will move 6/60 degrees. and the hour hand will move 6/(60*12) degrees. now taking these things in the considerations. if we check the positions of the hour and minute hand in terms of angle from the marker 12, for our first rendezvous time, i.e. 01:05:27.27 sec.&lt;br /&gt;first thing that comes to my mind is that, there is fraction in the seconds. So that time can’t be measured. there will be no exact overlap. now lets calculate the angles:&lt;br /&gt;&lt;br /&gt;1 hour 5 mins and 27 seconds = 3600 + 5*60 + 27 = 3927 seconds.&lt;br /&gt;&lt;br /&gt;angle of hour hand = 3927 * 6/(60*12) = 32.725 degree.&lt;br /&gt;angle of minute hand = 3927 * 6/60 = 392.7 degree&lt;br /&gt;subtracting 360 degree from it we get - 32.7 degree.&lt;br /&gt;&lt;br /&gt;So at 01:05:27 both hands don’t overlap. Now for 01:05:28 :&lt;br /&gt;Angles : hour hand - 32.73333&lt;br /&gt;minute hand - 32.8&lt;br /&gt;so obviously they dont meet at 01:05:28 either.&lt;br /&gt;&lt;br /&gt;So they overlap at 12:00 and 24:00 only. So the answer is 2 only.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You have to get from point A to point B. You don’t know if you can get there. What would you do?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;Utilizing a “learn as you go” approach and applying collected knowledge and data along the way is the best way to proceed. Let’s break this down farther.&lt;br /&gt;&lt;br /&gt;Determine the amount of time you have to go from point A to point B. Spend the initial 20% of that time making a 360° search with the largest circumference possible with the in the time you have allowed.&lt;br /&gt;&lt;br /&gt;During that time, ask people, look for maps, clues, collect data, and knowledge. At the end of the initial 360° search take an objective look at all the information you have obtained and you calculate the risk of failure you are willing to live with. Create a plan and a strategy based on your assessment of where you believe point B to be. Then you proceed on implementing your plan with predetermined intervals of reassessment and strategy improvements.&lt;br /&gt;&lt;br /&gt;This is the best chance you have reaching point B if you don’t know if you can get there.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Imagine you have a closet full of shirts. It’s very hard to find a shirt. So what can you do to organize your shirts for easy retrieval?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;Let’s suppose there are&lt;br /&gt;a set of attributes of each shirt you are interested in: e.g. sleeve length, color, buttons (no buttons, fully button, partially buttoned from collar to chest level).&lt;br /&gt;Let’s say the closet is a simple wall closet with a single closet rod running the entire length of closet. On the left you put all the short sleeve shirts, and on the right the long sleeve shorts. You separate then long and short sleeve sides with a specially marked coat hanger. Then you separate each group into no buttonoed, partially buttoned, and fully button, using more specially marked hangers. Then each sub group is separated into colored and monochrome sub-sub-groups (specially marked hangers aren’t needed for separators unless you are color blind) Then each colored group is sorted left to right according to the color spectrum: ROYGBIV: red, orange, yellow, green, blue, indigo, violet. Each monochrome ggroup is sorted left to right: white on the left, black on the right, and shades of grey in the middle, the darker greys on the right, the lighter on the left.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;1. There is only one cheat husband&lt;br /&gt;- If it is so then 99 wives knew it before. So the cheated wife got the idea from queen that her husband is cheating. So she will kill him. Next morning every wife will know there is no cheat husbands anymore.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. There are more than one cheat husbands&lt;br /&gt;&lt;br /&gt;- In this case, all of the wives already had the idea prior to queen's information. Its just that the cheated wives knew the count which is one less than what the non-cheated wives' knew - thats all. i.e. if there were 2 cheat husbands then their wives knew the count is 1 and others knew its 2. So the queen just repeated the info saying "at least 1". Same goes to 2,3,4...100 cheat husbands. So in this case no wife kills her husband.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;In a country in which people only want boys, every family continues to have children until they have a boy. if they have a girl, they have another child. if they have a boy, they stop. what is the proportion of boys to girls in the country?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;From pure probability,we get the expected number of girls born to be 1/2 with that of boys being 1.So the ratio is 2:1&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;If the probability of observing a car in 30 minutes on a highway is 0.95, what is the probability of observing a car in 10 minutes (assuming constant default probability)?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;If the chance to see the car is 10 percent per minute, the first minute you have 10% chance, the second minute you have 10% of 90% = 9% (so total 19%), the third minute 10% of 81% (= 8,1%, total 27,1 %) ......&lt;br /&gt;As the chance for 30 minutes is 95 percent, the chance for 1 minute is 9.5% and for 10 minute 63.1 %.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands? (The answer to this is not zero!)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;7.5 degrees (the hour hand is 1/4th of the way between 3 and 4, the angle measure of that is 360/12 = 30 degrees between hours / 4 = 7.5 degrees).&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Four people need to cross a rickety rope bridge to get back to their camp at night. Unfortunately, they only have one flashlight and it only has enough light left for seventeen minutes. The bridge is too dangerous to cross without a flashlight, and it�s only strong enough to support two people at any given time. Each of the campers walks at a different speed. One can cross the bridge in 1 minute, another in 2 minutes, the third in 5 minutes, and the slow poke takes 10 minutes to cross. How do the campers make it across in 17 minutes?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;1 and 2 cross, taking 2 minutes, 1 goes back carrying the flashlight total=3 minutes. 5 and 10 cross, taking 10 minutes totaltime now= 13 minutes, 2 goes back,total time now = 15 minutes. 1 and 2 cross again, taking 2 minutes making it 17 minutes.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;No.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;How many piano tuners are there in the entire world?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;1) At first  list out all the piano manufacturing companies in the world.&lt;br /&gt;2) Then  look into their purchase records and find out the piano purchasers information.&lt;br /&gt;3) i) If the purchase is made by an individual or a house hold then the piano is played at best case by all the people of the house.&lt;br /&gt;ii) Else if the piano is purchased for school then list out the students that opted the piano course in their music curriculum.&lt;br /&gt;iii) If the piano is purchased by a Church then  count the no of major or minor events of the church and count the piano users.&lt;br /&gt;sum up all the numbers to get more or less accurate piano users count.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;choose 6 balls and weigh 3 against 3&lt;br /&gt;- if they weigh the same, you have another weighing for the remaining 2 balls and you can find the heavier one&lt;br /&gt;- if they don’t weigh the same, from the group of 3 which was heavier, choose any 2 balls and weigh them:&lt;br /&gt;- if they weigh the same, the remaining ball is the heavier one; otherwise you just found the heavier one by weighing the 2 chosen balls.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You have five pirates, ranked from 5 to 1 in descending order. The top pirate has the right to propose how 100 gold coins should be divided among them. But the others get to vote on his plan, and if fewer than half agree with him, he gets killed. How should he allocate the gold in order to maximize his share but live to enjoy it? (Hint: One pirate ends up with 98 percent of the gold.)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;The highest ranked pirate gets 98 gold coins&lt;br /&gt;---Two pirates get 1 gold coin each&lt;br /&gt;---The other 2 pirates get nothing.&lt;/li&gt; &lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6241813819065597604?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6241813819065597604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6241813819065597604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6241813819065597604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6241813819065597604'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/05/crazy-google.html' title='Crazy google'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1718331390678283067</id><published>2008-04-30T19:57:00.000-07:00</published><updated>2008-04-30T20:03:41.014-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google Latest interview Questions</title><content type='html'>&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-latest-interview-questions.html" target="_blank"&gt;Google Interview Questions&lt;/a&gt; ::&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Total there are five Technical Interviews followed by Management round.&lt;br /&gt;&lt;br /&gt;So here are the questions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-latest-interview-questions.html" target="_blank"&gt;Google Interview Round 1&lt;/a&gt; ::&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;What is the Space complexity of quick sort algorithm? how do find it?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Quicksort has a space complexity of O(logn), even in the worst case, when it is carefully implemented such that&lt;br /&gt; * in-place partitioning is used. This requires O(1).&lt;br /&gt;* After partitioning, the partition with the fewest elements is (recursively) sorted first, requiring at most O(logn) space. Then the other partition is sorted using tail-recursion or iteration.&lt;br /&gt;The version of quicksort with in-place partitioning uses only constant additional space before making any recursive call. However, if it has made O(logn) nested recursive calls, it needs to store a constant amount of information from each of them. Since the best case makes at most O(logn) nested recursive calls, it uses O(logn) space. The worst case makes O(n) nested recursive calls, and so needs O(n) space.&lt;br /&gt;&lt;br /&gt;However, if we consider sorting arbitrarily large lists, we have to keep in mind that our variables like left and right can no longer be considered to occupy constant space; it takes O(logn) bits to index into a list of n items. Because we have variables like this in every stack frame, in reality quicksort requires O(log2n) bits of space in the best and average case and O(nlogn) space in the worst case. This isn't too terrible, though, since if the list contains mostly distinct elements, the list itself will also occupy O(nlogn) bits of space.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;What are dangling pointers?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; A dangling pointer is a pointer to storage that is no longer allocated. Dangling pointers are nasty bugs because they seldom crash the program until long after they have been created, which makes them hard to find. Programs that create dangling pointers often appear to work on small inputs, but are likely to fail on large or complex inputs.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Given that you can take one step or two steps forward from a given step. So find the total number of ways of reaching Nth step.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;The simple recurrence relation governing this problem is f(N)=f(N-1) +f(N-2)(why?),which is a fibonacci sequence.&lt;br /&gt;Nth state can be arrived directly by taking 2 step movement from N-2 or 1 step from N-1.Remember N-2 -&gt; N-1 -&gt; N is not a direct path from N-2th state to Nth state.Hence the no of solutions is no of ways to reach N-2th step and then directly taking a 2 jump step to N + no of ways to reach N-1th step and then taking 1 step advance.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You are given biased coin. Find unbiased decision out of it?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;Throw the biased coin twice.Classify it as true for HT and false for TH.Both of these occur with probability=p*(1-p),hence unbiased. Ignore the other 2 events namely HH and TT.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;On a empty chessboard, a horse starts from a point( say location x,y) and it starts moving randomly, but once it moves out of board, it cant come inside. So what is the total probability that it stays within the board after N steps.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-latest-interview-questions.html" target="_blank"&gt;Google Interview Round 2&lt;/a&gt; ::&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You have 1 to N-1 array and 1 to N numbers, and one number is missing, you need to find the missing the number. Now you have 1 to N-2 numbers, and two numbers missing. Find them.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;The question can be elucidated as follows.Given an array of size N-1 containing numbers less than N and with out any duplicates!! We knew that there is a number missing from the array say K .Let S be the sum of the elements of the array.&lt;br /&gt;&lt;br /&gt;Sum of first N natural numbers=N*(N+1)/2&lt;br /&gt;&lt;br /&gt;and S=N*(N+1)/2 - K.Now putting this other way around we get  K=N*(N+1)/2 -S !!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now the second part of the question says that there are 2 of the first N numbers missing.Let they be X and Y.&lt;br /&gt;&lt;br /&gt;We solve this problem by solving 2 essential equations.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;They are X+Y=N*(N+1)/2 -S----------&gt;(1)&lt;br /&gt;&lt;br /&gt;      X*Y=N!/P-------------------(2) where S and P are the cumulative sum and product of the array entries.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You have cycle in linked list. Find it. Prove that time complexity is linear. Also find the node at which looping takes place.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;The problem of checking whether there is a cycle or not can be solved using 2 pointers one moving in increments of 1 and the other in increments of 2.If there is a cycle then these 2 pointers meet at some node say N1 inside the cycle otherwise the fast pointer reaches the end of the list.This is a O(N) solution.&lt;br /&gt;&lt;br /&gt;Now coming to the identification of the node at which looping took place.After our identification of cycle ,both the pointers P1 and P2 are at node N1.Now iterate the slow pointer to count the no of nodes in the cycle.(After traversing the whole cycle P1 and P2 shall again be at the same node).Let this size be K.Now take one of the pointers to the head node and count the no of nodes till N1.Let this number be X.Now use one of these pointers to reverse the cycle starting from N1.Only the cycle gets reversed.Now again traverse from head node to N1.Let the number of nodes this time be Y.Let the no of nodes from head to the start node of the cycle be Z&lt;br /&gt;&lt;br /&gt;Now X+Y=2*Z+K .Hence solve for K and then having figured out the start node N2 of the cycle.Now as the cycle is reversed having figured out this start node its next node is the looping nodes so set the looping nodes next pointer to NULL and reverse the list further till you reach N2.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Questions on my project please be prepare well about your project&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;How do you search for a word in a large database.&lt;/li&gt;&lt;li&gt;How do you build address bar in say gmail. i.e. if you press 'r' then you get all email starting from 'r', and if you press 'ra' then you will get emails starting from 'ra'.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-latest-interview-questions.html" target="_blank"&gt;Google Interview Round 3&lt;/a&gt; ::&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You have given an array. Find the maximum and minimum numbers in less number of comparisons.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;only 3n/2 comparisons are necessary to find both the minimum and the maximum. To do this, we maintain the minimum and maximum elements seen thus far. Rather than processing each element of the input by comparing it against the current minimum and maximum, however, at a cost of two comparisons per element, we process elements in pairs. We compare pairs of elements from the input first with each other, and then compare the smaller to the current minimum and the larger to the current maximum, at a cost of three comparisons for every two elements.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You have given an array from 1 to N and numbers also from 1 to N. But more than one number is missing and some numbers have repeated more than once. Find the algo with running time O(n).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;All the numbers are positive to start with.Now, For each A[i], Check the sign of A[A[i]]. Make A[A[i]] negative if it's positive. Report a repetition if it's negative.Finally all those entries i,for which A[i] is negative are present and those i for which A[i] is positive are absent.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-latest-interview-questions.html" target="_blank"&gt;Google Interview Round 4&lt;/a&gt; ::&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Three strings say A,B,C are given to you. Check weather 3rd string is interleaved from string A and B.&lt;br /&gt;&lt;pre&gt;       Ex: A="abcd" B="xyz" C="axybczd". answer is yes.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;bool test(A,B,C)&lt;br /&gt;{&lt;br /&gt;i=j=k=0;&lt;br /&gt;while(k &lt; i ="=" j ="="&gt;&lt;br /&gt;The above algorithm doesn't work when C[k]=A[i]=B[j], essentially throwing one in to a dilemma whether to accept the character from A or B.&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Given two sorted arrays A and B.&lt;br /&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Find the intersection of these arrays A and B.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;The intersection can be found by using a variation of merge routine of the merge sort.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;If array A is small and array B is too large. how will you proceed for getting intersection of those two arrays?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;In this case for each entry of smaller array,we can run a binary search routine on the larger one to know its presence.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-latest-interview-questions.html" target="_blank"&gt;Google Interview Round 5&lt;/a&gt; ::&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;If you get into Google, which products are you going to work on?&lt;/li&gt;&lt;li&gt;What is TCP, UDP. what is reliability, unreliability, give examples of these?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol" target="_blank"&gt;Click Here To Read About TCP&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/User_Datagram_Protocol" target="_blank"&gt;Click Here To Read About UDP&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Reliability_%28computer_networking%29" target="_blank"&gt;Click Here To Read About Reliability&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is http protocol?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/HTTP" target="_blank"&gt;Click Here To Read About HTTP&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;How does Google search engine works?&lt;/li&gt;&lt;li&gt;What is indexing, what is the input and output to it. how Google does that?&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1718331390678283067?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1718331390678283067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1718331390678283067' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1718331390678283067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1718331390678283067'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/google-latest-interview-questions.html' title='Google Latest interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2460666584597954911</id><published>2008-04-13T15:38:00.000-07:00</published><updated>2008-04-13T15:40:30.532-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>Yahoo interview Questions</title><content type='html'>&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Yahoo Telephonic Round:&lt;/span&gt;   &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Design classes for the following problem. (C++)    &lt;br /&gt;&lt;/strong&gt;  &lt;br /&gt;A Customer Can have multiple bank accounts A Bank account can be owned by multiple customers When customer logs in he sees list of account, on clicking on an account he sees list of transactions.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Customer class, Account class, Transaction class  &lt;br /&gt;Customer class contains an array of pointers to the account classes   &lt;br /&gt;Account class contains an array of pointers to its owner customer classes   &lt;br /&gt;Account class also contains an array of transactions associated to it.   &lt;br /&gt;Transaction class contains id or pointer the customer who did that transaction   &lt;br /&gt;In customer class write a function with prototype &lt;/p&gt;&lt;br /&gt;&lt;pre&gt;for (i in Accounts )&lt;br /&gt;{&lt;br /&gt;cout &lt;&lt; i.AccountName &lt;&lt; endl;&lt;br /&gt;}&lt;br /&gt;cin &gt;&gt; id;&lt;br /&gt;for(i in Accounts[id].transactions )&lt;br /&gt;{&lt;br /&gt;cout &lt;&lt; i.TransDetails &lt;&lt; endl;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p&gt; &lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Yahoo Interview Round 1:&lt;/span&gt;   &lt;br /&gt;&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;&lt;strong&gt;How to call a C++ function which is compiled with C++ compiler in C code?      &lt;br /&gt;&lt;/strong&gt;    &lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; The C++ compiler must know that f(int,char,float) is to be called by a C compiler using the extern "C"construct:     &lt;br /&gt;  &lt;br /&gt;The extern "C" line tells the compiler that the external information sent to the linker should use C calling conventions and name mangling (e.g., preceded by a single underscore). Since name overloading isn't supported by C, you can't make several overloaded functions simultaneously callable by a C program.&lt;br /&gt; &lt;pre&gt;// This is C++ code&lt;br /&gt;// Declare f(int,char,float) using extern "C":&lt;br /&gt;extern "C" void f(int i, char c, float x);&lt;br /&gt;...&lt;br /&gt;// Define f(int,char,float) in some C++ module:&lt;br /&gt;void f(int i, char c, float x)&lt;br /&gt;{&lt;br /&gt;  .....&lt;br /&gt;} &lt;/pre&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;When you deliver your C++ headers and C++ library of a class (what all can you change in the class so that application using your class does not need to recompile the code) &lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;How do you initialize a static member of a class with return value of some function? &lt;/strong&gt;      &lt;blockquote&gt;       &lt;p&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;/p&gt;        &lt;p&gt;Static data members are shared by all object instances of that class. Each class instance sees and has access to the same static data. The static data is not part of the class object but is made available by the compiler whenever an object of that class comes into scope. Static data members, therefore, behave as global variables for a class. One of the trickiest ramifications of using a static data member in a class is that it must be initialized, just once, outside the class definition, in the source file. This is due to the fact a header file is typically seen multiple times by the compiler. If the compiler encountered the initialization of a variable multiple times it would be very difficult to ensure that variables were properly initialized. Hence, exactly one initialization of a static is allowed in the entire program. &lt;/p&gt;        &lt;p&gt;Consider the following class, A, with a static data member, _id: &lt;/p&gt;  &lt;pre&gt;  &lt;br /&gt; //File: a.h&lt;br /&gt;  class A&lt;br /&gt;  {&lt;br /&gt;     public:&lt;br /&gt;     A();&lt;br /&gt;     int _id;&lt;br /&gt;  };&lt;/pre&gt;      &lt;p&gt;The initialization of a static member is done similarly to the way global variables are initialized at file scope, except that the class scope operator must be used. Typically, the definition is placed at the top of the class source file: &lt;/p&gt;&lt;pre&gt;   // File: a.cc&lt;br /&gt;  int A::_id;&lt;/pre&gt;&lt;p&gt;Because no explicit initial value was specified, the compiler will implicitly initialize _id to zero. An explicit initialization can also be specified: &lt;/p&gt;     &lt;pre&gt;&lt;br /&gt;// File: a.cc&lt;br /&gt;int A::_id = 999;&lt;br /&gt;&lt;/pre&gt;    &lt;p&gt;In fact, C++ even allows arbitrary expressions to be used in initializers: &lt;/p&gt;    &lt;pre&gt;      // File: a.cc&lt;br /&gt;  int A::_id = GetId();    &lt;/pre&gt;  &lt;/blockquote&gt;   &lt;/li&gt;&lt;li&gt;&lt;strong&gt;How can one application use same API provided by different vendors at the same time? &lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;If you are given the name of the function at run time how will you invoke the function? &lt;/strong&gt;      &lt;blockquote&gt;       &lt;p&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;/p&gt;        &lt;ul&gt;&lt;li&gt;Compile your program with --export-dynamic on the gcc command line &lt;/li&gt;&lt;li&gt;Link with -ldl (dynamic library handling, needed for dlopen and dlsym &lt;/li&gt;&lt;li&gt;Call dlopen() with a null parameter, meaning you aren't loading symbols from a file but from the current executable &lt;/li&gt;&lt;li&gt;Call dlsym() with the name of the function you'll be calling. Note that C++ modifies function names, so If you're trying this with C++, you'd have to either declare this function as extern "C", or figure out what name the function has after compiling. (On unix, you could run nm -s on the object file for this). &lt;/li&gt;&lt;li&gt;If dlsym() returns non-null, use the returned value as a function pointer to invoke your function. &lt;/li&gt;&lt;/ul&gt;     &lt;/blockquote&gt;   &lt;/li&gt;&lt;/ol&gt; &lt;span style="font-weight: bold;"&gt;Yahoo Interview Round 2:&lt;/span&gt;   &lt;ol&gt;&lt;li&gt;&lt;strong&gt;When will you use shell script/Perl ahead of C/C++? &lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;How does yahoo handles billions of requests, does it create a thread per request or a process? &lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;How does HTTP works? &lt;/strong&gt;      &lt;blockquote&gt;       &lt;p&gt;&lt;strong&gt;Solution :&lt;/strong&gt;HTTP Is a request-response protocol. &lt;/p&gt;        &lt;p&gt;For example, a Web browser initiates a request to a  server by opening a TCP/IP connection. The request itself comprises o a request line, o a set of request headers, and o an entity. The server sends a response that comprises o a status line, o a set of response headers, and o an entity. The entity in the request or response can be thought of simply as the payload, which may be binary data. The other items are readable ASCII characters. When the response has been completed, either the browser or the server may terminate the  TCP/IP, or the browser can send another request. &lt;/p&gt;     &lt;/blockquote&gt;   &lt;/li&gt;&lt;li&gt;&lt;strong&gt;How to count number of unique music titles downloaded from a log file which contains an entry of all music title downloaded? &lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;What is the difference between COM and CORBA? &lt;/strong&gt;      &lt;blockquote&gt;       &lt;p&gt;&lt;strong&gt;Solution :&lt;/strong&gt;COM is linked to Microsoft  CORBA to UNIX,Moreover, COM objects require installation on the machine from where it is being used .CORBA is ORB (Object request broker) , and also its a specification owned by OMG, which is open. Not owned by a company. So we cannot say that it only belongs to Unix. Corba servers can run on windows NT, and CORBA clients can run on Unix. &lt;/p&gt;     &lt;/blockquote&gt;   &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What is web service? &lt;/strong&gt;      &lt;blockquote&gt;       &lt;p&gt;&lt;strong&gt;Solution :&lt;/strong&gt;Web Service is defined as "a software System to support interoperable Machine to Machine interaction over a network." Web services are frequently just Web APIs that can be accessed over a network, such as the Internet, and executed on a remote system &lt;a id="KonaLink4" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; the requested services. &lt;/p&gt;     &lt;/blockquote&gt;   &lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;I got only these two Rounds as of now, if I get any more I will post them here. &lt;span style="font-weight: bold;"&gt;If you have attended yahoo interview please share your experience and questions with us.&lt;/span&gt; You can mail them at kchaitanyya@gmail.com or you can comment here.Solutions for rest of questions will be provided later.if you know any of the questions which are unsolved please comment the solution. we will include.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2460666584597954911?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2460666584597954911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2460666584597954911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2460666584597954911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2460666584597954911'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/yahoo-interview-questions_13.html' title='Yahoo interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-4496079566148561817</id><published>2008-04-13T15:35:00.001-07:00</published><updated>2008-04-13T15:35:41.744-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Cisco Networking specific interview Questions</title><content type='html'>&lt;div class="postentry"&gt; &lt;ol&gt;&lt;li&gt;What is a wildcard mask, and how is it different from a netmask?&lt;/li&gt;&lt;li&gt;How do you configure a Cisco switch or router? What are the steps needed?&lt;/li&gt;&lt;li&gt;How would I place an interface into trunking mode?&lt;span id="more-220"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;How do you shutdown an interface on a router or switch?&lt;/li&gt;&lt;li&gt;What is VTP?&lt;/li&gt;&lt;li&gt;What is VMPS?&lt;/li&gt;&lt;li&gt;What is SPAN/RSPAN?&lt;/li&gt;&lt;li&gt;What is flow/netflow?&lt;/li&gt;&lt;li&gt;What is TACACS? Radius?&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-4496079566148561817?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/4496079566148561817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=4496079566148561817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4496079566148561817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4496079566148561817'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/cisco-networking-specific-interview.html' title='Cisco Networking specific interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6100106104180354990</id><published>2008-04-13T15:29:00.000-07:00</published><updated>2008-04-13T15:33:17.105-07:00</updated><title type='text'>Microsoft inrerview Questions</title><content type='html'>&lt;p&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;First interview Questions &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;If the Fibonacci series is 1,2,3,5,8,13,..... then 10 can be written as 8 + 2 ==&gt; 10010 and 17 can be written as 13 + 3 + 1 ==&gt; 100101. Got it??&lt;br /&gt;The Question was, given n, I need to get all possible representations of n in Fibonacci Binary Number System.&lt;br /&gt;as 10 = 8 + 2 ==&gt; 10010&lt;br /&gt;also 10 = 5 + 3 + 2 ==&gt; 1110&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I have a file in which there are supposed to be 4 billion numbers, starting from 1 to 4,000,000,000 but unfortunately one number is missing,i.e there are only 3,999,999,999 numbers, I need to find the missing number. In this question he asked me concepts like fopen, what will be the size of such a file and how such a big file will get loaded into RAM,and also concepts of logical/virtual/physical memory and memory paging.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I have an array consisting of 2n+1 elements. n elements in it are married, i.e they occur twice in the array, however there is one element&lt;br /&gt;which only appears once in the array. I need to find that number in a single pass using constant memory. {assume all are positive numbers}&lt;br /&gt;&lt;br /&gt;Eg :- 3 4 1 3 1 7 2 2 4&lt;br /&gt;Ans:- 7&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There is a temple, whose premises have a garden and a pond. It has 4 idols, each of Ram, Shiv, Vishnu and Durga. The priest plucks x flowers from the garden and places them in the pond. The number of flowers&lt;br /&gt;doubles up, and he picks y flowers out of them and goes to offer it to Lord Ram. By the time he reaches to the pond, he finds the remaining flowers also have doubled up in the meantime, so he again picks up y from&lt;br /&gt;the pond and goes to Lord Shiv.This process is repeated till all the Gods have y flowers offered to them, such that in the end no flower is left in the pond. Find x and y.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="text-decoration: underline;"&gt;Second : &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Asked About My Btech Final year Project. Design your own compiler that does trace back optimization.Give hypothetical test cases for your compiler.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There is a central server and some clients connected to it. All the changes made to data occur at the server, and all the clients have just read access.&lt;br /&gt;You have two  options:-&lt;br /&gt;1. Push :- The server keeps pushing data to the clients.&lt;br /&gt;2. Pull   :- The client keeps requesting the server to send data.&lt;br /&gt;&lt;br /&gt;What are the advantages and disadvantages of each type.Design a system which uses both the push as well as pull strategy.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Implement atof function.Write solid secure code only.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Third interview :&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; a) What is your CGPA?&lt;br /&gt;&lt;br /&gt;b )What are your immediate goals?&lt;br /&gt;&lt;br /&gt;c) What are your long term goals?&lt;br /&gt;&lt;br /&gt;d) And some more questions on academics.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Find the first unrepeated character in a string of English language in O(n).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Simple questions on Probability.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Difference between a 32-bit OS and a 64-bit OS. Some questions on address space and fetch cycles/ Instruction Set of a processor.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6100106104180354990?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6100106104180354990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6100106104180354990' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6100106104180354990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6100106104180354990'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/there-will-be-3-interviews-first-two.html' title='Microsoft inrerview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1674820054161861328</id><published>2008-04-13T15:28:00.000-07:00</published><updated>2008-04-13T15:29:14.442-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft interview Questions</title><content type='html'>&lt;ol&gt;&lt;br /&gt;&lt;li&gt;There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after merging the above 2 arrays(i.e. array of length 2n). Full points are given for the solution bearing efficiency O(log n). Partial points for the efficiency O(n).&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Given a string *Str of ASCII characters, write the pseudo code to remove the duplicate elements present in them. For example, if the given string is "Potato", then, the output has to be "Pota". Additional constraint is, the algorithm has to be in-place( no extra data structures allowed) . Extend your algorithm to remove duplicates in the string which consisted of UNICODE characters.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Given that, there are 2 linked lists L1 and L2. The algorithm finds the intersection of the two linked lists. i.e' "L1 intersection L2 " ( similar to intersection of 2 sets ). Write all the possible test cases involved in the above given problem.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1674820054161861328?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1674820054161861328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1674820054161861328' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1674820054161861328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1674820054161861328'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/microsoft-interview-questions_13.html' title='Microsoft interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-181670385984381433</id><published>2008-04-13T15:22:00.001-07:00</published><updated>2008-04-13T15:26:10.703-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><title type='text'>Amazon intern Interview Questions</title><content type='html'>&lt;p&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/amazon-intern-interview-questions.html"&gt;&lt;span style="font-weight: bold;"&gt;Amazon Internship Interview Round 1&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;There are two urns A and B and an equal number of red balls and blue balls.How do u place the balls in the urns such that the probability of picking up the red ball is greater?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Two trains enter at the opposite sides of a tunnel of length L with speeds 'V'. A particle enters the tunnel at the same time with a speed 'v' and it vibrates in the tunnel[i.e. if it reaches the end of the tunnel then it comes back]. What is the position of the particle by the time the 2 trains meet?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Write an &lt;a href="http://programminginterviews.blogspot.com/2008/04/amazon-intern-interview-questions.html"&gt;sql query &lt;/a&gt;to sort a table according to the amounts in a row and find the second largest amount.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;How do you kill a process?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is the functionality of a top command?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Given an array of size n+1 which contains all the numbers from 1 to n.Find the number which is repeated in O(n) time.How do you proceed with the same with floating numbers from 0 to 1 instead of 1 to n?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Design a datastructure to represent the movement of a knight on a chess board&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Write an algorithm to traverse a knight covering all the squares on a chessboard starting at a particular point.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/amazon-intern-interview-questions.html"&gt;&lt;span style="font-weight: bold;"&gt;Amazon Internship Interview Round 2&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Why do you like to work with us?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What work are you expecting?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Tell me about any of your experience&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-181670385984381433?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/181670385984381433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=181670385984381433' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/181670385984381433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/181670385984381433'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/amazon-intern-interview-questions.html' title='Amazon intern Interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2225009027502918476</id><published>2008-04-13T15:19:00.001-07:00</published><updated>2008-04-13T15:19:48.386-07:00</updated><title type='text'>Amazon standard Questions</title><content type='html'>&lt;ol&gt;&lt;br /&gt;&lt;li&gt;What are the major differences between C and C++?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What are the differences between new and malloc?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is the difference between delete and delete[?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What are the differences between a struct in C and in C++?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What are the advantages/disadvantages of using #define?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What are the advantages/disadvantages of using inline and const?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is the difference between a pointer and a reference?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When would you use a pointer? A reference?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What does it mean to take the address of a reference?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What does it mean to declare a function or variable as static?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is the order of initialization for data?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is name mangling/name decoration?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What kind of problems does name mangling cause?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;How do you work around them?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is a class?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What are the differences between a struct and a class in C++?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is the difference between public, private, protected, and friend access?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;For class CFoo { }; what default methods will the compiler generate for you&gt;?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;How can you force the compiler to not generate them?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is the purpose of a constructor? Destructor?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is a constructor initializer list?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When must you use a constructor initializer list?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is a:&lt;br /&gt;* Constructor?&lt;br /&gt;* Destructor?&lt;br /&gt;* Default constructor?&lt;br /&gt;* Copy constructor?&lt;br /&gt;* Conversion constructor?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What does it mean to declare a...&lt;br /&gt;&lt;br /&gt;* member function as virtual?&lt;br /&gt;* member function as static?&lt;br /&gt;* member variable as static?&lt;br /&gt;* destructor as static?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Can you explain the term "resource acquisition is initialization?"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is a "pure virtual" member function?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is the difference between public, private, and protected inheritance?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is virtual inheritance?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is placement new?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is the difference between operator new and the new operator?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is exception handling?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Explain what happens when an exception is thrown in C++.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What happens if an exception is not caught?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What happens if an exception is throws from an object's constructor?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What happens if an exception is throws from an object's destructor?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What are the costs and benefits of using exceptions?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When would you choose to return an error code rather than throw an exception?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is a template?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is partial specialization or template specialization?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;How can you force instantiation of a template?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is an iterator?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is an algorithm (in terms of the STL/C++ standard library)?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is std::auto_ptr?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is wrong with this statement?&lt;br /&gt;std::auto_ptr ptr(new char[10]);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;It is possible to build a C++ compiler on top of a C compiler. How would you do this?&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Basic Questions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* What is a friend, and why do you need it?&lt;br /&gt;* If this doesn't compile, why didn't it (or will it compile?) Don't show comments, which explain the problem.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;template &lt;class class="" k=""&gt; void HashTable &lt;&gt;::dummy()&lt;br /&gt;{&lt;br /&gt;K* k = NULL;&lt;br /&gt;Hashable* h = k; // If this fails to compile, it's because&lt;br /&gt;// K is not derived from Hashable.&lt;br /&gt;}&lt;br /&gt;&lt;/class&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;* This will loop forever. Why? Will it really loop forever? (Answer: Base:func() does not call Base::func(). Base: is just a label, so the line always will call Derived::func() until it runs out of stack space)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Base {&lt;br /&gt;  public:&lt;br /&gt;      Base() {}&lt;br /&gt;      virtual void func() { /* do something */ }&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Derived : public Base {&lt;br /&gt;public:&lt;br /&gt;  Derived() {}&lt;br /&gt;  virtual void func()&lt;br /&gt;  {&lt;br /&gt;Base:func();&lt;br /&gt;/* do something else */&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;Derived d;&lt;br /&gt;d.func();    // Never returns!&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;More advanced questions:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* What is a vtbl ?&lt;br /&gt;* What is RTTI and why do you need it?&lt;br /&gt;* How do I specialize a template? Give an example.&lt;br /&gt;&lt;br /&gt;To separate sheep from goats (for those claiming C++ Guru status):&lt;br /&gt;&lt;br /&gt;* What is a partial template? Why would you use one?&lt;br /&gt;* How to I create a binary functor in the STL?&lt;br /&gt;&lt;br /&gt;Given the following code:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class A;&lt;br /&gt;class B;&lt;br /&gt;&lt;br /&gt;class C {&lt;br /&gt;  A* a_;&lt;br /&gt;  B* b_;&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Implement a copy constructor and assignment operator for C. A sample solution is something like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class C {&lt;br /&gt;A* a_;&lt;br /&gt;B* b_;&lt;br /&gt;&lt;br /&gt;void swap(C&amp;amp; rhs) { rhs.a_ = a_; rhs.b_ = b_; }&lt;br /&gt;&lt;br /&gt;public:&lt;br /&gt;&lt;br /&gt;C(const C&amp;amp; rhs) {&lt;br /&gt;  auto_ptr&lt;&gt; a(new A(rhs.a_));&lt;br /&gt;  auto_ptr&lt;&gt; b(new B(rhs.b_)):&lt;br /&gt;&lt;br /&gt;      delete a_;&lt;br /&gt;  delete b_;&lt;br /&gt;&lt;br /&gt;  a_ = a.release();&lt;br /&gt;  b_ = b.release();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;C&amp;amp; operator=(const C&amp;amp; rhs) {&lt;br /&gt;  C temp(rhs);&lt;br /&gt;  temp.swap(*this);&lt;br /&gt;  return *this;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What is wrong with this class, assuming that this is its complete interface?&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;class C {&lt;br /&gt;char *p;&lt;br /&gt;public:&lt;br /&gt;C() { p = new char[64]; strcpy(p, "Hello world"); }&lt;br /&gt;~C() { delete p; }&lt;br /&gt;&lt;br /&gt;      void foo() { cout &lt;&lt; "My ptr is: '" &lt;&lt; p &lt;&lt; "'" &lt;&lt; endl; }&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Since this has an overtly programmed destructor, the member wise semantics for destruction are not good enough; therefore, they are not good enough for copy and assignment either. But, the copy ctor and op= are not programmed, so we will have some serious trouble.&lt;br /&gt;&lt;br /&gt;Gradual hinting: what happens when we make a copy? [correct answer: pointer is copied]. Now, the original goes out of scope, what happens to the copy? [pointer dangles]. How would you fix it?&lt;br /&gt;&lt;br /&gt;[also, that delete p should be delete[ p since p was allocated with the array new]&lt;br /&gt;&lt;br /&gt;Assuming that swap() and copy construction are part of your interface for class C, what's the cookie-cutter pattern for operator= that uses them?&lt;br /&gt;&lt;br /&gt;answer:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;C&amp;amp; C::operator=(const C &amp;amp;rhs) {&lt;br /&gt;if (this != &amp;amp;rhs) {&lt;br /&gt;  C tmp(rhs);&lt;br /&gt;  this-&gt;swap(tmp);&lt;br /&gt;}&lt;br /&gt;return *this;&lt;br /&gt;}&lt;br /&gt;]]&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2225009027502918476?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2225009027502918476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2225009027502918476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2225009027502918476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2225009027502918476'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/amazon-standard-questions.html' title='Amazon standard Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3933194511926837259</id><published>2008-04-13T15:17:00.001-07:00</published><updated>2008-04-13T15:17:52.515-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>Yahoo interview Questions</title><content type='html'>1) There is a n x n grid of 1's and 0's. Find the i , where i is the row&lt;br /&gt;containing all 1's and all 0's(except the intersection point). Should do&lt;br /&gt;it in less than 25 comparisons&lt;br /&gt;..&lt;br /&gt;2) Use 2 stacks to implement a queue. Followed up with making the&lt;br /&gt;access to the Data structure concurrently.&lt;br /&gt;&lt;br /&gt;3) C++ question was good, implement a c++ class such that it allows us&lt;br /&gt;to add data members at runtime.&lt;br /&gt;&lt;br /&gt;4)Implement a transaction manager in a &lt;a id="KonaLink0" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/2007/09/yahoo-interview.html#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;database &lt;/span&gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;server&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;. The discussion&lt;br /&gt;involved a lot of stuff about transaction logs.&lt;br /&gt;&lt;br /&gt;5) How do you tune an &lt;a id="KonaLink1" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/2007/09/yahoo-interview.html#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="border-bottom: 1px solid blue; color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static; padding-bottom: 1px; background-color: transparent;"&gt;application&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;. Creating indexes.&lt;br /&gt;&lt;br /&gt;6) Some SQL performance tuning questions on creating indexes.&lt;br /&gt;&lt;br /&gt;7) can you write a foo() in c? If so how can u do it?&lt;br /&gt;&lt;br /&gt;8) vector implementation questions.&lt;br /&gt;&lt;br /&gt;9) Almost everyone asked about my language.(except ppl who attended my talk).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3933194511926837259?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3933194511926837259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3933194511926837259' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3933194511926837259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3933194511926837259'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/yahoo-interview-questions.html' title='Yahoo interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7431974833771763711</id><published>2008-04-12T19:33:00.000-07:00</published><updated>2008-04-12T19:34:53.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft interview Questions IDC</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;First Interview:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The interviewer initially asked me all about my internship project and my role in that.&lt;br /&gt;&lt;br /&gt;1. Given an Ellipse class can you derive a Circle class from it?&lt;br /&gt;What all methods would you include in the circle class and what all in&lt;br /&gt;ellipse?&lt;br /&gt;Design a class of curve from which Circle and Ellipse can be inherited.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. This contained series of questions on C++.&lt;br /&gt;&lt;br /&gt;   * What are virtual functions? Why are they used? Give examples.&lt;br /&gt;   * What are pure virtual functions and abstract classes? When do we use it?&lt;br /&gt;   * Where are virtual functions stored in the memory? How does the object knows that the virtual function to be called is from base class or derived class?&lt;br /&gt;   * What is VTable (virtual table) and what does it do?&lt;br /&gt;   * Few more similar questions that I am not able to remember.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. These were also series of Questions mostly on OS skills:&lt;br /&gt;&lt;br /&gt;   * What are DLLs? Why do we use them?&lt;br /&gt;   * How does DLL work? Can anybody call methods written in DLLs ?&lt;br /&gt;   * What are static and shared Library? Which is fast and why?&lt;br /&gt;   * Questions about paging, loading, linking etc.&lt;br /&gt;   * Concept of 32-bit OS, virtual memory, inter-process communication etc.&lt;br /&gt;   * Few more similar questions that I am not able to remember.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Given a BST (Binary search Tree) how will you find median in that?&lt;br /&gt;&lt;br /&gt;Constraints:&lt;br /&gt;&lt;br /&gt;   * No extra memory.&lt;br /&gt;   * Function should be reentrant (No static, global variables allowed.)&lt;br /&gt;   * Median for even no of nodes will be the average of 2 middle elements and for odd no of terms will be middle element only.&lt;br /&gt;   * Algorithm should be efficient in terms of complexity.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Write a solid secure code for it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;Second Interview:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Again, the interviewer asked me about my internship project and my role etc stuff.&lt;br /&gt;&lt;br /&gt;1) He gave me a question that suppose you are getting an infinite binary stream of characters then after any point of time you need to print whether the no is divisible by 3 or not, how will you do that?&lt;br /&gt;&lt;br /&gt;I was bit confused. I asked him that how are we getting the stream? Then he told me that you take a function signature as:&lt;br /&gt;&lt;br /&gt;char getStreamBit();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;which will return you the bit character (either '1' or '0') one by one. Also in the end he asked me to write the code of my algorithm on the board.&lt;br /&gt;&lt;br /&gt;2) Then he asked me if I have any questions? I asked about 2-3 questions.&lt;br /&gt;&lt;br /&gt;He was in hurry, so he left after that.&lt;br /&gt;&lt;br /&gt;First and Second interview together lasted for JUST 1 hour and 45 minutes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;Third Interview:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Again, he too asked me about my internship project, implementation, my role etc.&lt;br /&gt;&lt;br /&gt;1. Modified 2 color sort problem i.e. you are given an array of integers containing only 0s and 1s.You have to place all the 0s in even position and 1s in odd position. And if suppose, no. of 0s exceed no. of 1s or vice versa then keep them untouched. Do that in ONE PASS and without taking extra memory (modify the array in-place).&lt;br /&gt;&lt;br /&gt;For Example :&lt;br /&gt;&lt;br /&gt;Input Array: {0,1,1,0,1,0,1,0,1,1,1,0,0,1,0,1,1}&lt;br /&gt;Output Array: {0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1}&lt;br /&gt;&lt;br /&gt;Write a solid secure code for it.&lt;br /&gt;&lt;br /&gt;2. You are given a Linked List and a function declaration as node* KReverse(node* head, int k);&lt;br /&gt;&lt;br /&gt;KReverse is a function that reverses the nodes of a Linked List k at a time and then returns the modified Linked List.&lt;br /&gt;&lt;br /&gt;For Example&lt;br /&gt;&lt;br /&gt;Linked List : 1-&gt;2-&gt;3-&gt;4-&gt;5-&gt;6-&gt;7-&gt;8-&gt;9-&gt;10-&gt;11&lt;br /&gt;&lt;br /&gt;For k = 2&lt;br /&gt;&lt;br /&gt;Return Value: 2-&gt;1-&gt;4-&gt;3-&gt;6-&gt;5-&gt;8-&gt;7-&gt;10-&gt;9-&gt;11&lt;br /&gt;&lt;br /&gt;For k = 3&lt;br /&gt;&lt;br /&gt;Return value: 3-&gt;2-&gt;1-&gt;6-&gt;5-&gt;4-&gt;9-&gt;8-&gt;7-&gt;10-&gt;11&lt;br /&gt;&lt;br /&gt;Write a solid secure definition for the function KReverse.&lt;br /&gt;&lt;br /&gt;Constraints:&lt;br /&gt;&lt;br /&gt;   * If the no. of nodes in a link list is not a multiple of k then left-out nodes in the end should remain as it is.&lt;br /&gt;   * You have to retain the memory address of the nodes without modifying it i.e. you can't just interchange the values in the nodes.&lt;br /&gt;   * No extra memory allowed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;He tested some of his inputs with the code I wrote.&lt;br /&gt;&lt;br /&gt;The third interview lasted for about little more than 1.5 hrs and in the end he also offered me some fruits (Apple, Guava etc) and asked me about my college etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;Fourth Interview:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I had my fourth interview too.&lt;br /&gt;&lt;br /&gt;1. Initially he asked me about my earlier interviews. Who were your interviewers, how did you perform etc. things. I told him that in my first interview I just made a small mistake writing code (median of BST under constraints) for one of the case. So he asked me to complete my code for that case too and write solid secure code only.&lt;br /&gt;&lt;br /&gt;He was very very particular about the code rather than the problem solving aspect for this question. He was basically checking my concepts about pointers, memory allocation etc things in whole interview and my way of writing code.&lt;br /&gt;&lt;br /&gt;2. Suppose you are passing a string to a Formatter function. Get the formatted news feed output string such that&lt;br /&gt;&lt;br /&gt;   * There should be one sentence per line.&lt;br /&gt;   * There shouldn't be any spaces i.e. the line shouldn't be blank.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;Input String:&lt;br /&gt;&lt;br /&gt;". ....West Indies reached the final of DLF series. .Lalu was invited&lt;br /&gt;to IIM-A once again. . .. .. . Microsoft unveils Zune, an ipod killer. .&lt;br /&gt;. . . "&lt;br /&gt;&lt;br /&gt;Output String:&lt;br /&gt;&lt;br /&gt;"West Indies reached the final of DLF series.&lt;br /&gt;Lalu was invited to IIM-A once again.&lt;br /&gt;Microsoft unveils Zune, an ipod killer."&lt;br /&gt;&lt;br /&gt;Design and write solid secure code for the Formatter Function.&lt;br /&gt;&lt;br /&gt;As I said earlier, he was very particular about the code. This is where you need to follow all the standards, convention and check for the test cases. He just wanted to check my concepts about the pointers, memory allocation, OS etc stuff and of course the logic proposed by me for this particular problem(and questions like how much extra memory do you need for the output&lt;br /&gt;string, how can you reduce that etc, complexity etc things)&lt;br /&gt;&lt;br /&gt;He then asked me to give some of the test cases for the input string.&lt;br /&gt;&lt;br /&gt;In between, he kept me asking questions like what if type int(32 bit) is replaced with type int64 (64bit). What modifications will you make to your code. Questions about double pointers, segmentation fault, all conceptual questions again!&lt;br /&gt;&lt;br /&gt;Then he asked me about my interests. Why should we hire you etc HR questions. If you have any questions etc. stuff&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7431974833771763711?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7431974833771763711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7431974833771763711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7431974833771763711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7431974833771763711'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/microsoft-interview-questions-idc.html' title='Microsoft interview Questions IDC'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-215064043901376095</id><published>2008-04-12T19:30:00.000-07:00</published><updated>2008-04-12T19:31:52.050-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft interview Questions</title><content type='html'>1. Given a Parent -Child binary tree ,build the child -sibling version of it? Minimize the space requirements wherever possible.&lt;br /&gt;&lt;br /&gt;2. Given a binary tree build a linked list of all its nodes such that the nodes of a level appear before the nodes of the next level?&lt;br /&gt;&lt;br /&gt;3. Given an infinite stream of bits with the bits being appended at the highest significant position. give an algorithm to to say whether the number formed by using the sequence of bits that had been processed till then, is divisible by 3 or not?&lt;br /&gt;&lt;br /&gt;4. Given a string S of words and no of character per line m ,with m being greater than the longest word in S,print S in a set of lines so that each line contains no more than m characters and no word split between 2 lines.&lt;br /&gt;&lt;br /&gt;5. Given an expression remove the unnecessary brackets in it with out creating an ambiguity in its execution.&lt;br /&gt;input output&lt;br /&gt;ex1: (a+(b)+c) a+b+c&lt;br /&gt;ex2: (a*b)+c a*b+c&lt;br /&gt;&lt;br /&gt;6. Propose a tree based data structure to identify a node with nth rank with maximum efficiency .&lt;br /&gt;&lt;br /&gt;7. Given a string S of alphabets and 2 characters a,b find the minimum distance between instances of them such that position of a &lt;= position of b.&lt;br /&gt;&lt;br /&gt;8. Given an array of size n with first l positions filled with characters and a string s ,replace all the instances of ’%’ with this string s,given that the length of the array is sufficient to handle these substitutions.&lt;br /&gt;input output&lt;br /&gt;eg: abcdef%ghi%—— and “ppp” abcdefpppghippp&lt;br /&gt;1. Given a binary tree verify whether it is a binary search tree or not?&lt;br /&gt;2. Write a C code to merge 2 binary search trees and do the same 2 merge linked lists.How is the former different when compared to the later.(Discuss the issues)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-215064043901376095?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/215064043901376095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=215064043901376095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/215064043901376095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/215064043901376095'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/microsoft-interview-questions.html' title='Microsoft interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-8059888637441199239</id><published>2008-04-12T19:17:00.000-07:00</published><updated>2008-04-12T19:35:34.754-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google interview Questions</title><content type='html'>&lt;p&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-interview-questions_12.html"&gt;&lt;span style="font-weight: bold;"&gt;Google telephonic Interview&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Asked about my project. Prepare well to answer any type of questions that may arise in your project.They will just ask to explain about any one of the projects listed in your resume.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;In a plane, n points are given i.e. the input is (x1,y1), (x2,y2)... (xn,yn). Now&lt;br /&gt;given these n points.Find the maximum number of collinear points.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Write the code for finding the min of n number.&lt;br /&gt;&lt;pre&gt;I gave:&lt;br /&gt;&lt;br /&gt;for(i=0;i&lt;n;i++)&gt;&lt;min min="a[i]"&gt;&lt;/min&gt;&lt;/n;i++)&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Given that n numbers are from random sampling how many times (probability) does&lt;br /&gt;the line (i) be executed &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-interview-questions_12.html"&gt;Google Interview Round 2&lt;/a&gt;:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;What is Bottom up parsing and what is top down parsing?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What is a symbol table?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There is a portal with two billion users registered. If you store all the 2 billion users in a conventional databases it will take more time to retrieve the data about a particular user when that user tries to login. How do you handle this situation to make sure that the user gets the response quickly.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There are 8 identical balls. One of them is defective. It could be either heavier of lighter. Given a common balance how do you find the defective ball in least number of weighings.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You have all the English words with you. you would like to manage a dictionary so that you can look up when ever you have doubt. Which data structure would you like to use and why?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Asked me about all the details of hash table and heaps.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Write code for finding number of zeros in n!&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-interview-questions_12.html"&gt;Google Interview Round 3&lt;/a&gt; :&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Write C++ class for the game Connect Four. [Connect Four (also known as Plot Four, Four In A Row, and Four In A Line) is a two-player board game in which the players take turns in dropping discs into a seven column grid with the objective&lt;br /&gt;of getting four of one's own discs in a line.]&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Given a stack and an input string of 1234.At any point you can do anyone of&lt;br /&gt;the follow&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;i. take the next input symbol and Enque.&lt;br /&gt;ii. you can pop as many as you can. When ever you&lt;br /&gt;pop an element it will be printed&lt;br /&gt;  (you cannot pop from an empty stack)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Give an example of one permutation that this data structure cannot generate.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;For Example:&lt;br /&gt;&lt;br /&gt;1234 is input.&lt;br /&gt;&lt;br /&gt;First push all 1,2,3,4 on to stack and pop all.&lt;br /&gt;output will be 4321.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It means that this data structure can generate 4321.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Question 2 was pretty easy right? Now do again the same question but the&lt;br /&gt;data structure and input are different&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Input: 12345&lt;br /&gt;Data Structure: Deque ( Doubly Que )&lt;br /&gt;&lt;br /&gt;Note: Deque is a data structure into which you can do enque&lt;br /&gt;and deque from both sides.Some thing like this&lt;br /&gt;__________________________________&lt;br /&gt;enque ---&gt; &lt;----enque dequeue &lt;---- -----&gt;dequeue&lt;br /&gt;__________________________________&lt;span style="font-family:Georgia,serif;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Classic Egg Puzzle Problem&lt;br /&gt;&lt;br /&gt;You are given 2 eggs.You have access to a 100-store building.&lt;br /&gt;&lt;br /&gt;Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor.Both eggs are identical.You need to figure out the highest floor of a 100-store building an egg can be dropped without breaking.&lt;br /&gt;&lt;br /&gt;Now the question is how many drops you need to make. You are allowed to break 2 eggs in the process.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-interview-questions_12.html"&gt;Google Interview Round 4&lt;/a&gt; :&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Given n non overlapping intervals and an element. Find the interval into which this element falls.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Worst case is take all intervals one at a time and see whether the element lies in the interval or not.It will take O(n). So please give a solution that will do better than O(n).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Now given that the n intervals are overlapping then how do you solve? The interviewer was concentrating more on the complexities (running, memory ..)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Write code for Random Sort?&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Algorithm  is explained:&lt;br /&gt;&lt;br /&gt;Given an input array of size n. Random sort is sampling&lt;br /&gt;a new array from the given array and check whether the&lt;br /&gt;sampled array is sorted or not. If sorted return else&lt;br /&gt;sample again. The stress was on the&lt;br /&gt;code.&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://programminginterviews.blogspot.com/2008/04/google-interview-questions_12.html"&gt;Google Interview Round 5&lt;/a&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is Manager Round&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Tell me an achievement that you have done in your non academics&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Tell me about one of your project&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Take a feature of C++ and tell me how you have implemented it in one of your project&lt;/li&gt;&lt;br /&gt;&lt;li&gt;By taking one of your project as example tell me how you have taken care of software engineering where you would have handled more data&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There is a routine already written to find the subtraction of two sets ( set A - set B) . Write test cases for testing it.Tell me how do you test the test cases you have written?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There is a printed book. The page numbers are not printed. Now the printing of page numbers is being done separately. If the total number of digits printed is 1095 then how many pages does the book have?&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-8059888637441199239?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/8059888637441199239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=8059888637441199239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8059888637441199239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8059888637441199239'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/google-interview-questions_12.html' title='Google interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3630496220237063357</id><published>2008-04-12T19:13:00.000-07:00</published><updated>2008-04-12T19:16:18.039-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google Interview Questions</title><content type='html'>Round -1&lt;br /&gt;&lt;ol&gt;&lt;li&gt;What is the Space complexity of quick sort algorithm? how do find it?&lt;/li&gt;&lt;li&gt;What are dangling pointers?&lt;/li&gt;&lt;li&gt;Given that you can take one step or two steps forward from a given step. So find the total number of ways of reaching Nth step.&lt;/li&gt;&lt;li&gt;You are given biased coin. Find unbiased decision out of it?&lt;/li&gt;&lt;li&gt;On a empty chessboard, a horse starts from a point( say location x,y) and it starts moving randomly, but once it moves out of board, it cant come inside. So what is the total probability that it stays within the board after N steps.&lt;/li&gt;&lt;/ol&gt;Round -2&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You have 1 to N-1 array and 1 to N numbers, and one number is missing, you need to find the missing the number. Now you have 1 to N-2 numbers, and two numbers missing. Find them.&lt;/li&gt;&lt;li&gt;You have cycle in linked list. Find it. Prove that time complexity is linear. Also find the node at which looping takes place.&lt;/li&gt;&lt;li&gt;Questions on my project please be prepare well about your project&lt;/li&gt;&lt;li&gt;How do you search for a word in a large database.&lt;/li&gt;&lt;li&gt;How do you build address bar in say gmail. i.e. if you press 'r' then you get all email starting from 'r', and if you press 'ra' then you will get emails starting from 'ra'.&lt;/li&gt;&lt;/ol&gt;Round -3&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You have given an array. Find the maximum and minimum numbers in less number of comparisons.&lt;/li&gt;&lt;li&gt;You have given an array from 1 to N and numbers also from 1 to N. But more than one number is missing and some numbers have repeated more than once. Find the algo with running time O(n).&lt;/li&gt;&lt;/ol&gt;Round -4&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Three strings say A,B,C are given to you. Check weather 3rd string is interleaved from string A and B.&lt;br /&gt;&lt;pre&gt;       Ex: A="abcd" B="xyz" C="axybczd". answer is yes.&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Given two sorted arrays A and B.&lt;br /&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Find the intersection of these arrays A and B.&lt;/li&gt;&lt;li&gt;If array A is small and array B is too large. how will you proceed for getting intersection of those two arrays?&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;Round -5&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;If you get into &lt;a id="KonaLink0" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/2007/09/google-interview-questions.html#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="border-bottom: 1px solid blue; color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static; padding-bottom: 1px; background-color: transparent;"&gt;Google&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;, which products are you going to work on?&lt;/li&gt;&lt;li&gt;What is TCP, UDP. what is reliability, unreliability, give examples of these?&lt;/li&gt;&lt;li&gt;What is http protocol?&lt;/li&gt;&lt;li&gt;How does Google &lt;a id="KonaLink1" target="_top" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://placementsindia.blogspot.com/2007/09/google-interview-questions.html#"&gt;&lt;span style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;color:blue;" &gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;search &lt;/span&gt;&lt;span class="kLink" style="color: blue ! important; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: 400; font-size: 11.3333px; position: static;"&gt;engine&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; works?&lt;/li&gt;&lt;li&gt;What is indexing, what is the input and output to it. how Google does that?&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3630496220237063357?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3630496220237063357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3630496220237063357' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3630496220237063357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3630496220237063357'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/google-interview-questions.html' title='Google Interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3396969556453731014</id><published>2008-04-09T10:14:00.000-07:00</published><updated>2008-04-09T10:28:57.297-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google Top Interview Puzzles</title><content type='html'>&lt;span style="font-family: lucida grande;font-family:Courier New;" &gt;&lt;li&gt;1)  There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to A[N-1].&lt;br /&gt;&lt;br /&gt;Solve it without division operator and in O(n).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;2) There is a linked list of numbers of length N. N is very large and you don’t know N. You have to write a function that will return k random numbers from the list. Numbers should be completely random.&lt;br /&gt;&lt;br /&gt;Hint:&lt;br /&gt;&lt;br /&gt;1. Use random function rand() (returns a number between 0 and 1) and irand()&lt;br /&gt;(return either 0 or 1)&lt;br /&gt;2. It should be done in O(n).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;3) Find or determine non existence of a number in a sorted list of N numbers where the numbers range over M, M &gt;&gt; N and N large enough to span multiple disks. Algorithm to beat O(log n) bonus points for constant time algorithm.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;4) You are given a game of Tic Tac Toe. You have to write a function in which you pass the whole game and name of a player. The function will return whether the player has won the game or not. First you to decide which data structure you will use for the game.You need to tell the algorithm first and then need to write the code.&lt;br /&gt;&lt;br /&gt;Note: Some position may be blank in the game। So your data structure should&lt;br /&gt;consider this condition also.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;5) You are given an array [a1 To an] and we have to construct another array [b1 To bn] where bi = a1*a2*...*an/ai. you are allowed to use only constant space and the time complexity is O(n). No divisions are allowed.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;6) How do you put a Binary Search Tree in an array in a efficient manner.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hint :: If the node is stored at the ith position and its children are at&lt;br /&gt;2i and 2i+1(I mean level order wise)Its not the most efficient way.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;7) How do you find out the fifth maximum element in an Binary Search Tree in efficient manner.&lt;br /&gt;&lt;br /&gt;Note :: You should not use use any extra space. i.e sorting Binary Search Tree&lt;br /&gt;and storing the results in an array and listing out the fifth element.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;8 )Given a Data Structure having first n integers and next n chars. A = i1 i2 i3 ... iN c1 c2 c3 ... cN.Write an in-place algorithm to rearrange the elements of the array ass A = i1 c1 i2 c2 ... in cn&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;9) Given two sequences of items, find the items whose absolute number increases or decreases the most when comparing one sequence with the other by reading the sequence only once.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;10 )Given That One of the strings is very very long , and the other one could be of various sizes. Windowing will result in O(N+M) solution but could it be better? May be NlogM or even better?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;11 )How many lines can be drawn in a 2D plane such that they are equidistant from 3 non-collinear points ?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;12) Lets say you have to construct Google maps from scratch and guide a person standing on Gateway of India (Mumbai) to India Gate(Delhi).How do you do the same ?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;13) Given that you have one string of length N and M small strings of length L . How do you efficiently find the occurrence of each small string in the larger one ?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;14)Given a Binary Tree, Programmatically you need to Prove it is a Binary Search Tree&lt;br /&gt;Hint: Some kind of pointer handling with In Order Traversal - anybody in for&lt;br /&gt;writing some code&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;15 )You are given a small sorted list of numbers, and a very very long sorted list of numbers - so long that it had to be put on a disk in different blocks. How would you find those short list numbers in the bigger one?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;16)Suppose you have given N companies, and we want to eventually merge them into one big company. How many ways are theres to merge?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;17) Given a file of 4 billion 32-bit integers, how to find one that appears at least twice?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;18) Write a program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;19) Design a stack. We want to push, pop, and also, retrieve the minimum element in constant time.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;20) Given a set of coin denominators, find the minimum number of coins to give a certain amount of change.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;21) Given an array,&lt;br /&gt;&lt;br /&gt;i) find the longest continuous increasing subsequence.&lt;br /&gt;&lt;br /&gt;ii) find the longest increasing subsequence.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;22) Suppose we have N companies, and we want to eventually merge them into one big company. How many ways are there to merge?&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;23) Write a function to find the middle node of a single link list.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;24 )Given two binary trees, write a compare function to check if they are equal or not. Being equal means that they have the same value and same structure.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;25) Implement put/get methods of a fixed size cache with LRU replacement algorithm.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;26 ) You are given with three sorted arrays ( in ascending order), you are required to find a triplet ( one element from each array) such that distance is minimum.&lt;br /&gt;&lt;br /&gt;Distance is defined like this :&lt;br /&gt;&lt;br /&gt;If a[i], b[j] and c[k] are three elements then&lt;br /&gt;&lt;br /&gt;distance=max(abs(a[i]-b[j]),abs(a[i]-c[k]),abs(b[j]-c[k]))"&lt;br /&gt;&lt;br /&gt;Please give a solution in O(n) time complexity&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;27 )Classic - Egg Problem&lt;br /&gt;&lt;br /&gt;You are given 2 eggs.You have access to a 100-storey building.&lt;br /&gt;&lt;br /&gt;Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor.Both eggs are identical.You need to figure out the highest floor of a 100-storey building an egg can be dropped without breaking.&lt;br /&gt;&lt;br /&gt;Now the question is how many drops you need to make. You are allowed to break 2 eggs in the process.&lt;br /&gt;&lt;br /&gt;You can discuss these &lt;a href="http://programminginterviews.blogspot.com/search/label/Interviews"&gt;puzzles&lt;/a&gt; in comments.if you have any more &lt;a href="http://programminginterviews.blogspot.com/search/label/Google"&gt;Google&lt;/a&gt; which are interesting and frequently asking in interviews comment it, i will add to the above 27 puzzles.&lt;/li&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3396969556453731014?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3396969556453731014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3396969556453731014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3396969556453731014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3396969556453731014'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2008/04/google-top-interview-puzzles.html' title='Google Top Interview Puzzles'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3202327510784707606</id><published>2007-08-17T01:38:00.000-07:00</published><updated>2007-12-28T03:55:57.769-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DEShaw'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Structures and Algorithms'/><title type='text'>Deshaw interview questions</title><content type='html'>1)What is the number of zeros of the product of the first 100 numbers ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2)A report has 20 sheets each of 55 lines and each line consists of 65 characters. If this report is to be retyped with each sheet having 65 lines and each line of 75 characters wht will be the reduction percent in the pages ?&lt;br /&gt;&lt;br /&gt;(a) 22.5 % (b) 35 (c) 25 (d)none&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: 25&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3)A man driving the car at twice the speed of auto oneday he was driven car for 10 min. and car is failed. he left the car and took auto to goto the office .he spent 30 min. in the auto. what will be the time take by car to go office?&lt;br /&gt;(a) 25 (b) 30 (c) 35 (d) none&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: 25&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;4)Write code for initializing one dimentional and two dimentional array in a C Program?&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: I am sure you know this!&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;5)What is the difference between AWT &amp;amp; Swing?&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Swing is written in Pure Java&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;AWT components use native code and controls has OS specific look and feel&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;6)If a number is choosen between 100 and 999 including these numberrs what is the provbabilty that the number selected does not contain a 7 is?&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: 18/25 (Check once!)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;7)What command is used for knowing our own computer's IP address&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: ifconfig - for MAC and LINUX&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;ipconfig for windows&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8)How many no of 4x1 muxes are required for making a 16x1 mux?&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Five&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;9)Minimum number of IP addresses requiered for a router?&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Two&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3202327510784707606?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3202327510784707606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3202327510784707606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3202327510784707606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3202327510784707606'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/deshaw-interview-questions.html' title='Deshaw interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-331347014352343946</id><published>2007-08-17T01:05:00.001-07:00</published><updated>2007-12-28T04:05:04.179-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sasken'/><title type='text'>Sasken Interview questions</title><content type='html'>&lt;div style="TEXT-ALIGN: justify"&gt;&lt;span style="TEXT-DECORATION: underline"&gt;1)&lt;/span&gt;I am running a windows based application.While running the script on QTP ,The Application pop-up an Error Message as "object Disabled" in two different scenarios &lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt; &lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt;Scenario 1--&gt;The Application pops-up  a Message for Max Session Reached(as the application is set to hold 2 sessions and if it crosses the pre-defined limit then the error message pops-up) &lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt; &lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt;Scenario 2--&gt;When Network connectivity is disabled the Application screen gets greyed out in colour with no operation possible. &lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt; &lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt;Now though Exception handling features in QTP ,we need to do the following For Scenarion 1--&gt;Through Exception handling we need to just accept the Message pop-up in the Application and and resume with the call function as is for Scenario 2--&gt; Through Exception Handling featutes on QTP we need to shut down the client , restart the client and resume the call functions as it is &lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt; &lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt;Note: The Application returns an Error Message as "object disabled" in both the cases i.e for pop-up message and when the Apllication getting greyed out due to Network failure how can we enhance the script in such a way that for the same error message retured by the application in two different and how to handle them????&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2)What is the ethernet interface? Wand when we can use? How to connect the host systems to target system&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3)What is the difference between ArrayList and Vector?&lt;/div&gt;&lt;div style="TEXT-ALIGN: justify"&gt;&lt;span style="color:#000099;"&gt;Ans: ArrayList is not synchronized while Vector is Synchronized.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4)How to test the MMS application?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5)What is regression testing?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-331347014352343946?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/331347014352343946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=331347014352343946' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/331347014352343946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/331347014352343946'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/sasken-interview-questions.html' title='Sasken Interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7721687499901279859</id><published>2007-08-15T07:32:00.000-07:00</published><updated>2007-12-28T06:02:04.184-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Cisco interview questions</title><content type='html'>1)What is Recovery Testing&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: In software testing, recovery testing is the activity of testing how well the software is able to recover from crashes, hardware failures and other similar problems.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;2)Which layer is responsible for determining if sufficient resources for the intended communication exists?&lt;br /&gt;* Application&lt;br /&gt;* Network&lt;br /&gt;* Session&lt;br /&gt;* Presentation&lt;br /&gt;* Transport&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans:The Application layer of the OSI model is where users communicate to the computer. The Application layer is responsible for identifying and establishing the availability of the intended communication partner and determining if sufficient resources for the intended communication exist.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;3)What are the 2 functions of the Data Link Mac layer?&lt;br /&gt;* Handles access to shared media&lt;br /&gt;* Manages protocol access to the physical network medium&lt;br /&gt;* Provides SAPs for higher level protocols&lt;br /&gt;* Allows multiple devices to uniquely identify one another on the data link layer&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Handles access to shared media  and Allows multiple devices to uniquely identify one another on the data link layer&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;4)Describe End to End network services: (Choose all that apply)&lt;br /&gt;* Best Route selection&lt;br /&gt;* Accomplished Segment by Segment, each segment is autonomous&lt;br /&gt;* Flow Control &amp;amp; Data Integrity&lt;br /&gt;* Best efforts packet delivery&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Accomplished Segment by Segment, each segment is autonomous and Flow Control &amp;amp; Data Integrity (Not sure! Double check!)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;5)Which of the following provide correct information about a protocol at the transport layer of the OSI model?&lt;br /&gt;* UDP - Provides Connectionless datagrams service&lt;br /&gt;* TCP - Provides Connection Oriented Services&lt;br /&gt;* SMTP - Provides Mail Exchange&lt;br /&gt;* IP - Route determination&lt;br /&gt;* FTP - Transfers of Files&lt;br /&gt;&lt;br /&gt;Ans: &lt;span style="color:#000099;"&gt;UDP - Provides Connectionless datagrams service and TCP - Provides Connection Oriented Services&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;6)Which layer is responsible for providing mechanisms for multiplexing upper-layer application, session establishment, and tear down of virtual circuits?&lt;br /&gt;* Session&lt;br /&gt;* Network&lt;br /&gt;* Physical&lt;br /&gt;* Transport&lt;br /&gt;* Application&lt;br /&gt;* Presentation&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Transport Layer&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;7)Which of the following are logged when IP access list logging is enabled?&lt;br /&gt;* source address&lt;br /&gt;* protocol&lt;br /&gt;* source port&lt;br /&gt;* destination address&lt;br /&gt;* access list number&lt;br /&gt;* destination port&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8)What?s the default CDP holdtime in seconds for Cisco routers?&lt;br /&gt;* 30 seconds&lt;br /&gt;* 180 seconds&lt;br /&gt;* 90 seconds&lt;br /&gt;* 60 seconds&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: 180 Seconds&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;9)Which two of the following protocols are used at the Transport layer?&lt;br /&gt;* ARP&lt;br /&gt;* UDP&lt;br /&gt;* ICMP&lt;br /&gt;* RARP&lt;br /&gt;* TCP&lt;br /&gt;* BootP&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: TCP and UDP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10)Choose three reasons why the networking industry uses a layered model:&lt;br /&gt;A* It facilitates systematic troubleshooting&lt;br /&gt;B* It allows changes in one layer to occur without changing other layers&lt;br /&gt;C* It allows changes to occur in all layers when changing one protocol&lt;br /&gt;D* It clarifies how to do it rather than what general function to be done&lt;br /&gt;E* It clarifies what general function is to be done rather than how to do it&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: A, B, and E&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;11)Which layer is responsible for identifying and establishing the availability of the intended communication partner?&lt;br /&gt;* Application&lt;br /&gt;* Presentation&lt;br /&gt;* Transport&lt;br /&gt;* Session&lt;br /&gt;* Network&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Application&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;12)What is TACACS? Radius?&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Terminal Access Controller Access-Control System (TACACS) is a remote authentication protocol that is used to communicate with an authentication server commonly used in UNIX networks. TACACS allows a remote access server to communicate with an authentication server in order to determine if the user has access to the network.&lt;br /&gt;&lt;br /&gt;RADIUS: Remote Authentication Dial In User Service (RADIUS) is an AAA (authentication, authorization, and accounting) protocol for controlling access to network resources. RADIUS is commonly used by ISPs and corporations managing access to Internet or internal networks across an array of access technologies including modem, DSL, wireless and VPNs.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;13)What is flow or netflow?&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: NetFlow is an open but proprietary network protocol developed by Cisco Systems to run on Cisco IOS-enabled equipment for collecting IP traffic information.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;14)What is SPAN or RSPAN?&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: Switched Port Analyzer. Remote Switched Port Analyzer. You can monitor traffic flowing to a port from another port.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;15)What is VMPS?&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans: The VLAN Membership Policy Server ( VMPS ) makes it possible to use a client/server architecture to manage dynamic VLAN based on the MAC addresses.&lt;br /&gt;When someone connects to a port, the client switch connects it to server VMPS to know if this MAC address can be connected to this port.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7721687499901279859?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7721687499901279859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7721687499901279859' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7721687499901279859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7721687499901279859'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/cisco-interview-questions.html' title='Cisco interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-183713792595267728</id><published>2007-08-15T07:09:00.000-07:00</published><updated>2007-12-28T10:15:30.903-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Cisco</title><content type='html'>&lt;span style="font-family:georgia;"&gt;Continued ... &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;b&gt;&lt;strong&gt;                                                      SOFTWARE SECTION&lt;/strong&gt;&lt;/b&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="font-family:georgia;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;1. The starting location of an array is 1000. If the array[1..5/...4] is stored in row major order, what is the location of element [4,3]. Each word occupies 4 bytes. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:#000099;"&gt;Ans: 1056 (Check it out for yourself!)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:#000099;"&gt;&lt;br /&gt;&lt;/span&gt;2. In a tertiary tree, which has three childs for every node, if the number of internal nodes are N, then the total number of leaf nodes are?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans: (2N+1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;3. Explain the term "locality of reference" ? &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:#000099;"&gt;Ans: In &lt;/span&gt;&lt;span style="color:#000099;"&gt;computer science&lt;/span&gt;&lt;span style="color:#000099;"&gt;, locality of reference, also called the principle of locality, is the term applied to situations where the same value or related &lt;/span&gt;&lt;span style="color:#000099;"&gt;storage&lt;/span&gt;&lt;span style="color:#000099;"&gt; locations are frequently accessed. There are three basic types of locality of reference: temporal, spatial and sequential:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:#000099;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:#000099;"&gt;Temporal locality -&lt;br /&gt;Here a resource that is referenced at one point in time is referenced again soon afterwards.&lt;br /&gt;Spatial locality -&lt;br /&gt;Here the likelihood of referencing a storage location is greater if a storage location near it has been recently referenced.&lt;br /&gt;Sequential locality -&lt;br /&gt;Here storage is accessed sequentially, in descending or ascending order. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:#000099;"&gt;&lt;p&gt;&lt;br /&gt;&lt;/span&gt;4. What is the language used for Artificial Intelligence &lt;/p&gt;&lt;p&gt;&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:#000099;"&gt;Ans: lisp&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:georgia;"&gt;&lt;p&gt;&lt;br /&gt;5. What is the character set used in JAVA 2.0 ?&lt;/p&gt;&lt;p&gt;&lt;/span&gt;&lt;span style="font-family:georgia;color:#000099;"&gt;Ans: Unicode&lt;o:p&gt;&lt;/o:p&gt; &lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:georgia;"&gt;&lt;p&gt;&lt;br /&gt;6. char a =0xAA ;&lt;br /&gt;int b ;&lt;br /&gt;b = (int) a ;&lt;br /&gt;b = b &gt;&gt; 4 ;&lt;br /&gt;printf("%x",b);&lt;br /&gt;&lt;br /&gt;What is the output of the above &lt;/span&gt;&lt;a id="AdBriteInlineAd_program" style="CURSOR: pointer; COLOR: rgb(0,102,0); TEXT-DECORATION: none" name="AdBriteInlineAd_program"&gt;&lt;span style="BACKGROUND: url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x center bottom; MARGIN-BOTTOM: -2px; PADDING-BOTTOM: 2px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:georgia;"&gt;program segment ? &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;color:#000099;"&gt;Ans: fffffffa&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:georgia;"&gt;&lt;p&gt;&lt;br /&gt;7. struct s1 { struct { struct { int x; } s2 } s3 }y;&lt;br /&gt;How does one access x in the above given structure definition ?&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans: Compilation failes as ";" is missing immediately after declaration of the strcuture variables s2 and s3.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Otherwise, we can access x like this: y.s3.s2.x&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;8. Why there is no recursion in Fortran ?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans. There is no dynamic allocation. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;9. What is the worst case complexity of Quick sort?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans. O(n&lt;sup&gt;2&lt;/sup&gt;) &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;10. What will be sequence of operating system activities when an interrupt occurs ? &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans: Most modern general purpose microprocessors handle the interrupts the same way. When a hardware interrupt occurs the CPU stops executing the instructions that it was executing and jumps to a location in memory which either contains the interrupt handling code or an instruction branching to the interrupt handling code. This code usually operates in a special mode for the CPU, interrupt modeand, normally, no other interrupts can occur in this mode. There are exceptions though; some CPUs rank the interrupts in priority and higher level interrupts may happen. This means the first level interrupt handling code must be very carefully written and it often has its own stack which it uses to store the CPU's execution state (all of the CPU's normal registers and context) before it goes off and fully handles the interrupt. Some CPUs have a special set of registers that only exist in interrupt mode and the interrupt code can use these registers to do most of the context saving it needs to do. When the interrupt has been handled, the CPU's state is restored and the interrupt is dismissed. The CPU will then continue to doing whatever it was doing before being interrupted. It is important that the interrupt processing code is as efficient as possible and that the operating system does not block interrupts too long. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;Source: &lt;a href="http://www.science.unitn.it/~fiorella/guidelinux/tlk/node81.html"&gt;http://www.science.unitn.it/~fiorella/guidelinux/tlk/node81.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;11. In a sequential search, what is the average number of comparisons it takes to search through n elements ? &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans: (n+1)/2. &lt;/span&gt;&lt;/p&gt;&lt;span style="color:#000099;"&gt;&lt;p&gt;&lt;br /&gt;&lt;/span&gt;12. What is the size of the array declared as double * X[5] ?&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Ans. 5 * sizeof ( double * ) &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;13. A binary search tree with node information as 1,2,3,4,5,6,7,8 is given. Write the result obtained on preorder traversal of the binary search tree ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;color:#000099;"&gt;Ans : (Not sure!)&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:georgia;"&gt;&lt;p&gt;&lt;br /&gt;14. If size of the physical memory is 2&lt;sup&gt;32&lt;/sup&gt;-1, then what is the size of the virtual memory ? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;15.&lt;/p&gt;&lt;p&gt; S -&gt; A0B&lt;br /&gt;A-&gt; BB0&lt;br /&gt;B-&gt; AA1&lt;br /&gt;How many strings of length 5 are possible with the above productions? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;16. (3*4096+15*256+3*16+3). How many 1's are there in the binary representation of the result? &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans. 10 ( 16179 = 11111100110011)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;&lt;/span&gt;&lt;br /&gt;17. In memory mapped I/O how is I/O is accessed ? &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans: uses the same address bus to address both memory and I/O devices, and the CPU instructions used to access the memory are also used for accessing devices.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;18. What is the use of ALE in 8085 ? &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans: To latch the lower byte of the address.&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;19. If the logical memory of 8 X 1024 is mapped into 32 frames, then the number of bits for the logical address are____ ?&lt;br /&gt;&lt;span style="color:#000066;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000066;"&gt;Ans. 13&lt;/span&gt; &lt;/p&gt;&lt;p&gt;20. Context free grammar is useful for which purpose ? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;21. In ternary number representation, numbers are represented as 0,1,-1.(Here -1 is represented as 1 bar.) How is 352/9 represented in ternary number representation? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;22. There are processes which take 4,1,8,1 machine cycles respectively. If these are executed in round robin fashion with a time quantum of 1, what is the time it take for process 4 to complete ? &lt;span style="color:#000099;"&gt;Ans. 9&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;23. The minimum frequency of operation is specified for every processor because......&lt;br /&gt;&lt;span style="color:#000099;"&gt;a)for interfacing slow peripherals&lt;br /&gt;b)dynamic memory refreshing.&lt;br /&gt;c)to make compatible with other processor. &lt;/span&gt;&lt;/p&gt;&lt;span style="color:#000099;"&gt;&lt;p&gt;&lt;br /&gt;&lt;/span&gt;24. For linked list implementation , which search is not applicable ? &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Ans: Binary search. &lt;/span&gt;&lt;/p&gt;&lt;span style="color:#000099;"&gt;&lt;p&gt;&lt;br /&gt;&lt;/span&gt;25. Each character is represented by 7 bits, 1 bit is used to represent error bit and another bit for parity. If total number of bits transmitted is 1200 bits, then what is the number of symbols that can be transmitted ?&lt;br /&gt;&lt;span style="color:#000066;"&gt;Ans: 133 &lt;/span&gt;&lt;/p&gt;&lt;span style="color:#000066;"&gt;&lt;p&gt;&lt;br /&gt;&lt;/span&gt;26. Explain set associativity of cache ? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;27. Write the postfix form of the following expression . A+[[(B+C)+(D+E)*F]/G] &lt;/p&gt;&lt;p&gt;&lt;br /&gt;28. What is the function of the linker? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;29. void f(int y)&lt;br /&gt;{&lt;br /&gt;struct s *ptr;&lt;br /&gt;ptr = malloc (sizeof (struct)+99*sizeof(int));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;struct s{&lt;br /&gt;int i;&lt;br /&gt;float p;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;when free (ptr) is executed, then what will happen? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;30. To concatenate two linked lists strings, the order is O(1) is obtained for what kind of list?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;color:black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:black;"&gt;31&lt;/span&gt; main() &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;{ fork(); &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;fork(); &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;fork(); &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;printf("hello"); &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;span style="font-family:georgia;"&gt;} &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;span style="font-family:georgia;"&gt;How many times it will print hello?&lt;/span&gt;&lt;span style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in" align="left"&gt;&lt;span style="font-family:georgia;"&gt;32. char A[5,6] How many bytes it requires? &lt;!--[endif]--&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" align="left"&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in" align="left"&gt;&lt;span style="font-family:georgia;"&gt;&lt;!--[if !supportLists]--&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in" align="left"&gt;&lt;span style="font-family:georgia;"&gt;33. Bridges are used in which layer? &lt;!--[endif]--&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;34 .Bigendian means &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;a)lower byte stored in lower address &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;b)lower byte stored in higher address &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;one of these is correct.u can verify in Any micro processor book. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;35 main() &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;{ j=0 &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;for(i=0;i&lt;10;i++)&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;{ &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;j+=i; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;} &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;} &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;what is the value of i &amp;amp; j at the end of the loop &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;ans: 10,46 &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-183713792595267728?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/183713792595267728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=183713792595267728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/183713792595267728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/183713792595267728'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/cisco_15.html' title='Cisco'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6766385072594250682</id><published>2007-08-15T06:22:00.000-07:00</published><updated>2007-12-28T23:18:59.965-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Cisco</title><content type='html'>&lt;p style="COLOR: rgb(51,51,51);font-family:georgia;" &gt;&lt;span style="font-family:georgia;"&gt;PAPER 28 JULY&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:georgia;"&gt;&lt;strong&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:georgia;"&gt;&lt;strong&gt;                                                          Basic Digital Section&lt;/strong&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;1. In order to find out stack fault of a three input nand gate how many necessary input vectors are needed ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="font-family:georgia;"&gt;2. What is parity generation ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="font-family:georgia;"&gt;3. A nand gate becomes ___ gate when used with negative logic ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;4. What is the advantage of cmos over nmos ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;5. What is the advantage of syncronous circuits over asynchronous circuits ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;6. What is the function of ALE in 8085 ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;7. A voice signal sample is stored as one byte. Frequency range is 16 Hz to 20 Hz. What is the memorysize required to store 4 minutes voice signal?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;8. What will the controller do before interrupting CPU?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;9. In a normalised floating point representation, mantissa is represented using 24 bits and exponent with 8 bits using signed representation. What is range ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;10. The stack uses which policy out of the following-- LIFO, FIFO, Round Robin or none of these ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;11. Where will be the actual address of the subroutine is placed for vectored interrupts?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;12. Give the equivalent Gray code reprasentation of AC2H.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;13.What is the memory space required if two unsigned 8 bit numbers are multiplied ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="font-family:georgia;"&gt;14. The vector address of RST 7.5 in 8085 processor is _______.&lt;br /&gt;Ans. 003C (multiply 7.5 by 8 and convert to hex)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:georgia;"&gt;15. Subtract the following hexadecimal numbers--- 84&lt;sub&gt;16&lt;/sub&gt; - 2A&lt;sub&gt;16&lt;/sub&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;16. Add the following BCD numbers--- 1001 and 0100&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;17. How much time does a serial link of 64 Kbps take to transmit a picture with 540 pixels.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;18. Give the output when the input of a D-flip flop is tied to the output through the XOR gate.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="font-family:georgia;"&gt;19. Simplify the expression AB + A( B + C ) + B ( B + C )&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;20. Determine the logic gate to implement the foolowing terms--ABC, A+B+C&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="font-family:georgia;"&gt;21. Implement the NOR gate as an inverter.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="font-family:georgia;"&gt;22. What is the effect of temperature on the I&lt;sub&gt;cb&lt;/sub&gt; in a transistor &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;23. What is the bit storage capacity of a ROM with a 512*4 organisation?&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;24. What is the reason of the refresh operation in dynamic RAM's ?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;25. Suppose that the D input of a flip flop changes from low to high in the middle of a clock pulse.Describe what happens if the flip flop is a positive edge triggered type?&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;26. How many flip flops are required to produce a divide by 32&lt;br /&gt;device ?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;27. An active HIGH input S-R latch has a 1 on the S input and a 0 on the R input. What state is the latch in?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;28. Implement the logic equation Y = C^BA^ + CB^A + CBA with a multiplexer. (&lt;em&gt;where C^ stands for C complement&lt;/em&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;29.Equivalent Gray code reprasentation of AC2H.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;30. What does a PLL consist of ?&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6766385072594250682?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6766385072594250682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6766385072594250682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6766385072594250682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6766385072594250682'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/cisco.html' title='Cisco'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7019495328699086088</id><published>2007-08-15T06:09:00.000-07:00</published><updated>2007-12-29T00:28:13.505-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google interview questions</title><content type='html'>&lt;span style="font-family:georgia;"&gt;1)Write a command to find all of the files which have been accessed within the last 30 days. &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="color:#000099;"&gt;Ans: find / -type f -atime -30 &gt; outputfile.txt&lt;/span&gt;&lt;/p&gt;2)write an assembly code which can call function in a loop with al value from 0 to 9.&lt;br /&gt;&lt;br /&gt;3)Given one ip address, find out which contry&lt;br /&gt;&lt;br /&gt;4)what is the hexidecimal number of 4100?&lt;br /&gt;&lt;br /&gt;5)how to estimate the disk access time? e.g. the time between read one byte and another byte in the disk.&lt;br /&gt;&lt;br /&gt;6)class foo { public: static int func(const char*&amp;amp; p) const; }; This is illegal, why?&lt;br /&gt;&lt;br /&gt;7)value = 0xabcd; for (loop = 1; (value &gt;&gt; 1) &amp;amp; 1  loop &amp;amp; 1; loop++) { foo(); if (loop &amp;amp; 1) value &gt;&gt;= 1; } how many times is foo() executed?&lt;br /&gt;&lt;br /&gt;8)You have a sheet cake. There is a rectangular piece missing from the inside of the sheet cake. The location of the missing piece is arbitrary. I was told I could assume I had the means to make the cuts. How do you divide the sheet cake into 2 even proportions with 2 cuts?&lt;br /&gt;&lt;br /&gt;9)What is the difference between Set_window() and _set_window ()?&lt;br /&gt;&lt;br /&gt;10)It's 2PM on a sunny Sunday afternoon in the Bay Area. You're minutes from the Pacific Ocean, redwood forest hiking trails and world class cultural attractions. What do you do?&lt;br /&gt;&lt;br /&gt;11)In your opinion, what is the most beautiful math equation ever derived?&lt;br /&gt;&lt;br /&gt;12)What will be the next great improvement in search technology?&lt;br /&gt;&lt;br /&gt;13)What is the optimal size of a project team, above which additional members do not contribute productivity equivalent to the percentage increase in the staff size?&lt;br /&gt;&lt;br /&gt;14)Given a triangle ABC, how would you use only a compass and straight edge to find a point P such that triangles ABP, ACP and BCP have equal perimeters? (Assume that ABC is constructed so that a solution does exist.)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7019495328699086088?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7019495328699086088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7019495328699086088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7019495328699086088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7019495328699086088'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/google-interview-questions.html' title='Google interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2924578158041925077</id><published>2007-08-15T04:51:00.000-07:00</published><updated>2007-08-15T04:53:42.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe'/><title type='text'>Adobe Questions</title><content type='html'>&lt;span style="color: rgb(51, 51, 51);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="color: rgb(51, 51, 51);" class="content"&gt;&lt;p style="font-weight: bold;"&gt;ADOBE PALCEMENT PAPER ON 3rd SEPTEMBER 2006  AT MUMBAI&lt;/p&gt;&lt;p&gt; Written Test&lt;br /&gt;1) Wap to reverse a linked list and sort the same. &lt;/p&gt; &lt;p&gt;2) Given two integers A &amp; B. Determine how many bits required to convert&lt;br /&gt;A to B. Write a function int BitSwapReqd(int A, int B);&lt;/p&gt; &lt;p&gt;3) Write an algorithm to insert a node into sorted linked list. After inserting,&lt;br /&gt;the list must be sorted.&lt;br /&gt;4) Without using /,% and * operators. write a function to divide a number by 3.&lt;br /&gt;itoa() function is available. &lt;/p&gt; &lt;p&gt;5) Wap to swap two integer pointers. &lt;/p&gt; &lt;p&gt;6) Write a funcn int round (float x) to round off a floating point num to int. &lt;/p&gt; &lt;p&gt;7) write an ALP to find sum of First n natural numbers using the following Instructions&lt;/p&gt; &lt;p&gt;LDA num ; load Accumulator with num&lt;br /&gt;DCR R ; decrement Register R&lt;br /&gt;INR R ; increment Register R&lt;br /&gt;MOV x,y ; move the contents of register y into register x&lt;br /&gt;JZ label ; jump to label if A=0&lt;br /&gt;DJNZ label; Decrement &amp; Jump if A &lt;&gt; 0&lt;br /&gt;you can use B &amp;amp; C registers in addition to A register &lt;/p&gt; &lt;p&gt;8) Prove that a tree is BST. What is height of a tree? &lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2924578158041925077?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2924578158041925077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2924578158041925077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2924578158041925077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2924578158041925077'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/adobe-questions.html' title='Adobe Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-4921483026119696651</id><published>2007-08-15T04:35:00.000-07:00</published><updated>2007-08-15T04:45:15.920-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sun Microsystems'/><title type='text'>Sun Microsystems</title><content type='html'>1)How many ways can a thread be used?&lt;br /&gt;2)What is multithread synchronizing ?&lt;br /&gt;3)In which way does a Primitive data type is passed ?&lt;br /&gt;4)What happens when a main method is declared as private?&lt;br /&gt;5)Is there any need to import java.lang package?&lt;br /&gt;6)What is multithread synchronizing ?&lt;br /&gt;7)Find the error in the following program struct point  {struct point *next; int data; } x; main() {int...data; } x; main() {int i; for(x=p;x!=0;) x=x-&gt;next,x++; freelist(x); } freelist(x) {free(x); return }&lt;br /&gt;8)Which data structure gives efficient search?  A. B-tree B. binary tree C. array D. linked list&lt;br /&gt;9)Give the output of the following program main() {char *p='a'; int *i=100/*p; } what will be the value of *i= 1&lt;br /&gt;10)Give the output of the following program main() {int ret; ret=fork();ret=fork();ret=fork();ret=fork(); if(!ret) printf("sun"); else printf("solaris");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-4921483026119696651?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/4921483026119696651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=4921483026119696651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4921483026119696651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4921483026119696651'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/sun-microsystems_15.html' title='Sun Microsystems'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6230323752080825497</id><published>2007-08-07T08:18:00.000-07:00</published><updated>2007-08-07T08:29:20.595-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sun Microsystems'/><title type='text'>Sun Microsystems</title><content type='html'>&lt;div  style="color: rgb(51, 51, 51);font-family:georgia;" class="PageTitle"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;SUN MICROSYSTEMS PAPER - DEC 2005&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;60 questions 60 marks&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Everything is &lt;a style="cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" name="AdBriteInlineAd_multiple" id="AdBriteInlineAd_multiple"&gt;&lt;span style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll center bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px;"&gt;multiple&lt;/span&gt;&lt;/a&gt;. &lt;strong&gt;BEWARE OF NEGATIVE MARKING&lt;/strong&gt; .&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Section 1 : Operating &lt;a style="cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" name="AdBriteInlineAd_systems" id="AdBriteInlineAd_systems"&gt;&lt;span style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll center bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px;"&gt;systems&lt;/span&gt;&lt;/a&gt;&lt;span&gt;                 &lt;/span&gt;20 questions&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Section 2 : Technical &lt;a style="cursor: pointer; color: rgb(0, 102, 0); text-decoration: none;" name="AdBriteInlineAd_programming" id="AdBriteInlineAd_programming"&gt;&lt;span style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll center bottom; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px;"&gt;programming&lt;/span&gt;&lt;/a&gt; &lt;span&gt;          &lt;/span&gt;25 questions&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div  style="border-style: none none solid; border-color: -moz-use-text-color; border-width: medium medium 1.5pt; padding: 0in 0in 1pt; color: rgb(51, 51, 51);font-family:georgia;"&gt; &lt;div class="MsoNormal" style="border: medium none ; margin: 0in 0in 0pt; padding: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Section 3 : Aptitude&lt;span&gt;                                 &lt;/span&gt;15 Questions&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Section 1 :&lt;span&gt;            &lt;/span&gt;Operating Systems&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Study all the unix commands &amp; some basic networking concepts like DHCP, Dynamic NAT, RARP, ARP, UDP, DNS. Unix : Grep, sed, basic perl program whose o/p is to be predicted. Pipes. You can expect some nasty &amp;amp; tricky questions !. But this section is kool not to worry too much.&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div  style="border-style: none none solid; border-color: -moz-use-text-color; border-width: medium medium 1.5pt; padding: 0in 0in 1pt; color: rgb(51, 51, 51);font-family:georgia;"&gt; &lt;div class="MsoNormal" style="border: medium none ; margin: 0in 0in 0pt; padding: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Section 2 :&lt;span&gt;            &lt;/span&gt;Programming part&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;C programs &amp; Java programs. The programs seems to be easy but bcoz of the Negative marking (0.5) we have to be very clear. No bluffing ok! The programs are easy. Programs were on Fork, PID, Basic C syntax, Basics of Java, Exception handling, Inheritance, Strings, Cast conversion, Object linking etc&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div  style="border-style: none none solid; border-color: -moz-use-text-color; border-width: medium medium 1.5pt; padding: 0in 0in 1pt; color: rgb(51, 51, 51);font-family:georgia;"&gt; &lt;div class="MsoNormal" style="border: medium none ; margin: 0in 0in 0pt; padding: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Section 3 :&lt;span&gt;            &lt;/span&gt;Aptitude&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Most of the questions can be found from other placement papers like Sonata, TCS, Caritor. Nothing to worry much. But again you have to be very confident about the answers.&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div  style="border-style: none none solid; border-color: -moz-use-text-color; border-width: medium medium 1.5pt; padding: 0in 0in 1pt; color: rgb(51, 51, 51);font-family:georgia;"&gt; &lt;div class="MsoNormal" style="border: medium none ; margin: 0in 0in 0pt; padding: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;The cut-off marks are not told &amp; will be decided by the evaluators at that time. Only 3 out of some 50 candidates got through. The next rounds are technical interview followed by HR interview. &lt;strong&gt;This&lt;/strong&gt; &lt;strong&gt;interview call was purely on referral basics.&lt;/strong&gt; So not much competitors &amp;amp; really a good chance of getting thru !. Do well &amp; good luck !&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt; &lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Questions:&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# main()&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;{&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;int _=10;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;printf("%d",_);&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;}&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;#&lt;span&gt;  &lt;/span&gt;If you have developed an microprocessor by name JUGGI, how would you account for the JVM ?&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;a)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;Write/ Develop a new JVM by going through the SUN standards&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;b)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;Implement the same JVM that's in windows , linux as JVM is platform independent.&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;c)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;Leave it to the SUN to write it for you&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;d)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;Need not write anything&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;#&lt;span&gt;  &lt;/span&gt;Which server would you use to configure or set up a new IP address in Linux&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;a) DNS&lt;span&gt;    &lt;/span&gt;b) DHCP&lt;span&gt;  &lt;/span&gt;c) TCP&lt;span&gt;    &lt;/span&gt;d) blah blah blah .....&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;#&lt;span&gt;  &lt;/span&gt;Three friends divided some bullets equally. After all of them&lt;br /&gt;shot 4 bullets the total no.of remaining bullets is equal to that of&lt;br /&gt;one has after division. Find the original number divided.&lt;span&gt;  &lt;/span&gt;[Infosys paper &amp; IBM]&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;a)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;20&lt;span&gt;     &lt;/span&gt;b) 22&lt;span&gt;      &lt;/span&gt;c) &lt;b&gt;18&lt;/b&gt;&lt;span&gt;      &lt;/span&gt;d) 19&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;#&lt;span&gt;  &lt;/span&gt;A cube object 3" * 3" * 3" is painted with green in all the outer surfaces. If the cube is cut into cubes of 1"*1"*1", how many 1" cubes will have at least one surface painted. [Caritor]&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;a) 8    b) &lt;b&gt;26&lt;/b&gt;   c) 27     d) None of the above&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;#  What is the protocol used for getting the physical address by supplying&lt;br /&gt;IP address of a node ?           [Wipro]&lt;br /&gt;[i] &lt;b&gt;ARP&lt;/b&gt;    [ii] RARP   [iii] BOOTP    [iv] DHCP &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;#  How can a process be started automatically in UNIX ?   [MBT]&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;a)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;b&gt;CRONTAB&lt;/b&gt;      b) INITTAB       c) CONTROL        d) FORK&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;#  Flow chart problem      [Satyam]&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;let the value of N be 10&lt;br /&gt;divide N by 10 to give quotient (Q) remainder(R)&lt;br /&gt;diff=R-Q&lt;br /&gt;if diff=1 then 6&lt;br /&gt;go to step 7&lt;br /&gt;display the value of N&lt;br /&gt;add 1 to N&lt;br /&gt;if N &lt;100&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;a)  11,12,13,,14..    b)12,23,34,.....    c)&lt;b&gt;21,32,4,354......&lt;/b&gt;     d) none&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;#   What is the output of the Program?    [Sasken]&lt;br /&gt;#define SQ(x) x*x&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a=SQ(2+1);&lt;br /&gt;printf("%d",a);&lt;br /&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; a)   5        b) &lt;b&gt;6&lt;/b&gt;          c) 7         d) None of the Given Answers&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="questiontext"  style="margin: auto 0in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# There N stations on a railroad. After adding X stations on the rail route 46 additional tickets have to be printed. Find N and X. [Sify]&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;  a) &lt;b&gt;x=2 and N=11&lt;/b&gt;      b) x=2 and N=12     c) x=2 and N=13         d) x=3 and N=11&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# How is an Non-maskable interrupt handled &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;a)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;The current program is executed &amp; then handles the NMI&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;b)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;Handles the NMI first &amp; then continues with the execution&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;c)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;Handles the interrupt based on the priority&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;d)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;Ignores the interrupt &amp; continues with the program.&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# Problems like &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;If QWERT means 2513678397849 what does [some word] equal to ? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# Simple program on fork system call&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# Simple problems on inheritance [Java]&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# Simple string assignment problems&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# If 8 butts of cigarette make 1 cigarette then how many will 64 butts make ?&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Ans : 8&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;# ICMP is used where &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;a)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;ICMP supports  packets containing error, control, and informational messages.&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="MsoNormal"  style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;b)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;span&gt;The Ping / Command execution.&lt;/span&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="font-size:100%;"&gt;&lt;b  style="color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;c)&lt;span style="font-weight: normal; line-height: normal; font-style: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;span&gt;a&amp;b both&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PAPER 2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;&lt;span&gt;&lt;a target="_blank" ddress=""&gt;&lt;span style="font-family:Georgia;"&gt;&lt;span style="font-style: normal;"&gt;1. For the following program.&lt;br /&gt;&lt;br /&gt;struct XXX&lt;br /&gt;{int a;&lt;br /&gt;float b;&lt;br /&gt;char *s;&lt;br /&gt;}X;&lt;br /&gt;&lt;br /&gt;If optimization :X not used in compiler then unused&lt;br /&gt;bits_________________.&lt;br /&gt;Give your assumption_______________.&lt;br /&gt;&lt;br /&gt;2. Give the output of the following program&lt;br /&gt;&lt;br /&gt;struct XXX&lt;br /&gt;{int a:6;&lt;br /&gt;float b:4;&lt;br /&gt;char s;&lt;br /&gt;}structure;&lt;br /&gt;&lt;br /&gt;size of (structure);&lt;br /&gt;&lt;br /&gt;3. Class used for the multiple inheritence in JAVA_________________&lt;br /&gt;&lt;br /&gt;(a) anonymous class&lt;br /&gt;(b) inner class&lt;br /&gt;(c) abstract class&lt;br /&gt;(d) none&lt;br /&gt;&lt;br /&gt;4. XDR fixes in which part of OS1 stack.&lt;br /&gt;&lt;br /&gt;5. LDAP is____________service protocol.&lt;br /&gt;&lt;br /&gt;6. Given definition for a function which returns a array of pointers&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;with argument of int*.&lt;br /&gt;&lt;br /&gt;7. Give a function declaration with no arguments which refers a two&lt;br /&gt;dimensional array&lt;br /&gt;&lt;br /&gt;8. Pick up the correct function declaration.&lt;br /&gt;&lt;br /&gt;1. void *[] name();&lt;br /&gt;2. void int[][] name();&lt;br /&gt;3. void ** name();&lt;br /&gt;4. none of the above.&lt;br /&gt;&lt;br /&gt;9. Give the difference between monolithic and microlithic kernal:&lt;br /&gt;&lt;br /&gt;a. monolithic large&lt;br /&gt;b. microlithic used in embedded systems.&lt;br /&gt;c. none.&lt;br /&gt;&lt;br /&gt;10. rPC coresponds to_______________in OSI stack.&lt;br /&gt;&lt;br /&gt;11. Find the no.of page faults using LRU stack.&lt;br /&gt;&lt;br /&gt;eg.3 4 4 6 7 8 1 2 .. ..&lt;br /&gt;&lt;br /&gt;12. The inorder representation of a tree 41523 and preorder is 24513&lt;br /&gt;Draw it?&lt;br /&gt;&lt;br /&gt;13. When does a stack member will be initialised&lt;br /&gt;&lt;br /&gt;(a) when object is created&lt;br /&gt;(b) when object is initialised.&lt;br /&gt;(c) doesnot depend on object.&lt;br /&gt;(d) none.&lt;br /&gt;&lt;br /&gt;14. Number of CPU in a multiprocess is contrassed by&lt;br /&gt;&lt;br /&gt;(a) RISC nohere of CPU&lt;br /&gt;(b) memory&lt;br /&gt;(c) both (a) and (b)&lt;br /&gt;(d) None of the above&lt;br /&gt;&lt;br /&gt;15. Give the output of the following program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{char *s;&lt;br /&gt;s="hot java";&lt;br /&gt;strcpy(s,"solarrs java")&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;16. Give the output of the following program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{printf("hot java");&lt;br /&gt;fork()&lt;br /&gt;exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(i). When redirected to a screen what will be printed.&lt;br /&gt;(ii). When redirected to file what will be printed.&lt;br /&gt;&lt;br /&gt;17. Give the output of the following program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{int ret;&lt;br /&gt;ret=fork();ret=fork();ret=fork();ret=fork();&lt;br /&gt;if(!ret)&lt;br /&gt;printf("sun");&lt;br /&gt;else&lt;br /&gt;printf("solaris");&lt;br /&gt;&lt;br /&gt;18. Give the output of the following program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{char *p='a';&lt;br /&gt;int *i=100/*p;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;what will be the value of *i= 1&lt;br /&gt;&lt;br /&gt;19. Which data structure gives efficient search&lt;br /&gt;&lt;br /&gt;1 B-tree&lt;br /&gt;2 binary tree&lt;br /&gt;3 array&lt;br /&gt;4 linked list&lt;br /&gt;&lt;br /&gt;20. Find the error in the following program&lt;br /&gt;&lt;br /&gt;struct point&lt;br /&gt;{struct point *next;&lt;br /&gt;int data;&lt;br /&gt;}&lt;br /&gt;x;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{int i;&lt;br /&gt;for(x=p;x!=0;)&lt;br /&gt;x=x-&gt;next,x++;&lt;br /&gt;freelist(x);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;freelist(x)&lt;br /&gt;{free(x);&lt;br /&gt;return&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;21. Mutex and _________are similar locking mechanisms.&lt;br /&gt;&lt;br /&gt;22. A complex question on pointers and functions.&lt;br /&gt;&lt;br /&gt;23. SNMP and SMIP transport layer protocols for TCP/IP&amp;amp;OSI.&lt;br /&gt;&lt;br /&gt;24 UNIX: difference between select and poll&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6230323752080825497?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6230323752080825497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6230323752080825497' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6230323752080825497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6230323752080825497'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/sun-microsystems.html' title='Sun Microsystems'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5388412911108336372</id><published>2007-08-06T19:39:00.000-07:00</published><updated>2007-08-06T19:40:31.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>Yahoo Questions</title><content type='html'>&lt;span style="color: rgb(51, 51, 51);"&gt;1. In a village in each family they give birth to children till they&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;get a boy. IF girl child they try again. What is the ratio of boys to&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;girls.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;2. 2n+1 numbers in a list except for 1 num all had duplicates, how to&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;find duplicate in O(n)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;3. In 1000 wine bottles stack 10 are poisoned given 10 rats what is&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;the minimum number of tries to find the poisoned one. Rat dies once it&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;licks the poisoned wine.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;4. Write 1,3,6,4 using +,-,*,/ to get 24 (no repeat of numbers)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;5. Which is the DS used in dictionary mode in mobile (t9)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;6. Which is DS used for chess program...to predict move each and every&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;time..&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;7. There are $1070 dollars how to split them into bags such that asked&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;for any denomination from $1 to $1070 , u must b able to give without&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;opening bag...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;"&gt;Another paper:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;1. First fit issues...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;2. Algorithm to partition set of numbers into two s.t. diff bw their&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;sum is min and they hav equal num of elements&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;3. Prog: given Numerator &amp; Denominator.... print 0.3333333333 as .(3)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;0.123123 as .(123) &lt;/span&gt;                  &lt;div class="post-footer"&gt;     &lt;p class="post-footer-line post-footer-line-1"&gt;&lt;span class="post-icons"&gt;                                                &lt;/span&gt; &lt;/p&gt;                     &lt;/div&gt;                       &lt;div class="comments" id="comments"&gt;     &lt;a name="comments"&gt;&lt;/a&gt;           &lt;div id="backlinks-container"&gt;     &lt;div id="Blog1_backlinks-container"&gt;             &lt;/div&gt;     &lt;/div&gt;   &lt;/div&gt;                                                   &lt;div class="post-feeds"&gt;                            &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5388412911108336372?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5388412911108336372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5388412911108336372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5388412911108336372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5388412911108336372'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/yahoo-questions.html' title='Yahoo Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7703887636762535127</id><published>2007-08-06T19:34:00.000-07:00</published><updated>2007-08-06T19:35:39.930-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sasken'/><title type='text'>Sasken</title><content type='html'>&lt;p style="color: rgb(51, 51, 51); font-family: georgia;" align="left"&gt;&lt;span style="font-size: 100%;"&gt;Off Campus Written Test conducted  at                     Bangalore&lt;br /&gt;                 The test comprises of 2 sections:&lt;br /&gt;                 1. Technical ( C ) &amp; Technical Subject- 60 mins, 60 questions                 &lt;br /&gt;                 2. Logical Reasoning.. - 30 mins,17 questions....&lt;br /&gt;              &lt;br /&gt;==&gt; Questions in C were mostly from "pointers in c" and "test ur C skills" by Yeshwant Kanetkar... C questions based on command line arguments, data structure ( BST, tree traversals). All the questions were like " what is the output of the following program segment" and in many questions 3rd and 4th choices were (c) compilation error and (d) compilation, warning, runtime error.... Heard they are asking abt- ptr, string, arr, preprocessor, data structures etc.. C test was pretty ok pass by value, pass by reference etc. questions were asked The general test was pretty tough, they ask u fourier transforms,harmonics,Barkhuasen criterion,virtual memory,Whether FIFO is better than LRU etc. 4 questions were from fourier transforms the duration was 60 mins and no negative marking&lt;br /&gt;              &lt;br /&gt;C basics 10 questions ,very easy.Given a program and asked the output-type questons.from pointers 3-4 questions are there. 2)reg subject:very very easy:some from digital(on nand gates. Jk flip flop),from Information theory and coding,some from Micro processors.&lt;br /&gt;              &lt;br /&gt;In Logical Reasoning all the 17 questions were paragraphs (argument) of 5 to 6 sentences...five sentences (choices) will be given below and questions were asked like " which of the five if true will weaken or supports the argument above .." :- R. S. Agrawal LR is sufficient&lt;br /&gt;              &lt;br /&gt;                 SASKEN PAPER HELD ON 9th AUG at 2:30pm&lt;br /&gt;                 --------------------------------------------------------------&lt;br /&gt;              &lt;br /&gt;                 The questions were like this.&lt;br /&gt;                 ------------------------------&lt;br /&gt;                 The text consists of two parts&lt;br /&gt;                 1) C test&lt;br /&gt;                 2) CSE01 Test&lt;br /&gt;                 Duration: 1hr&lt;br /&gt;                 ---------------------------------------------------------------                 &lt;br /&gt;                 1) C test -10 questions- Some questions were as follows,                     remember only a few.&lt;br /&gt;                 a) What is the parameter passing mechanism to Macros Called?&lt;br /&gt;                 b) void func(int x,int y)&lt;br /&gt;                 {&lt;br /&gt;                 x=3;&lt;br /&gt;                 y=2;&lt;br /&gt;                 }&lt;br /&gt;                 main()&lt;br /&gt;                 {&lt;br /&gt;                 int i;&lt;br /&gt;                 func(i,i);&lt;br /&gt;                 print(i);&lt;br /&gt;                 }&lt;br /&gt;                 If the output must be 2 what is the parameter passing                     mechanism called?&lt;br /&gt;                 c) which of the following code will swap the two numbers? -3                     choices was given&lt;br /&gt;                 d) which of the following is illegal for the program?&lt;br /&gt;                 main()&lt;br /&gt;                 {&lt;br /&gt;                 char const *p='p';&lt;br /&gt;                 }&lt;br /&gt;                 1)p++ 2) *p++ 3)(*p)++ 4) all&lt;br /&gt;                 e) what is the output of the following program&lt;br /&gt;                 void print(int ** arr)&lt;br /&gt;                 {&lt;br /&gt;                 print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);&lt;br /&gt;                 }&lt;br /&gt;                 main()&lt;br /&gt;                 {&lt;br /&gt;                 int a[][]={ {1,2,3},&lt;br /&gt;                 {4,5,6}&lt;br /&gt;                 }&lt;br /&gt;                 int ** arr=a;&lt;br /&gt;                 print(arr);&lt;br /&gt;                 arr++;&lt;br /&gt;                 print(arr);&lt;br /&gt;                 }&lt;br /&gt;                 f) which of the following code swaps the two numbers.&lt;br /&gt;                 - 4 choices were given&lt;br /&gt;g) if the string " this is a " is present in the code of a function such as 'void func(void)' where&lt;br /&gt;                 will the variable stored in the memory.&lt;br /&gt;a) in the stack b) heap c) code or text segment as per implementation d) created when func is called, stored in function stack space and destroyed as it goes out .&lt;br /&gt;              &lt;br /&gt;                 2) CSE01-15 questions&lt;br /&gt;In this section there was question from LD-gates, JK flip flop, sampling rate and few other&lt;br /&gt;                 then there was a few from OS - don't remember the questions.&lt;br /&gt;              &lt;br /&gt;              &lt;br /&gt;                 INTERVIEW&lt;br /&gt;              &lt;br /&gt;                 In the interview, they asked about Stacks, Queues, Linked                     lists, Binary Trees.&lt;br /&gt;              &lt;br /&gt;                 Few questions I remember are:&lt;br /&gt;1) If u have a linked list library, how do u design stack and queue using it; write pseudocode.&lt;br /&gt;                 2) What are static variables and functions?&lt;br /&gt;                 3) Write code in C to count the number of 1s in a character                     (1byte).&lt;br /&gt;                 4) What is pre-order, post-order, in-order; write code to                     print post-order.&lt;br /&gt;5) Can u construct a binary tree given its inorder and postorder details. Is it neccessary or sufficient to construct tree. Asked an example to do in both ways.&lt;br /&gt;                 6) If recursion is not used to print post order, what other                     data structure u use&lt;br /&gt;                 (ans: Stack).&lt;br /&gt;                 7)Can u use stack always in place of recursion?&lt;br /&gt;                 (ans: Yes)&lt;br /&gt;                 8) What are meta characters?&lt;br /&gt;                 9) Write a piece of code to insert a node in a linked list.&lt;br /&gt;                 10) About malloc.&lt;br /&gt;                 11) About Operating System - Semaphores&lt;br /&gt;                 12) About Computability (eg:- finding infinite loop),                     Complexity of algorithms&lt;br /&gt;                 13) What does compiler and assembler do?&lt;br /&gt;              &lt;br /&gt;                 They asked grep command in Linux. How do u search '\n', using                     grep, in a file.&lt;br /&gt;                 They may ask some other commands if u say u r familiar and                     recently been using linux.&lt;br /&gt;                 About Networks? OSI reference model.&lt;br /&gt;                 what does transport layer do?&lt;br /&gt;                 TCP belongs to which layer?&lt;br /&gt;                 IP belongs to which layer?&lt;br /&gt;                 Where is error correction done?&lt;br /&gt;                 What is a connection oriented/ connection less transmission?&lt;br /&gt;                 What is meant by reliable transmission protocol? why is it                     called so?&lt;br /&gt;                 What is flow control and where it is done?&lt;br /&gt;                 About ur project?&lt;br /&gt;                 Asked me expalin about the project in brief.&lt;br /&gt;If u don't know anything, say it sincerely. U cannot bluff them. I too spoke to them sincerely.&lt;br /&gt;They were cool. U need not get tensed. They won't attack you. Just they want to know ur hold about the subject.&lt;/span&gt;&lt;/p&gt;                                        &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;Next Paper&lt;br /&gt;NOTE :  Answer May Not be Accurate So                     Get An Idea of Questions.&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;   What is the value of X after this                     execution&lt;br /&gt;  x = 0;&lt;br /&gt;begin&lt;br /&gt;parbegin&lt;br /&gt;   y = x;&lt;br /&gt;x = x+1;&lt;br /&gt;parend&lt;br /&gt;parbegin &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;z =x;&lt;br /&gt;x = z+1;&lt;br /&gt;parend&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;end&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in; color: rgb(51, 51, 51); font-family: georgia;"&gt;                     &lt;span style="font-size: 100%;"&gt;a:1&lt;br /&gt;b:0&lt;br /&gt;c:2&lt;br /&gt;d:1 or 2   &lt;o:p&gt;                    &lt;/o:p&gt;                    &lt;/span&gt;                    &lt;/p&gt;                                                                                                                        &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;2. Comparision of LRU and FIFO&lt;br /&gt;a. FIFO IS always better &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;b. FIFO is always worst&lt;br /&gt;c. FIFO is sometimes better&lt;br /&gt;d. NOthing can be said.&lt;br /&gt;ANS :D &lt;o:p&gt;                     &lt;/o:p&gt;                    &lt;/span&gt;                    &lt;/p&gt;                                                            &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; 3.  How many minimum no of NAND GATES                     ARE required for construction of X-OR gate&lt;br /&gt; 6  7  5   8 &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;ANS :  5 (but the correct answer is 4 )                     if 4 is present that is correct answer otherwise 5 &lt;o:p&gt;                    &lt;/o:p&gt;                    &lt;/span&gt;                    &lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;4. If each counter has time delay of 15 n sec. Then what is the max time to change the state of 4 bit&lt;br /&gt;    synchronus counter&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;a. 60&lt;br /&gt;b.15&lt;br /&gt;c. 120&lt;br /&gt;d. none&lt;br /&gt;ans :  15&lt;/span&gt;&lt;/p&gt;                                                                                &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;5. There is ADC of freequency 1 MHz. How much time it will take to convert a message stream of 6 bit&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;ans : 6 Micro Sec&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;6.  What is Baukshna's criteria for                     sustaining freequency.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;some fk is given that( Iam not clear)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;fk &gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;fk &lt;1 fk ="0"&gt;&lt;br /&gt;none&lt;/span&gt;&lt;/p&gt;                                                            &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; 7.  which of the following is wrong:&lt;br /&gt;   ans :  WCW is a context free                     language.where w is word formed by sequence of alphabets. &lt;o:p&gt;                    &lt;/o:p&gt;                    &lt;/span&gt;                    &lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; 8.  find odd man out&lt;br /&gt;  LISP -Functional language&lt;br /&gt;  PROLOG - logic programming&lt;br /&gt;  C -  imperative&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;ans : c- imperative.  Iam not sure ask                     ur brother.&lt;br /&gt;Fourier analysis 4 questions.&lt;/span&gt;&lt;/p&gt;                    &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; &lt;o:p&gt;                     &lt;/o:p&gt;                    &lt;/span&gt;                    &lt;/p&gt;                    &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;            C&lt;/span&gt;&lt;/p&gt;                    &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;===============================&lt;/span&gt;&lt;/p&gt;                                                                                                                        &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;How macros are called&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;a. Call by name&lt;br /&gt;b. Call by refernce&lt;br /&gt;c. Call by value&lt;br /&gt;ans : call by name.&lt;/span&gt;&lt;/p&gt;                    &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; &lt;o:p&gt;                     &lt;/o:p&gt;                    &lt;/span&gt;                    &lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;2. fun( int x, int y){&lt;br /&gt;  x =3;&lt;br /&gt; y =2; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;}&lt;br /&gt;main(){&lt;br /&gt;int i; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt; fun( i,i);&lt;br /&gt; printf("%d",i);&lt;br /&gt;}  &lt;o:p&gt;                     &lt;/o:p&gt;                    &lt;/span&gt;                    &lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;if the value is 2 then the calling                     mechanism &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;a. Call by name&lt;br /&gt;b. Call by refernce&lt;br /&gt;c. Call by value&lt;br /&gt;ans : call by reference&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt;3. fun(int i){&lt;br /&gt;static int j =0; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;x = x+j;  j++&lt;br /&gt; return ;&lt;br /&gt;}&lt;br /&gt;main(){&lt;br /&gt;int x = 2;&lt;br /&gt;I had not remembered the question exactly. but the essence is J will retain the value between successive function calls.&lt;/span&gt;&lt;/p&gt;                                                                                &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; 4.&lt;br /&gt;cout &lt;&lt;&gt;&lt;br /&gt;Syntax error.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;                                                                                &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;&lt;span style="font-size: 100%;"&gt; 5.&lt;br /&gt;main(){&lt;br /&gt; int z=10,x=6,y=7;&lt;br /&gt;   ( z ? x:y) =8;&lt;br /&gt;}&lt;br /&gt;ans : the statement does nothing. all                     values are same.&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; 6. "This is a sting.."&lt;br /&gt;      It is string in a function.                     Where it will be stored.&lt;br /&gt;a. stack &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;b.global heap&lt;br /&gt;c. Data ro text segment.&lt;br /&gt;d. none&lt;br /&gt;c. Data or Text segment&lt;/span&gt;&lt;/p&gt;                                        &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; 7. One question i doent remember that                     Double pointer is given&lt;br /&gt;for that my answer is : Segmentation                     error &lt;o:p&gt; &lt;/o:p&gt;                    &lt;/span&gt;                    &lt;/p&gt;                                                                                                                        &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;8.fun( int x, int y){&lt;br /&gt;int temp;&lt;br /&gt;temp =x;&lt;br /&gt;x =y;&lt;br /&gt;y = temp;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;                                                                                                                        &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; main(){&lt;br /&gt; int i =3,j =4;&lt;br /&gt; fun(i,j);&lt;br /&gt; printf("%d,%d",i,j);&lt;br /&gt;}&lt;br /&gt;ans :  3 4 (that means the values                     doesnot change)&lt;/span&gt;&lt;/p&gt;                                        &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; }&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;                    &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; ) C test -10 questions- Some questions                     were as follows&lt;/span&gt;&lt;/p&gt;                    &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;I remember only a few.&lt;/span&gt;&lt;/p&gt;                    &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;a) What is the parameter passing                     mechanism to Macros Called?&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;b)     void func(int x,int y)&lt;br /&gt;  {&lt;br /&gt;x=3;&lt;br /&gt;y=2;&lt;br /&gt;   }&lt;br /&gt;  main()&lt;br /&gt;  {&lt;br /&gt;int i;&lt;br /&gt;func(i,i);&lt;br /&gt;print(i);&lt;br /&gt;  }&lt;/span&gt;&lt;/p&gt;                    &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt; If the output must be 2 what is the                     parameter passing mechanism called?&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;c) which of the following code will swap                     the two numbers? -3 choices was given&lt;br /&gt;d) which of the following is illegal for                     the program?&lt;br /&gt; main()&lt;br /&gt; {&lt;br /&gt;   char const *p='p';&lt;br /&gt; }&lt;br /&gt;1)p++ 2) *p++ 3)(*p)++ 4) all&lt;br /&gt;e) what is the output of the following                     program&lt;br /&gt;void print(int ** arr)&lt;br /&gt;{&lt;br /&gt;  print("0 %f, 1 %f, 2 %f                     ",arr[0][0],arr[0][1],arr[0][2]);&lt;br /&gt; }&lt;br /&gt; main()&lt;br /&gt; {&lt;br /&gt;    int a[][]={ {1,2,3},&lt;br /&gt;    {4,5,6}&lt;br /&gt;   }&lt;br /&gt;   int ** arr=a;&lt;br /&gt;   print(arr);&lt;br /&gt;   arr++;&lt;br /&gt;   print(arr);&lt;br /&gt; }&lt;/span&gt;&lt;/p&gt;                                        &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;f) which of the following code swapps                     the two,numbers.&lt;br /&gt;  - 4 choices were given&lt;/span&gt;&lt;/p&gt;                                                                                &lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;                    &lt;span style="font-size: 100%;"&gt;g) if the string " this is a " is present in the code of a function such as 'void func(void)' where&lt;br /&gt;  will the variable stored in the                     memory.&lt;br /&gt;a) in the stack b) heap c) code or                     text segment as per implementation  d) created when&lt;br /&gt;  func is called, stored in function                     stack  space and destroyed as it goes out .&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 51); font-family: georgia;" class="MsoNormal"&gt;&lt;span style="font-weight: bold;"&gt;PAPER 2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p face="georgia" style="color: rgb(51, 51, 51);" class="MsoNormal"&gt;&lt;span style="font-style: normal;"&gt;&lt;span style=""&gt;1.&lt;br /&gt;What is the output of the Program?&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a[10]={1,2,3,4,5,6,7,8,9,10};&lt;br /&gt;int *p=a;&lt;br /&gt;int *q=&amp;a[9];&lt;br /&gt;printf("%d",q-p+1);&lt;br /&gt;}&lt;br /&gt;Ans: 10&lt;br /&gt;2.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=6;&lt;br /&gt;int *p=&amp;i;&lt;br /&gt;free(p);&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Options:&lt;br /&gt;a. No Error.&lt;br /&gt;b. Free can't be used for p,&lt;br /&gt;c. Compiler Error.&lt;br /&gt;d. In printf we should use *p instead of i.&lt;br /&gt;&lt;br /&gt;Ans: A&lt;br /&gt;3.&lt;br /&gt;What is the output of the Program?&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=5;&lt;br /&gt;i=!i&gt;3;&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Ans: 0&lt;br /&gt;&lt;br /&gt;4.&lt;br /&gt;What is the output of the Program?&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a[10];&lt;br /&gt;3[a]=10;&lt;br /&gt;printf("%d",*(a+3));&lt;br /&gt;}&lt;br /&gt;Ans: 10&lt;br /&gt;5.&lt;br /&gt;int (*p[10]) ();&lt;br /&gt;&lt;br /&gt;In above declaration what type of variable is P?&lt;br /&gt;Ans: P is array of pointers that each points to&lt;br /&gt;a function that takes no arguments and returns&lt;br /&gt;an int.&lt;br /&gt;6.&lt;br /&gt;What is the output of the Program?&lt;br /&gt;struct emp&lt;br /&gt;{&lt;br /&gt;int a=25;&lt;br /&gt;char b[20]="tgk";&lt;br /&gt;};&lt;br /&gt;main&lt;br /&gt;{&lt;br /&gt;emp e;&lt;br /&gt;e.a=2;&lt;br /&gt;strcpy(e.b,"tellapalli");&lt;br /&gt;printf("%d %s",e.a,e.b);&lt;br /&gt;}&lt;br /&gt;Ans: Compile Error.&lt;br /&gt;7.&lt;br /&gt;What is the output of the Program?&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a=5;&lt;br /&gt;const int *p=&amp;a;&lt;br /&gt;*p=200;&lt;br /&gt;printf("%d",*p);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans: Compile Error.&lt;br /&gt;8.&lt;br /&gt;What is the output of the Program?&lt;br /&gt;#define SQ(x) x*x&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a=SQ(2+1);&lt;br /&gt;printf("%d",a);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans: 5.&lt;br /&gt;9.&lt;br /&gt;What is the output of the Program?&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct t&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;} a,*p=&amp;a;&lt;br /&gt;p-&gt;i=10;&lt;br /&gt;printf("%d",(*p).i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ans: 10&lt;br /&gt;10.&lt;br /&gt;This program will be Compiled? [Yes/No]&lt;br /&gt;zzz.c file&lt;br /&gt;----------&lt;br /&gt;/* This is zzz.c file*/&lt;br /&gt;/*printf("tellapalli");*/&lt;br /&gt;abc.c file&lt;br /&gt;----------&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;#include"zzz.c"&lt;br /&gt;printf("Tellapalli");&lt;br /&gt;}&lt;br /&gt;Ans: Yes&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CSEA01 Test&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;I haven't remembered the Qs.I has forgotten Qs.&lt;br /&gt;They has given 5Q in OS,3Q in DM,2Q in ATFL,1Q in DLD,&lt;br /&gt;1Q in CO,1Q in MP 1Q in DS,1Q in CN.&lt;br /&gt;&lt;br /&gt;While(Fresher)&lt;br /&gt;printf("ALL THE BEST");&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="font-family: georgia; color: rgb(51, 51, 51);" class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-family: georgia; color: rgb(51, 51, 51);" class="MsoNormal"&gt;&lt;br /&gt;&lt;span style="font-style: normal;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;a style="color: rgb(51, 51, 51); font-family: georgia;" target="_blank" ddress=""&gt;&lt;span style="font-style: normal;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 51); font-family: georgia;"&gt;SASKEN paper  on 20th september(shreds,kochi)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;C questions &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;1.Consider the following declaration:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;char const *p = 'd'; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;Which of the following is not a permissible operation &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(a) *p++ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(b) ++p &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(c) (*p)++ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(d) All &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;  2.What is the output of the following code:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;void print_arr(float **p) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;printf(" 0 %f 1 %f 2 %f\n",p[0][0],p[0][1],p[0][2]); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;void main() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;float arr[2][3] = {{0,1,2},{3,4,5}}; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;float **fl_arr; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;fl_arr = (float *)arr; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;print_arr(fl_arr); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;fl_arr++; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;print_arr(fl_arr); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(a) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(d)segmentation fault &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;  3.What is the output of the following code:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;#define putchar (c) printf("%c",c) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;void main() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;char s='c'; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;putchar (s); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(a) c &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(b) 99 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(c) Compilation error &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(d) Execution error &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;  4.What is the output of the following code:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;void main() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;printf("%d",printf("ABC\\")); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(a) ABC\\ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(b) 1 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(c) ABC\4 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(d) ABC\3 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;  5.What is the output of the following code:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;int compute(int n) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;if(n&gt;0) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;n=compute(n-3)+compute(n-1); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;return(n); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;return(1); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;void main() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;printf("%d",compute(5)); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(a) 6 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(b) 9 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(c) 12 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;(d) 13 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;  6.What is the output of the following code:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;void main() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;int i; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-family: georgia;"&gt;for(i=0;i&lt;3;i++)&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;int i=100; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;i--; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;printf("%d..",i); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a0..1..2.. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)99..98..97.. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)100..100..100.. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)99..99..99.. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  7.What is the output of the following code:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;void main() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;int a[]={9,4,1,7,5}; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;int *p; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;p=&amp;a[3]; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;printf("%d",p[-1]); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)6 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)1 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)7 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)Error&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;8.What is the output of the following code:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;void main() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;int a[]={10,20,30,40,50}; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;int *p; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;p= (int*)((char *)a + sizeof(int)); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;printf("%d",*p); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)10 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)20 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)30 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)40 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  9.Which code will run faster &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;for(i=0;i&lt;100;i++)&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;for(j=0;j&lt;10;j++)&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;a[i][j]=0; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;OR &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;for(j=0;j&lt;10;j++)&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;for(i=0;i&lt;100;i++)&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;a[i][j]=0; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)First code &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)Second code &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)Same &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)Compiler and hardware dependent &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Answers(Only those which are sure) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  1.(c) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;3.(c) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;4.(c) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;5.(b) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;6.(d) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;7.(b) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;8.(b) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Aptitude &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  1.How many 2 digit numbers are there which have 8 as &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;the unit number in it's square. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)3 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)None &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)2 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)1 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  2. B is 8km East of A. C is 6km North of B. D is 12km &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;East of C. E is 16km North of D. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;What is the distance b/w A and E. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)20km &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)22km &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)18km &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)30km &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  3. x+y = z &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Then &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)... &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)y(c)... &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  4. 2Then which is the greatest &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a) (x^2)y &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b) 5xy &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c) x(y^2) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d) 5(x^2)y/12 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  5. A is taller than B, D is taller than D, D is &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;shorter than E.Then which of the following is correct. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a) C is taller than E &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b) A is taller than C &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c) D is shorter than A &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d) B is shorter than C &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  6.A small passage was given and 4 options which &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;summarizes it was given.The best was to be chosen. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  7.Another passage was given and 4 inference was given &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;and correct was to be chosen.This one is very easy. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  8.Which of the following is a parellogram:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)130,50,130,50(angle in deg) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)120,30,130,20 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)90,90,90,90 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)a &amp; c &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  9. In the following series (an - 1)^2, 1 is the first &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;term.Which are the next three &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)1,3,4 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)0,3,6 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)0,1,2 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)0,1,0 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Answers &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;1.(b) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;2.(d) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;3.(b) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;4.(c) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;5.(c) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;8.(d) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;9.(d) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Computer science &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  1.Deadlock occur when &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)Some resources are held up by some process. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)... &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)... &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)None of these &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  2. A prefix __expression can be equal to a postfix &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;__expression reversed only if &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)It is left associative &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)It is commutative &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)It is right associative &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  3.How many lines will be printed in the following &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Pascal pgm &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;[I don't remember the Pascal version,so I am giving C &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;version] &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;void print(int n) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;if(n&gt;0) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;print(n-1); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;printf("%d",n);//println(n) in Pascal version. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;print(n-1); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)3 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)7 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)15 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d)31 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  4.Maximum number of nodes in a tree with n levels. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)2^(n-1) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)(2^n)-1 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)2^(n-1) - 1 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  5.Complete graphwith n nodes have &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)n-1 edges &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)n(n-1)/2&lt;/span&gt;&lt;div class="PostContent" style="font-family: georgia;"&gt;&lt;a target="_blank" ddress=""&gt;&lt;span style="font-style: normal;"&gt;&lt;/span&gt; &lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;6.If d is the degree of a node in a graph and n is &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;number of vertices then number of edges in that graph &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;is &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)Edi^n &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)0.25Edi &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)0.5Edi &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  7.A grammar was given and 4 strings was given and the &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;one which was not possible was to be chosen. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  8.A problem related to ethernet in which a station &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;sending a frame is of p probablity.There are m &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;stations to send pckts.4 option was given.It was a &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;mathematical kind of question related to probablity. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  9.Which of the following layer in the OSI model does &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;error handling &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)Data link &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)Network &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)Transport &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(d) a &amp; c &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;  10.A network problem in which Data rate,Propagation &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;delay,and distance was given and it was to find how &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;many packets will be in the line. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Choices where &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(a)5000 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(b)Not possible to find with given data &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(c)1000 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Answers(Not very sure about all the answers) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;1.(d) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;2.(b) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;3.(c) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;4.(b) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;6.(c) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;9.(d) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;10.(a) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Interview [For CS students] &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;There is Tech as well as HR interview. Tech interview &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;is the important one. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Tech interview questions &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;They will ask about the project.They will ask general &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;questions about it and most probably will not go into &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;the implementation part of it.So one must have a &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;general idea about the project done. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Interview is mainly based on Data Structures.Some &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;questions are as follows:- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- What is a tree,its application,order for &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;insertion,deletion and traversal with worst case &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;analysis. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- What is a graph,its application. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Height of a tree &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Balanced tree and how to balance a tree &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Minimum Spanning Tree &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Dijikstra's, Prim algorithms &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Define a structure for a linked list. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Binary search and its analysis &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Heap sort and its analysis &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- What is a heap and its application &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Cache and its working &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Memory(IO mapped) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Recursive fns and types, its adv and disadv. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Compiler(grammar) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;*****C debugging questions like &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(1)What is the problem with the following code &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;int * f(int a)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;int i; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;i=a; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;return(&amp;i); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Ans-&gt; We can't return address of auto variable as it &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;is allocation is made in stack which is deallocated &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;when the function returns. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(2) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;a.h b.c c.c d.c &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;int i=0 #include"a.h" #include"a.h" extern int &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;i;void main{.....} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;| | | &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;b.o c.o d.o &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Compilation Phase &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Linked to get exe. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;Will there be any problem in any phase.If yes then &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;where and what? &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;In linking phase as there will be multiple declaration &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;of i. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;*****You will be told to write some code like &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(1)To find string length by using recursive function. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(2)To find fibonaci series by using recursive &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;function. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(3)To write code for malloc so that allocation may be &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;made fastly. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;(4)Write a fn prototype which return a pointer which &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;points to an array of 10 ints. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;HR Interview &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;------------ &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Introduce yourself &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- Why should we take you &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-family: georgia;"&gt;- What you know about Sasken and etc.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7703887636762535127?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7703887636762535127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7703887636762535127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7703887636762535127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7703887636762535127'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/sasken.html' title='Sasken'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1468784831831490287</id><published>2007-08-06T19:17:00.000-07:00</published><updated>2007-08-06T19:25:52.336-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe'/><title type='text'>Adobe interview questions</title><content type='html'>&lt;span class="tdvamsee" style="font-size: 16px;"&gt;-write an O(log2(N)) algorithm to find X^N&lt;br /&gt;&lt;/span&gt;&lt;span class="tdvamsee" style="font-size: 16px;"&gt;-rotate an array using reverse fn....&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;-height of a tree,&lt;br /&gt;-finding second largest number in an array&lt;br /&gt;-questions using finite automata&lt;br /&gt;- write a pgm to find whether a m/c is little endian or big endian&lt;br /&gt;- print a number in hexadecimal format without using sprintf&lt;br /&gt;- optimise the computations in the recursive "nth fibonacci number" algo without using iteration(fairly simple)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;"Instead of using return(fib(n-2)+fib(n-1)), use init lofib=0,hifib=1, start with n=2,lofib=hifib;hifib=fib;fib=lofib+hifib"&lt;/span&gt;&lt;br /&gt;-given any number say 12, find the next multiple of 8 eg 16 using bit-wise manipulations.&lt;br /&gt;-exchange the integers in a matrix across the secondary diagonal(or non-major diagonal)&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1468784831831490287?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1468784831831490287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1468784831831490287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1468784831831490287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1468784831831490287'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/08/adobe-interview-questions.html' title='Adobe interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7013725162957268269</id><published>2007-07-19T20:04:00.000-07:00</published><updated>2007-07-19T20:08:32.119-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DEShaw'/><title type='text'>deshaw</title><content type='html'>&lt;span style="font-size:85%;"&gt;    &lt;span class="section"&gt; PROGRAMMING&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;       1. To display the contents of a executable file the following&lt;br /&gt;       command can be used&lt;br /&gt;       (a) cat  (b) od (c) vi   (d) ed                   ans : b&lt;br /&gt;&lt;br /&gt;       2. Assume the current directory contains 10 files and does'nt&lt;br /&gt;       contain 'temp'. What will be the output of the follwing&lt;br /&gt;       commands?&lt;br /&gt;       $ls &gt; temp&lt;br /&gt;       $wc -l temp&lt;br /&gt;       (a) 9  (b) 10 (c) 11 (d) undefined.   ans : b *c&lt;br /&gt;&lt;br /&gt;       3. If one wants the output of one command( command1) to be&lt;br /&gt;       printed inthe printer as well as to be added to another file&lt;br /&gt;       (outfile) which one of the following is a currect command&lt;br /&gt;       he can give?&lt;br /&gt;       (a) $command1 &gt;&gt;outfile|tee lpr&lt;br /&gt;       (b) $tee -a command1 | lpr&lt;br /&gt;       (c) $ command1 | tee outfile | lpr&lt;br /&gt;       (d) $ command | tee -a outfile |lpr          ans : d&lt;br /&gt;       (4) In the shell program set -x will cause&lt;br /&gt;       A. Execution of the commands in the background&lt;br /&gt;       B. Execution of the commands in verbose mode&lt;br /&gt;       C. Exit from the shell program.&lt;br /&gt;       D. Exit from the shell program after executing the next command&lt;br /&gt; ans:b&lt;br /&gt;&lt;br /&gt;       (5)   ACL in UNIX refers to&lt;br /&gt;       A.     Acces Control List&lt;br /&gt;       B.    Action Control List&lt;br /&gt;       C.    Application Command Language&lt;br /&gt;       D.    Advanced C lanuage&lt;br /&gt; ans a:&lt;br /&gt;&lt;br /&gt;       (6)    The command echo*&lt;br /&gt;       A. will print * on the screen&lt;br /&gt;       B. will print contents of all the files in the current&lt;br /&gt;       directory&lt;br /&gt;       C. will list the files in the current directory&lt;br /&gt;       D.   will print the contents of all shell variables&lt;br /&gt; ans c:&lt;br /&gt;&lt;br /&gt;       (7)    ls || date will&lt;br /&gt;       A.  print the name of the files in the current directory&lt;br /&gt;       B. print today's date and time&lt;br /&gt;       C. (A) followed by (B)&lt;br /&gt;       D. none of the above&lt;br /&gt; ans : a&lt;br /&gt;&lt;br /&gt;       (8) The built-in shell variable $$ refers to&lt;br /&gt;       A.   printing numbers in dollar format&lt;br /&gt;       B.   proces id_ of last command&lt;br /&gt;       C.   proces id_ of last background command issued&lt;br /&gt;       D.   proces-id of current shell&lt;br /&gt; ans :d&lt;br /&gt;&lt;br /&gt;       (9)   dd is mainly used for&lt;br /&gt;       A.  dealing with raw, unformated data, whatever the source&lt;br /&gt;       B.  dealing with data dictionary&lt;br /&gt;       C.  deleting a directory&lt;br /&gt;       D.  none of the above&lt;br /&gt; ans :d&lt;br /&gt;&lt;br /&gt;       (10) vis  in UNIX is&lt;br /&gt;       A. a command that takes only one input&lt;br /&gt;       B. a command for deleting strange or unwanted charectors that&lt;br /&gt;       may have crept into files.&lt;br /&gt;       C. points non-printable characters in understandable format&lt;br /&gt;       D. all of the above&lt;br /&gt;&lt;br /&gt;       (11) Which of the following is true regarding the UNIX&lt;br /&gt;       (i) Multiuser Operating System&lt;br /&gt;       (ii)Multitasking Operating System&lt;br /&gt;       (iii) Real timing Operating System&lt;br /&gt;       A. i only  B. i and ii only  C. i and ii and iii only&lt;br /&gt;       D. i and ii&lt;br /&gt; ans : a&lt;br /&gt;&lt;br /&gt;       (12) ln command is used to&lt;br /&gt;       A. link object codes into a executable code&lt;br /&gt;       B. give two names to the same file&lt;br /&gt;       C. set line numbers for the file&lt;br /&gt;       D. none of the above&lt;br /&gt; ans : b&lt;br /&gt;&lt;br /&gt;       (13) nohup command is used for&lt;br /&gt;       A. protecting the execution of programmes from aborting when&lt;br /&gt;       hangup signal is received&lt;br /&gt;       B. changing the execution priority of the programes&lt;br /&gt;       C. not hanging up of the modem&lt;br /&gt;       D. disconnecting a node from the system&lt;br /&gt; ans : a&lt;br /&gt;&lt;br /&gt;       (14)  SCCS is a&lt;br /&gt;       A. Tool for maintaining large programmes in a production&lt;br /&gt;       environment&lt;br /&gt;       B. Communication Protocol&lt;br /&gt;       C. Shell Programming Language&lt;br /&gt;       D.  String processing utility&lt;br /&gt; ans : a&lt;br /&gt;&lt;br /&gt;       (15)  Which one of the following is true as long as UNIX is&lt;br /&gt;       concerned&lt;br /&gt;       A. One can do programming in C only&lt;br /&gt;       B. It can support terminals capable of printing only uppercase&lt;br /&gt;       characters&lt;br /&gt;       C. The text files are sorted as it is in MS-DOS&lt;br /&gt;       D. None of the above&lt;br /&gt; ans: d&lt;br /&gt;&lt;br /&gt;       (16) Inside vi editor to replace the string 10/$$/92 with&lt;br /&gt;       10/$$/92 globally the following command can be used&lt;br /&gt;       A.  :1,$ s/\/10\/\$\/94/10\/\$\$\/92/g&lt;br /&gt;       B.  :1,$ s/\/10\/\$\/94/10\/\$\/$92/&lt;br /&gt;       C.  :s10/$$/92/10/$$/92/g&lt;br /&gt;       D.  :1,$ s/\/10\/$\/94/10\/$$\/92/g&lt;br /&gt;**** ans : d&lt;br /&gt;&lt;br /&gt;       (17) The ed command without any argument&lt;br /&gt;       A. will print the current working directory&lt;br /&gt;       B. will make the home directory as current directory&lt;br /&gt;       C. will ask for the directory to be used as the current&lt;br /&gt;   directory&lt;br /&gt;       D. will go to the previous directory&lt;br /&gt;&lt;br /&gt;       (18)  nice command is used&lt;br /&gt;       A. to increase/decrease execution priority of a command&lt;br /&gt;       B. to compress a file&lt;br /&gt;       C. to run a programme at latter time&lt;br /&gt;       D. to set the key board responce slower&lt;br /&gt; ans : a&lt;br /&gt;&lt;br /&gt;       (19)  What will be the output of the following command sequence&lt;br /&gt;   $ x='I am x'&lt;br /&gt;   $sh&lt;br /&gt;   $echo $x&lt;br /&gt;        A. I am x  B. Blank line C. x D. None of the above&lt;br /&gt; ans :b&lt;br /&gt;&lt;br /&gt;       (20) The command tr a-z 0-9 &lt; x&lt;br /&gt;       A. converts all the digits to lowercase alphabets&lt;br /&gt;       B. converts all the lowercase alphabets to digits&lt;br /&gt;       C. will give syntax error&lt;br /&gt;       D. none of the above&lt;br /&gt; ans :d&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7013725162957268269?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7013725162957268269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7013725162957268269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7013725162957268269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7013725162957268269'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/deshaw_3848.html' title='deshaw'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5184436708200601333</id><published>2007-07-19T20:00:00.000-07:00</published><updated>2007-07-19T20:04:02.148-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DEShaw'/><title type='text'>Deshaw</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;br /&gt;    &lt;span class="section"&gt;    APTITUDE PART &lt;/span&gt;&lt;br /&gt;  &lt;/span&gt;&lt;p&gt; &lt;span style="font-size:85%;"&gt;      (1)A man bought two horses for Rs.924 each and sold one horse for&lt;br /&gt;     15% profit and the other for 15% loss.What is the net gain?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;       (2) Two pumps fill atank in 20 hrs. One pump fills the same&lt;br /&gt;     tank 10hrs. faster than the other pump. In what time the&lt;br /&gt;     other pump fills the tank?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;       (3) X men in Xhrs/day finish a work in x days. Y men in y hours&lt;br /&gt;     per day finish the work in&lt;br /&gt;     (a) X**2/Y**2 (b)X**3/Y**2 (c) Y**2/X**2 (d) Y**3/X**2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;       (4)8 men + 2 boys finish a work in 16 days.&lt;br /&gt;     2 men + 5 boys finish a work in 20 days. 8 men and 8 boys&lt;br /&gt;     finish the same work in how many days?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;       (5)A &amp; B are two trains, travell from X &amp;amp; Y stations to Y &amp;amp; X&lt;br /&gt;     stations after crossing each other A takes 4 hrs.48 mins. to&lt;br /&gt;     reach Y station. B takes 3hrs.20 mins. to reach X station.&lt;br /&gt;     The speed A is 45kmph. Speed of B is ?&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5184436708200601333?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5184436708200601333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5184436708200601333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5184436708200601333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5184436708200601333'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/deshaw_19.html' title='Deshaw'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-4140794940319606417</id><published>2007-07-19T19:53:00.000-07:00</published><updated>2007-07-19T19:55:27.316-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DEShaw'/><title type='text'>DESHAW</title><content type='html'>&lt;span style="font-size:85%;"&gt;Write the programs for the  following problems in C.&lt;br /&gt;&lt;br /&gt;1. Swap two variables x,y without using a  temporary variable. &lt;/span&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;2. Write algorithm for finding the GCD of a  number. &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;3.Write a program for reversing the given string. &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;4. The integers from 1 to n are stored in an array in a  random&lt;br /&gt;    fashion. but one integer is missing. Write a program to find  the&lt;br /&gt;    missing integer. &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span class="Answer"  style="font-size:85%;"&gt;Ans): Hint : The sum of n natural numbers is =  n(n+1)/2.&lt;br /&gt;         if we subtract the above sum from the sum of all  the&lt;br /&gt;         numbers in the array , the result is nothing but the&lt;br /&gt;          missing number. &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;5. Some bit type of questions has been given on pointers  asking to&lt;br /&gt;    to find whether it is correct from syntax point of view. and  if&lt;br /&gt;    it is correct explain what it will do. (around 15 bits).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;6. For the  following C program &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span class="code"  style="font-size:85%;"&gt; #define AND &amp;&amp;amp;&lt;br /&gt;#define ARRANGE (a&gt;25 AND  a&lt;50)&lt;br /&gt;main()&lt;br /&gt;{int a = 30;&lt;br /&gt;if (ARRANGE)&lt;br /&gt;printf("within  range");&lt;br /&gt;else&lt;br /&gt;printf("out of range");&lt;br /&gt;} &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;What is the output? &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;7. For the following C program &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span class="code"  style="font-size:85%;"&gt; #define AREA(x)(3.14*x*x)&lt;br /&gt;main()&lt;br /&gt;{float  r1=6.25,r2=2.5,a;&lt;br /&gt;a=AREA(r1);&lt;br /&gt;printf("\n Area of the circle is %f",  a);&lt;br /&gt;a=AREA(r2);&lt;br /&gt;printf("\n Area of the circle is %f", a);&lt;br /&gt;} &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;What is the output? &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span class="Answer"  style="font-size:85%;"&gt;Ans. Area of the circle is 122.656250&lt;br /&gt;Area of  the circle is  19.625000 &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;8. What do the following statements indicate.  Explain.   &lt;/span&gt;&lt;span class="code"  style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;span class="code"  style="font-size:85%;"&gt; &lt;li&gt; &lt;p&gt; int(*p)[10]   &lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;p&gt;int*f()   &lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;p&gt;int(*pf)()   &lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;p&gt;int*p[10]  &lt;/p&gt;&lt;/li&gt;&lt;/span&gt;&lt;/ul&gt; &lt;p&gt;&lt;span class="Answer"  style="font-size:85%;"&gt;Refer to:&lt;br /&gt;-- Kernighan &amp; Ritchie page no.  122&lt;br /&gt;-- Schaum series page no. 323&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;9. Write a C program to find whether a stack is progressing in  forward&lt;br /&gt;    or reverse direction. &lt;/span&gt;&lt;/p&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;10. Write a C program that reverses the linked  list.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-4140794940319606417?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/4140794940319606417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=4140794940319606417' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4140794940319606417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4140794940319606417'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/deshaw.html' title='DESHAW'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3263480036892963173</id><published>2007-07-19T00:56:00.001-07:00</published><updated>2007-07-19T00:56:26.820-07:00</updated><title type='text'>Thinkers</title><content type='html'>&lt;ul&gt; &lt;li&gt;                 How are M&amp;Ms made?             &lt;/li&gt;&lt;li&gt;                 If you had a clock with lots of moving mechanical parts, you took it apart                  piece by piece without keeping track of the method of how it was disassembled,                  then you put it back together and discovered that 3 important parts were not                  included; how would you go about reassembling the clock?             &lt;/li&gt;&lt;li&gt;                 If you had to learn a new computer language, how would you go about doing it?             &lt;/li&gt;&lt;li&gt;                 You have been assigned to design Bill Gates bathroom. Naturally, cost is not a                  consideration. You may not speak to Bill.             &lt;/li&gt;&lt;li&gt;                 What was the hardest question asked of you so far today?             &lt;/li&gt;&lt;li&gt;                 If MS told you we were willing to invest $5 million in a start up of your                  choice, what business would you start? Why?             &lt;/li&gt;&lt;li&gt;                 If you could gather all of the computer manufacturers in the world together                  into one room and then tell them one thing that they would be compelled to do,                  what would it be?             &lt;/li&gt;&lt;li&gt;                 Explain a scenario for testing a salt shaker.             &lt;/li&gt;&lt;li&gt;                 If you are going to receive an award in 5 years, what is it for and who is the                  audience?             &lt;/li&gt;&lt;li&gt;                 How would you explain how to use Microsoft Excel to your grandma?             &lt;/li&gt;&lt;li&gt;                 Why is it that when you turn on the hot water in any hotel, for example, the                  hot water comes pouring out almost instantaneously?             &lt;/li&gt;&lt;li&gt;                 Why do you want to work at Microsoft?             &lt;/li&gt;&lt;li&gt;                 Suppose you go home, enter your house/apartment, hit the light switch, and                  nothing happens - no light floods the room. What exactly, in order, are the                  steps you would take in determining what the problem was?&lt;/li&gt;&lt;li&gt;                 Interviewer hands you a black pen and says nothing but "This pen      is red."&lt;/li&gt; &lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3263480036892963173?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3263480036892963173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3263480036892963173' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3263480036892963173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3263480036892963173'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/thinkers.html' title='Thinkers'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5086290348749434344</id><published>2007-07-19T00:55:00.001-07:00</published><updated>2007-07-19T00:55:51.700-07:00</updated><title type='text'>Applications</title><content type='html'>&lt;ul&gt; &lt;li&gt;                 How can computer technology be integrated in an elevator system for a hundred                  story office building? How do you optimize for availability? How would                  variation of traffic over a typical work week or floor or time of day affect                  this?             &lt;/li&gt;&lt;li&gt;                 How would you implement copy-protection on a control which can be embedded in a                  document and duplicated readily via the Internet?             &lt;/li&gt;&lt;li&gt;                 Define a user interface for indenting selected text in a Word document.                  Consider selections ranging from a single sentence up through selections of                  several pages. Consider selections not currently visible or only partially                  visible. What are the states of the new UI controls? How will the user know                  what the controls are for and when to use them?             &lt;/li&gt;&lt;li&gt;                 How would you redesign an ATM?             &lt;/li&gt;&lt;li&gt;                 Suppose we wanted to run a microwave oven from the computer. What kind of                  software would you write to do this?             &lt;/li&gt;&lt;li&gt;                 What is the difference between an Ethernet Address and an IP address?             &lt;/li&gt;&lt;li&gt;                 How would you design a coffee-machine for an automobile.             &lt;/li&gt;&lt;li&gt;                 If you could add any feature to Microsoft Word, what would it be?&lt;/li&gt;&lt;li&gt;                 How would you go about building a keyboard for 1-handed users?&lt;/li&gt;&lt;li&gt;                 How would you build an alarm clock for deaf people?&lt;/li&gt; &lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5086290348749434344?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5086290348749434344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5086290348749434344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5086290348749434344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5086290348749434344'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/applications.html' title='Applications'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-8574175109917535952</id><published>2007-07-19T00:54:00.001-07:00</published><updated>2007-07-19T00:54:43.294-07:00</updated><title type='text'>Algorithms</title><content type='html'>&lt;ul&gt; &lt;li&gt;                 What's the difference between a linked list and an array?             &lt;/li&gt;&lt;li&gt;                 Implement a linked list. Why did you pick the method you did?             &lt;/li&gt;&lt;li&gt;                 Implement an algorithm to sort a linked list. Why did you pick the method you                  did? Now do it in O(n) time.&lt;/li&gt;&lt;li&gt;                 Describe advantages and disadvantages of the various stock sorting algorithms.             &lt;/li&gt;&lt;li&gt;                 Implement an algorithm to reverse a linked list. Now do it without recursion.             &lt;/li&gt;&lt;li&gt;                 Implement an algorithm to insert a node into a circular linked list without                  traversing it.             &lt;/li&gt;&lt;li&gt;                 Implement an algorithm to sort an array. Why did you pick the method you did?             &lt;/li&gt;&lt;li&gt;                 Implement an algorithm to do wild card string matching.             &lt;/li&gt;&lt;li&gt;                 Implement strstr() (or some other string library function).             &lt;/li&gt;&lt;li&gt;                 Reverse a string. Optimize for speed. Optimize for space.             &lt;/li&gt;&lt;li&gt;                 Reverse the words in a sentence, i.e. "My name is Chris" becomes                  "Chris is name My." Optimize for speed. Optimize for space.&lt;/li&gt;&lt;li&gt;                 Find a substring. Optimize for speed. Optimize for space.             &lt;/li&gt;&lt;li&gt;                 Compare two strings using O(n) time with constant space.&lt;/li&gt;&lt;li&gt;                 Suppose you have an array of 1001 integers. The integers are in random order,                  but you know each of the integers is between 1 and 1000 (inclusive). In                  addition, each number appears only once in the array, except for one number,                  which occurs twice. Assume that you can access each element of the array only                  once. Describe an algorithm to find the repeated number. If you used auxiliary                  storage in your algorithm, can you find an algorithm that does not require it?             &lt;/li&gt;&lt;li&gt;                 Count the number of set bits in a number. Now optimize for speed. Now optimize                  for size.             &lt;/li&gt;&lt;li&gt;                 Multiple by 8 without using multiplication or addition. Now do the same with 7.             &lt;/li&gt;&lt;li&gt;                 Add numbers in base &lt;i&gt;n&lt;/i&gt; (not any of the popular ones like 10, 16, 8 or 2                  -- I hear that Charles Simonyi, the inventor of Hungarian Notation, favors -2                  when asking this question).             &lt;/li&gt;&lt;li&gt;                 Write routines to read and write a bounded buffer.             &lt;/li&gt;&lt;li&gt;                 Write routines to manage a heap using an existing array.             &lt;/li&gt;&lt;li&gt;                 Implement an algorithm to take an array and return one with only unique                  elements in it.             &lt;/li&gt;&lt;li&gt;                 Implement an algorithm that takes two strings as input, and returns the                  intersection of the two, with each letter represented at most once. Now speed                  it up. Now test it.             &lt;/li&gt;&lt;li&gt;                 Implement an algorithm to print out all files below a given root node.             &lt;/li&gt;&lt;li&gt;                 Given that you are receiving samples from an instrument at a constant rate, and                  you have constant storage space, how would you design a storage algorithm that                  would allow me to get a representative readout of data, no matter when I looked                  at it? In other words, representative of the behavior of the system to date.             &lt;/li&gt;&lt;li&gt;                 How would you find a cycle in a linked list?             &lt;/li&gt;&lt;li&gt;                 Give me an algorithm to shuffle a deck of cards, given that the cards are                  stored in an array of ints.             &lt;/li&gt;&lt;li&gt;                 The following asm block performs a common math function, what is it?                 &lt;pre&gt;cwd xor ax, dx&lt;br /&gt;sub ax, dx&lt;/pre&gt;             &lt;/li&gt;&lt;li&gt;                 Imagine this scenario:                &lt;br /&gt;                I/O completion ports are communictaions ports which take handles to files,                  sockets, or any other I/O. When a Read or Write is submitted to them, they                  cache the data (if necessary), and attempt to take the request to completion.                  Upon error or completion, they call a user-supplied function to let the users                  application know that that particular request has completed. They work                  asynchronously, and can process an unlimited number of simultaneous requests.                &lt;br /&gt;                Design the implementation and thread models for I/O completion ports. Remember                  to take into account multi-processor machines.             &lt;/li&gt;&lt;li&gt;                 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;/li&gt;&lt;li&gt;                 Write a function to print all of the permutations of a string.             &lt;/li&gt;&lt;li&gt;                 Implement malloc.             &lt;/li&gt;&lt;li&gt;                 Write a function to print the Fibonacci numbers.             &lt;/li&gt;&lt;li&gt;                 Write a function to copy two strings, A and B. The last few bytes of string A                  overlap the first few bytes of string B.             &lt;/li&gt;&lt;li&gt;                 How would you write qsort?             &lt;/li&gt;&lt;li&gt;                 How would you print out the data in a binary tree, level by level, starting at                  the top?&lt;/li&gt; &lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-8574175109917535952?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/8574175109917535952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=8574175109917535952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8574175109917535952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8574175109917535952'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/algorithms.html' title='Algorithms'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-7964811665730408267</id><published>2007-07-19T00:52:00.000-07:00</published><updated>2007-07-19T00:53:47.256-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Riddles</title><content type='html'>&lt;ul&gt; &lt;li&gt;                 Why is a manhole cover round?             &lt;/li&gt;&lt;li&gt;                 How many cars are there in the USA? (A popular variant is "How many gas                  stations are there in the USA?")             &lt;/li&gt;&lt;li&gt;                 How many manhole covers are there in the USA?             &lt;/li&gt;&lt;li&gt;                 You've got someone working for you for seven days and a gold bar to pay them.                  The gold bar is segmented into seven connected pieces. You must give them a                  piece of gold at the end of every day. If you are only allowed to make two                  breaks in the gold bar, how do you pay your worker?             &lt;/li&gt;&lt;li&gt;                 One train leaves Los Angeles at 15mph heading for New York. Another train                  leaves from New York at 20mph heading for Los Angeles on the same track. If a                  bird, flying at 25mph, leaves from Los Angeles at the same time as the train                  and flies back and forth between the two trains until they collide, how far                  will the bird have traveled?             &lt;/li&gt;&lt;li&gt;                 Imagine a disk spinning like a record player turn table. Half of the disk is                  black and the other is white. Assume you have an unlimited number of color                  sensors. How many sensors would you have to place around the disk to determine                  the direction the disk is spinning? Where would they be placed?             &lt;/li&gt;&lt;li&gt;                 Imagine an analog clock set to 12 o'clock. Note that the hour and minute hands                  overlap. How many times each day do both the hour and minute hands overlap? How                  would you determine the exact times of the day that this occurs?             &lt;/li&gt;&lt;li&gt;                 You have two jars, 50 red marbles and 50 blue marbles. A jar will be picked at                  random, and &lt;i&gt;then&lt;/i&gt; a marble will be picked from the jar. Placing all of                  the marbles in the jars, how can you maximize the chances of a red marble being                  picked? What are the exact odds of getting a red marble using your scheme?             &lt;/li&gt;&lt;li&gt;                 Pairs of primes separated by a single number are called prime pairs. Examples                  are 17 and 19. Prove that the number between a prime pair is always divisible                  by 6 (assuming both numbers in the pair are greater than 6). Now prove that                  there are no 'prime triples.'             &lt;/li&gt;&lt;li&gt;                 There is a room with a door (closed) and three light bulbs. Outside the room                  there are three switches, connected to the bulbs. You may manipulate the                  switches as you wish, but once you open the door you can't change them.                  Identify each switch with its bulb.             &lt;/li&gt;&lt;li&gt;                 Suppose you had 8 billiard balls, and one of them was slightly heavier, but the                  only way to tell was by putting it on a scale against another. What's the                  fewest number of times you'd have to use the scale to find the heavier ball?             &lt;/li&gt;&lt;li&gt;                 Imagine you are standing in front of a mirror, facing it. Raise your left hand.                  Raise your right hand. Look at your reflection. When you raise your left hand                  your reflection raises what appears to be his right hand. But when you tilt                  your head up, your reflection does too, and does not appear to tilt his/her                  head down. Why is it that the mirror appears to reverse left and right, but not                  up and down?             &lt;/li&gt;&lt;li&gt;                 You have 4 jars of pills. Each pill is a certain weight, except for                  contaminated pills contained in one jar, where each pill is weight + 1. How                  could you tell which jar had the contaminated pills in just one measurement?             &lt;/li&gt;&lt;li&gt;                 The SF Chronicle has a word game where all the letters are scrambled up and you                  have to figure out what the word is. Imagine that a scrambled word is 5                  characters long:             &lt;/li&gt;&lt;ol&gt;&lt;li&gt;                     How many possible solutions are there?                 &lt;/li&gt;&lt;li&gt;                     What if we know which 5 letters are being used?                 &lt;/li&gt;&lt;li&gt;                     Develop an algorithm to solve the word.                 &lt;/li&gt;&lt;/ol&gt;&lt;li&gt;                 There are 4 women who want to cross a bridge. They all begin on the same side.                  You have 17 minutes to get all of them across to the other side. It is night.                  There is one flashlight. A maximum of two people can cross at one time. Any                  party who crosses, either 1 or 2 people, must have the flashlight with them.                  The flashlight must be walked back and forth, it cannot be thrown, etc. Each                  woman walks at a different speed. A pair must walk together at the rate of the                  slower woman's pace.                 &lt;p&gt;                     Woman 1: 1 minute to cross                    &lt;br /&gt;                    Woman 2: 2 minutes to cross                    &lt;br /&gt;                    Woman 3: 5 minutes to cross                    &lt;br /&gt;                    Woman 4: 10 minutes to cross                    &lt;br /&gt;                &lt;/p&gt;                 &lt;p&gt;                     For example if Woman 1 and Woman 4 walk across first, 10 minutes have elapsed                      when they get to the other side of the bridge. If Woman 4 then returns with the                      flashlight, a total of 20 minutes have passed and you have failed the mission.                      What is the order required to get all women across in 17 minutes? Now, what's                      the other way?                 &lt;/p&gt;             &lt;/li&gt;&lt;li&gt;                 If you had an infinite supply of water and a 5 quart and 3 quart pail, how                  would you measure exactly 4 quarts?             &lt;/li&gt;&lt;li&gt;                 You have a bucket of jelly beans. Some are red, some are blue, and some green.                  With your eyes closed, pick out 2 of a like color. How many do you have to grab                  to be sure you have 2 of the same?&lt;/li&gt;&lt;li&gt;                 If you have two buckets, one with red paint and the other with blue paint, and                  you take one cup from the blue bucket and poor it into the red bucket. Then you                  take one cup from the red bucket and poor it into the blue bucket. Which bucket                  has the highest ratio between red and blue? Prove it mathematically.&lt;/li&gt; &lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-7964811665730408267?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/7964811665730408267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=7964811665730408267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7964811665730408267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/7964811665730408267'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/riddles.html' title='Riddles'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3954125826508042373</id><published>2007-07-12T22:41:00.000-07:00</published><updated>2007-07-12T22:48:02.072-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Google,Microsoft  interview questions collection</title><content type='html'>&lt;p&gt;&lt;span style="font-size:85%;"&gt;1).You have to get from point A to point B. You don’t know if you can get there. What would you do?&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;2).Imagine you have a closet full of shirts. It’s very hard to find a shirt. So what can you do to organize your shirts for easy retrieval?&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;3).What method would you use to look up a word in a dictionary?&lt;span id="more-325"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;4).Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announce that at least one husband has been unfaithful. What happens?&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;5).You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you fine the ball that is heavier by using a balance and only two weighings? &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;6).How do you cut a rectangular cake into two equal pieces when someone has already taken a rectangular piece from it? The removed piece an be any size or at any place in the cake. You are only allowed one straight cut. &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3954125826508042373?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3954125826508042373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3954125826508042373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3954125826508042373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3954125826508042373'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/google-interview-questions-collection_12.html' title='Google,Microsoft  interview questions collection'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-8403567067475834718</id><published>2007-07-12T22:38:00.000-07:00</published><updated>2007-07-12T22:46:37.523-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Google,Microsoft  interview questions collection</title><content type='html'>&lt;span style="font-size:100%;"&gt;1)Explain the significance of "dead beef".&lt;/span&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;2) Write a C program which measures the the speed of a context switch on a UNIX/Linux system.&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;3) Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7.&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;4) Describe the algorithm for a depth-first graph traversal.&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;5) Design a class library for writing card games.&lt;/span&gt;&lt;/p&gt;        &lt;p&gt;&lt;span style="font-size:100%;"&gt;6) You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write a the question on a card which and give it to Eve who will take the card to Bob and return the answer to you. What must you write on the card, besides the question, to ensure Bob can encode the message so that Eve cannot read your phone number?&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;7) How are cookies passed in the HTTP protocol?&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;8) What is the size of the C structure below on a 32-bit system?  On a 64-bit? &lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style="font-size:100%;"&gt;struct foo {&lt;br /&gt;     char a;&lt;br /&gt;     char* b;&lt;br /&gt;};&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;8) Design the SQL database tables for a car rental database.&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;9) Write a regular expression which matches a email address.&lt;/span&gt;&lt;/p&gt;            &lt;p&gt;&lt;span style="font-size:100%;"&gt;10)Write a function f(a, b) which takes two character string arguments and returns a string containing only the characters found in both strings in the order of a. Write a version which is order N-squared and one which is order N.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;11) You are given a the source to a application which is crashing when run. After running it 10 times in a debugger, you find it never crashes in the same place. The application is single threaded, and uses only the C standard library. What programming errors could be causing this crash? How would you test each one?&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;span style="font-size:100%;"&gt;12) Explain how congestion control works in the TCP protocol.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-8403567067475834718?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/8403567067475834718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=8403567067475834718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8403567067475834718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8403567067475834718'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/google-interview-questions-collection.html' title='Google,Microsoft  interview questions collection'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6662227640416469597</id><published>2007-07-12T22:34:00.000-07:00</published><updated>2007-07-12T22:36:32.788-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google interview questions</title><content type='html'>1) ."You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?"&lt;br /&gt;&lt;br /&gt;2)."How would you find out if a machine's stack grows up or down in memory?"&lt;br /&gt;&lt;br /&gt;3)."Explain a database in three sentences to your eight-year-old nephew."&lt;br /&gt;&lt;br /&gt;4).How many gas stations would you say there are in the United States?"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6662227640416469597?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6662227640416469597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6662227640416469597' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6662227640416469597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6662227640416469597'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/google-interview-questions.html' title='Google interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-535396839053866278</id><published>2007-07-09T02:22:00.000-07:00</published><updated>2007-08-17T01:16:30.468-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe'/><category scheme='http://www.blogger.com/atom/ns#' term='Interviews'/><category scheme='http://www.blogger.com/atom/ns#' term='DEShaw'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Structures and Algorithms'/><title type='text'>Swap 2 variables without using a third variable</title><content type='html'>Here goes my solution:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int a = 5;&lt;br /&gt;int b = 8;&lt;br /&gt;&lt;br /&gt;a = b - a;&lt;br /&gt;b = b - a;&lt;br /&gt;a = a + b;&lt;br /&gt;&lt;br /&gt;printf("After swapping ...a= %d and b= %d ",a,b);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-535396839053866278?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/535396839053866278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=535396839053866278' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/535396839053866278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/535396839053866278'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/swap-2-variables-without-using-third.html' title='Swap 2 variables without using a third variable'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6290208644365331862</id><published>2007-07-08T06:52:00.000-07:00</published><updated>2007-07-08T07:12:33.867-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Remove Duplicates from a list in PERL</title><content type='html'>There is one simple and elegant solution for removing duplicates from a list in PERL&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;           @array = (2,4,3,3,4,6,2);&lt;br /&gt;            my %seen = ();&lt;br /&gt;            my @unique = grep { ! $seen{ $_ }++ } @array;&lt;br /&gt;            print "@unique";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And here goes a bit more detailed solution&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;            @array = (2,4,3,3,4,6,2);&lt;br /&gt;            my @unique = ();&lt;br /&gt;            my %seen   = ();&lt;br /&gt;&lt;br /&gt;             foreach my $elem ( @array )&lt;br /&gt;             {&lt;br /&gt;                    next if $seen{ $elem }++;&lt;br /&gt;                    #print "\n".$elem." ".$seen{ $elem }++;;&lt;br /&gt;                    push @unique, $elem;&lt;br /&gt;              }&lt;br /&gt;              print "@unique";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;"$seen{ $elem }++" - This expression returns 1, if the element that is being pushed in to the hash table is already seen. You go through each element and skip the ones you've seen before. We use a hash %seen to keep track. The first time the loop sees an element, that element has no key in &lt;code class="inline"&gt;&lt;span class="i"&gt;%Seen&lt;/span&gt;&lt;/code&gt; . The &lt;code class="inline"&gt;&lt;a class="l_k" href="http://perldoc.perl.org/functions/next.html"&gt;next&lt;/a&gt;&lt;/code&gt; statement creates the key and immediately uses its value, which is &lt;code class="inline"&gt;&lt;a class="l_k" href="http://perldoc.perl.org/functions/undef.html"&gt;undef&lt;/a&gt;&lt;/code&gt;, so the loop continues to the &lt;code class="inline"&gt;&lt;a class="l_k" href="http://perldoc.perl.org/functions/push.html"&gt;push&lt;/a&gt;&lt;/code&gt; and increments the value for that key. The next time the loop sees that same element, its key exists in the hash &lt;i&gt;and&lt;/i&gt; the value for that key is true (since it's not 0 or undef), so the "next statement" skips that iteration and the loop goes to the next element.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6290208644365331862?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6290208644365331862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6290208644365331862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6290208644365331862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6290208644365331862'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/remove-duplicates-from-list-in-perl.html' title='Remove Duplicates from a list in PERL'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-4137178025548480312</id><published>2007-07-08T05:11:00.000-07:00</published><updated>2007-07-08T06:12:42.679-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Find all the pairs in an array .... that sum up to particular number.</title><content type='html'>Here goes my version .... implemented in Java. This program runs only on java 1.5&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.util.*;&lt;br /&gt;class findPairs&lt;br /&gt;{&lt;br /&gt;    public static void main(String[] args)&lt;br /&gt;    {&lt;br /&gt;        int a[] = new int[10];&lt;br /&gt;        int index = 0;&lt;br /&gt;        /* Java 1.5 specific code .... replace this with a simple array if you don't want to take input from console */&lt;br /&gt;        Scanner sc =  new Scanner(System.in);&lt;br /&gt;        String str = null;&lt;br /&gt;        System.out.println("Enter array input");&lt;br /&gt;        while(!(str=sc.next()).equals("quit")) {&lt;br /&gt;            a[index] = Integer.parseInt(str);   &lt;br /&gt;            index++;&lt;br /&gt;        }&lt;br /&gt;        sc =  new Scanner(System.in);&lt;br /&gt;        System.out.println("Enter the number");&lt;br /&gt;        int findNumber = Integer.parseInt(sc.next());&lt;br /&gt;&lt;br /&gt;        int start = 0;&lt;br /&gt;        int end = index-1;&lt;br /&gt;        while(start &lt;= end) {&lt;br /&gt;            //System.out.println("Now  "+a[start]+" "+a[end]+"findNumber= "+findNumber);&lt;br /&gt;            if(a[start]+a[end] &lt; findNumber)&lt;br /&gt;                start++;&lt;br /&gt;            else if(a[start]+a[end] &gt; findNumber)&lt;br /&gt;                end--;&lt;br /&gt;            else if(a[start]+a[end] == findNumber) {&lt;br /&gt;            System.out.println("\npair is "+a[start]+" "+a[end]);&lt;br /&gt;                end--;&lt;br /&gt;                start++;&lt;br /&gt;           &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This can also be implemented using a simple hash table like data structure. But certainly has lot of limitations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-4137178025548480312?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/4137178025548480312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=4137178025548480312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4137178025548480312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/4137178025548480312'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/find-all-pairs-in-array-that-sum-up-to.html' title='Find all the pairs in an array .... that sum up to particular number.'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2077547583180284142</id><published>2007-07-07T23:11:00.000-07:00</published><updated>2007-07-07T23:29:10.893-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interviews'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Are you an aspiring "Googler"!!!</title><content type='html'>Are you an aspiring Googler? Want to join Microsoft, Yahoo or Amazon soon after completing your graduation? Are you an experienced developer looking for a change?&lt;br /&gt;&lt;br /&gt;Know Java, C/C++? Know Binary Trees and Are you good at solving puzzles? Have an aptitude for solving tough problems in Computer Science?&lt;br /&gt;&lt;br /&gt;The Best way to conquer any thing is "Know Your Enemy(or friend? :) )" -&lt;br /&gt;&lt;br /&gt;Do you see Google Jobs ad at the top of this page ..... go to their jobs web site ..... read the job profile .... know what they are looking for a specific position and gear up your preparation!!!&lt;br /&gt;&lt;br /&gt;Its the same for any company, you are interested in!!!&lt;br /&gt;&lt;br /&gt;Focus!!! Focus!!! Don't get deviated!!!&lt;br /&gt;&lt;br /&gt;I wish you "Good Luck"!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2077547583180284142?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2077547583180284142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2077547583180284142' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2077547583180284142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2077547583180284142'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/are-you-aspiring-googler.html' title='Are you an aspiring &quot;Googler&quot;!!!'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-8337644181803165380</id><published>2007-07-07T21:14:00.000-07:00</published><updated>2007-07-07T22:48:13.068-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Remove a file named "-f"</title><content type='html'>Already started thinking about the solution!!! Wait ......... Wait ........&lt;br /&gt;&lt;br /&gt;First of all, Can you create a file named "-f" on a Unix Based System? Think about it!!!&lt;br /&gt;&lt;br /&gt;You cannot create it with "vi" Command... Know the reason ???? "-f" is a flag in Unix Based Systems for commands like "vi" and "rm". So you can create a file with another name and rename it to "-f" .....&lt;br /&gt;&lt;br /&gt;Now ..... How do you remove this file ???? Do you know that ........ "-f" is flag for "rm" command which forces the removal of a file or folder supplied to the "rm" command as argument ......&lt;br /&gt;&lt;br /&gt;So you can't do something like this .....&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;          rm -f&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So what's the solution ....... Have you ever heard about "Absolute and Relative Paths"???&lt;br /&gt;&lt;br /&gt;Absolute Path: A path relative to the &lt;span style="font-weight: bold;"&gt;root directory&lt;/span&gt;.  Its   first character must be the pathname seperator like "/".&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Example:    /home/praveen/practice/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;Relative Path: A path relative to the &lt;span style="font-weight: bold;"&gt;working directory&lt;/span&gt;. Its first character can be anything but the pathname separator.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Example:  questions/myprogram.java&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So .... got it?&lt;br /&gt;&lt;br /&gt;HeHe ....&lt;br /&gt;&lt;br /&gt;OK ...... Answer is:&lt;br /&gt;&lt;br /&gt;say your file with name "-f" is in /home/praveen/practice and your current directory is also the same.&lt;br /&gt;&lt;br /&gt;rm /home/praveen/practice/-f&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;rm ../-f&lt;br /&gt;&lt;br /&gt;Got it? Comments?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-8337644181803165380?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/8337644181803165380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=8337644181803165380' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8337644181803165380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8337644181803165380'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/remove-file-named-f.html' title='Remove a file named &quot;-f&quot;'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-8296591869064255022</id><published>2007-07-07T20:47:00.000-07:00</published><updated>2007-08-17T01:17:44.512-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sun Microsystems'/><category scheme='http://www.blogger.com/atom/ns#' term='Adobe'/><category scheme='http://www.blogger.com/atom/ns#' term='Sasken'/><category scheme='http://www.blogger.com/atom/ns#' term='Interviews'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Know Answer to "The Question" already????</title><content type='html'>Know answer to the question your interviewer is asking?? Don't start shouting the answer even before your interviewer finishes with the question!!!&lt;br /&gt;&lt;br /&gt;Here goes a list of few tips I know!!!&lt;br /&gt;&lt;br /&gt;1. Listen to the question intently (you may want to smile ....... don't that!!)&lt;br /&gt;&lt;br /&gt;2. Look a bit tensed(repeat with me .... "A BIT" not more than that nor less than that!!!)&lt;br /&gt;&lt;br /&gt;3. Think think think ...... (at least try to pretend yaarr!!! )&lt;br /&gt;&lt;br /&gt;4. Ask questions ....... (You can ask more questions ..... if you know the answer already!!! HeHeHe ...)&lt;br /&gt;&lt;br /&gt;5. Then ...... do a bit of :ghoting (you know that eh??? hehehe ...)&lt;br /&gt;&lt;br /&gt;6. Then slowly read out your solution ........&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I wish you "ALL" -----"Good Luck!!!"&lt;br /&gt;&lt;br /&gt;Do you have some more tips to add ..... you are most welcome Buddy!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-8296591869064255022?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/8296591869064255022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=8296591869064255022' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8296591869064255022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8296591869064255022'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/know-answer-to-question-already.html' title='Know Answer to &quot;The Question&quot; already????'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2064381228438944972</id><published>2007-07-07T20:27:00.000-07:00</published><updated>2007-07-07T20:44:46.845-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Have to write code during the interview????</title><content type='html'>Here goes one of the mistakes my friend made in the 2nd round of his interview ......&lt;br /&gt;&lt;br /&gt;Can you write a program for finding nth Fibonacci number? Am I kidding? Off course you can!!! I know that!!! But the gotcha here is this ......&lt;br /&gt;&lt;br /&gt;If you are an experienced person, preparing for interviews .... you are mostly likely be asked to write code (repeat with me 'WRITE CODE' not pseudo code or algorithm!). Don't forget to write the exact running version and read out to the interviewer. Don't forget to read out the semicolons at the end of every statement. Because, as you read out the code, your interviewer is typing the code and will execute it after you finishing to read out!! Seems at the max you are allowed to make just 2 mistakes. Also, in a hurry to finish it off fast, don't use more variables than required!!!&lt;br /&gt;&lt;br /&gt;Here goes my version of recursive and non recursive versions of finding the Nth fibonacci number!!&lt;br /&gt;(The code is written in Java)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Fibonacci&lt;br /&gt;{&lt;br /&gt;    public static void main(String[] args)&lt;br /&gt;    {&lt;br /&gt;        int num = 5;&lt;br /&gt;        System.out.println("Answer from recursive version"+fibRecursive(num));&lt;br /&gt;        System.out.println("Answer from non recursive version"+fibNonRecursive(num));&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static int fibNonRecursive(int number) {&lt;br /&gt;        int sum = 0;&lt;br /&gt;        if(number == 0)&lt;br /&gt;            return 0;&lt;br /&gt;        else if(number == 1)&lt;br /&gt;            return 1;&lt;br /&gt;        else {&lt;br /&gt;            int a = 0; // fib value when number is 0&lt;br /&gt;            int b = 1; // fib value when number is 1&lt;br /&gt;            int count = 0;&lt;br /&gt;            while(count &lt; number-1) {&lt;br /&gt;                sum = a + b;&lt;br /&gt;                a = b;&lt;br /&gt;                b = sum;&lt;br /&gt;                count = count + 1;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return sum;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static int fibRecursive(int number) {&lt;br /&gt;       &lt;br /&gt;        if(number == 0)&lt;br /&gt;            return 0;&lt;br /&gt;        else if(number == 1)&lt;br /&gt;            return 1;&lt;br /&gt;        return fibRecursive(number-1)+fibRecursive(number-2);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Can you minimize the number of variables I am using in the non recursive version? Your comments are welcome!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2064381228438944972?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2064381228438944972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2064381228438944972' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2064381228438944972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2064381228438944972'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/have-to-write-code-during-interview.html' title='Have to write code during the interview????'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2318892634086776369</id><published>2007-07-07T04:51:00.000-07:00</published><updated>2007-07-07T07:46:02.268-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>PHP Interview questions from YAHOO</title><content type='html'>&lt;span style="font-family:georgia;"&gt;1. What is the difference between foo() &amp;amp; @foo()? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;2. How do you debug a PHP application?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;3. What does === do? What’s an example of something that will give true for ‘==’, but not ‘===’? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;4. How would you declare a class named “myclass” with no methods or properties?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;5. How would you create an object, which is an instance of “myclass”?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2318892634086776369?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2318892634086776369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2318892634086776369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2318892634086776369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2318892634086776369'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/php-interview-questions-from-yahoo_07.html' title='PHP Interview questions from YAHOO'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-2632497224595108225</id><published>2007-07-07T04:50:00.000-07:00</published><updated>2007-07-07T07:51:18.018-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>PHP Interview questions from YAHOO</title><content type='html'>&lt;span&gt;&lt;span&gt;1. Which of the following will not add john to the users array?&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;pre&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;$users[] = ‘john’;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;array_add($users,’john’);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;array_push($users,‘john’);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;$users ||= ‘john’; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;      2. What’s the difference between sort(), assort() and ksort? Under what circumstances would you use each of these?&lt;br /&gt;&lt;br /&gt;3. What would the following code print to the browser? Why? &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$num = 10;&lt;br /&gt;function multiply(){&lt;br /&gt;   $num = $num * 10;&lt;br /&gt;}&lt;br /&gt;multiply();&lt;br /&gt;echo $num; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;4. What is the difference between a reference and a regular variable? How do you pass by reference &amp;amp; why would you want to? 5. What functions can you use to add library code to the currently running script?&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-2632497224595108225?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/2632497224595108225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=2632497224595108225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2632497224595108225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/2632497224595108225'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/php-interview-questions-from-yahoo.html' title='PHP Interview questions from YAHOO'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6731813306816479844</id><published>2007-07-07T04:29:00.000-07:00</published><updated>2007-07-07T04:49:53.618-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><title type='text'>Yahoo interview question</title><content type='html'>1) What is the basic difference you find between a shell  script and perl?&lt;br /&gt;&lt;br /&gt;2)what is mutation testing?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6731813306816479844?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6731813306816479844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6731813306816479844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6731813306816479844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6731813306816479844'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/yahoo-interview-question.html' title='Yahoo interview question'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1143262562611085857</id><published>2007-07-06T01:33:00.000-07:00</published><updated>2007-07-07T07:52:53.035-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><title type='text'>Amazon interview questions</title><content type='html'>&lt;div id="link_desc"&gt;1)How would you find the nth to last element in a linked list?&lt;br /&gt;&lt;br /&gt;2)          Explain algorithm to shuffle cards&lt;br /&gt;&lt;br /&gt;3)Coding: Jig saw puzzle. What are the data structures? Assume you have some method which can tell you if two pieces fit together. How would you solve the puzzle, minimizing the number of times you have to call that function?&lt;br /&gt;&lt;br /&gt;4)You have 50,000 html files, some of which contain phone numbers. How would you create a list of all the files which contain phone numbers?&lt;br /&gt;&lt;br /&gt;5)          How would you detect a repeated element in an integer array.&lt;br /&gt;&lt;br /&gt;6)          Write a function to smooth out stock fluctuations.&lt;br /&gt;&lt;br /&gt;7)          Given two sets, Write a function to provide the union of them.&lt;br /&gt;&lt;br /&gt;8)          Design an algorithm to  calculate the most user viewed pages&lt;br /&gt;&lt;br /&gt;9)          Design an algorithm to find duplicates in an array.&lt;br /&gt;&lt;br /&gt;10)          Design an algorithm and write code to serialize a binary tree.&lt;br /&gt;&lt;br /&gt;11)          Design an algorithm and write code to find two numbers in an array whose sum equals a given value&lt;br /&gt;&lt;br /&gt;12)          count bits in an integer.&lt;br /&gt;&lt;br /&gt;13)Given two binary trees, find whether or not they are similar.&lt;br /&gt;&lt;div id="link_desc"&gt;&lt;br /&gt;14)&lt;span class="link"&gt;&lt;/span&gt;assume your computer is reading characters one by one from a stream (you don't know the length of the stream before ending). Note that you have only one character of storage space (so you cann't save the characters you've read to a something like a strong). When you've finished reading you should return a character out of the stream with equal probability.&lt;br /&gt;&lt;div id="link_desc"&gt;&lt;br /&gt;15)You have a tree (not Binary) and you want to print the values of all the nodes in this tree level by level.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-3795827594471517"; google_ad_width = 234; google_ad_height = 60; google_ad_format = "234x60_as"; google_ad_type = "text"; google_ad_channel = "2864315082"; google_color_border = "F0F0F0"; google_color_bg = "FFFFFF"; google_color_link = "003366"; google_color_text = "808080"; google_color_url = "808080"; //--&gt;&lt;/script&gt;  &lt;/div&gt;                        &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-3795827594471517"; google_ad_width = 234; google_ad_height = 60; google_ad_format = "234x60_as"; google_ad_type = "text"; google_ad_channel = "2864315082"; google_color_border = "F0F0F0"; google_color_bg = "FFFFFF"; google_color_link = "003366"; google_color_text = "808080"; google_color_url = "808080"; //--&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1143262562611085857?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1143262562611085857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1143262562611085857' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1143262562611085857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1143262562611085857'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/amazon-interview-questions.html' title='Amazon interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-8127181504740871936</id><published>2007-07-06T01:13:00.000-07:00</published><updated>2007-07-07T07:55:20.652-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Google,Microsoft interview questions phase-3</title><content type='html'>&lt;span&gt;1) Tree search algorithms. Write BFS and DFS code, explain run time and space                        requirements.   Modify the code to handle trees with weighted edges and loops with BFS and DFS, make the code print out path to goal state.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;2)You are given a list of numbers. When you reach the end of the list you will come back to the beginning of the list (a circular list). Write the most efficient algorithm to find the minimum # in this list. Find any given # in the list. The numbers in the list are always increasing but you don’t know where the circular list begins, ie: 38, 40, 55, 89, 6, 13, 20, 23, 36.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;3)Design a web server that serves the Google homepage.&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span&gt;     What are the requirements. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;     Design a multi threaded web server that uses shared memory instead of disk access.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;     Design a work load balancer for their data centers.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;     Design a DNS server that returns the IP address of a data center that has the best connectivity relative to your IP.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-8127181504740871936?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/8127181504740871936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=8127181504740871936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8127181504740871936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8127181504740871936'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/googlemicrosoft-interview-questions_4306.html' title='Google,Microsoft interview questions phase-3'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-340728721947454979</id><published>2007-07-06T00:52:00.000-07:00</published><updated>2007-07-07T07:56:54.705-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Google,Microsoft interview questions phase-2</title><content type='html'>&lt;span&gt;1)What is the best and worst time for the operation 'equals'&lt;/span&gt;&lt;br /&gt;&lt;span&gt;How do you spedup the 'equals' operation&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Write a function (and dictate it to your interviewer) that reverse the order of words in a sentence. The final algorithm should work in-place!! E.g.: "This is a sample" --&gt; "sample a is This"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;2)Trade offs between a multi threaded and single threaded implementation ?&lt;/span&gt;&lt;br /&gt;&lt;span&gt;N threads .. n resources .. what protocol do you use to ensure no deadlocks occur?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;3)There are a set of 'n' integers. Describe an algorithm to find for each of all its subsets of n-1 integers the product of its integers.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;4)Describe Sorting algorithms and their complexity - Quick sort, Insertion Sort, Merge Sort,Shell,Radix,Heap&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;If you had a million integers how would you sort them and how much memeory would that consume?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;5)Describe an alogrithm to find out if an integer is a square?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;6)How would you determine if adwords was up and running and serving contextual content ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;7)Suppose you have an NxN matrix of positive and negative integers. Write some code that finds the sub-matrix with the maximum sum of its elements.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;8)Implement division (without using the divide operator, obviously).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;9)You have a stream of infinite queries (ie: real time Google search queries that people are entering). Describe how you would go about finding a good estimate of 1000 samples from this never ending set of data and then write code for it.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-340728721947454979?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/340728721947454979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=340728721947454979' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/340728721947454979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/340728721947454979'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/googlemicrosoft-interview-questions_06.html' title='Google,Microsoft interview questions phase-2'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5486425406569035423</id><published>2007-07-06T00:47:00.000-07:00</published><updated>2007-07-07T07:57:42.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Google,Microsoft interview questions phase-1</title><content type='html'>&lt;span&gt;1)Write an algorithm for Soduku puzzle&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;2)What method would you use to look up a name in a dictionary?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;3)How would you find out if a machine's stack grows up or down in memory?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;4)Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;5) Describe the algorithm for a depth-first graph traversal.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;6)Design a class library for writing card games.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;7)You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write a the question on a card which and give it to Eve who will take the card to Bob and return the answer to you. What must you write on the card, besides the question, to ensure Bob can encode the message so that Eve cannot read your phone number?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;8)You are given a the source to a application which is crashing when run. After running it 10 times in a debugger, you find it never crashes in the same place. The application is single threaded, and uses only the C standard library. What programming errors could be causing this crash? How would you test each one?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;9)Given a number, describe an algorithm to find the next number which is prime.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;10)what is the best and worst performance time for a hash tree and binary search tree?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5486425406569035423?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5486425406569035423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5486425406569035423' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5486425406569035423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5486425406569035423'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/googlemicrosoft-interview-questions.html' title='Google,Microsoft interview questions phase-1'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1071901798050896290</id><published>2007-07-05T03:11:00.000-07:00</published><updated>2007-07-05T20:27:44.202-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>MaximumSumSubsequence Problem - implemented in Java</title><content type='html'>My Solution:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class MaxSubSequence&lt;br /&gt;{&lt;br /&gt; public static void main(String args[]) {&lt;br /&gt;  MaxSubSequence mss = new MaxSubSequence();&lt;br /&gt;  System.out.println("\n\nMax Value is "+mss.maxsubsequence(new int[]{-1,-2,-3,-4,-5,1}));&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; int maxsubsequence(int intArr[])&lt;br /&gt; {&lt;br /&gt;      int  beginIndex    = 0;&lt;br /&gt;   int  endIndex      = 0;&lt;br /&gt;   int  curValue      = intArr[0];&lt;br /&gt;   int  maxValue      = curValue;&lt;br /&gt;   int  maxBeginIndex = 0;&lt;br /&gt;   int  maxEndIndex   = 0;&lt;br /&gt;   int number = intArr.length;&lt;br /&gt;&lt;br /&gt;   for (int i = 1; i &lt; number; i++)&lt;br /&gt;   {&lt;br /&gt;    curValue += intArr[i];&lt;br /&gt;    &lt;br /&gt;    if (curValue &gt; maxValue)&lt;br /&gt;    {&lt;br /&gt;     maxValue = curValue;&lt;br /&gt;     endIndex = i;&lt;br /&gt;&lt;br /&gt;     maxBeginIndex = beginIndex;&lt;br /&gt;     maxEndIndex   = endIndex;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if (curValue &lt;= 0)&lt;br /&gt;    {&lt;br /&gt;     beginIndex = i+1;&lt;br /&gt;     endIndex   = i+1;&lt;br /&gt;     curValue   = 0;&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   System.out.print(" \n\n ");&lt;br /&gt;   for(int i=maxBeginIndex;i &lt; maxEndIndex+1;i++)&lt;br /&gt;    System.out.print(intArr[i]+" ");&lt;br /&gt;  return maxValue;&lt;br /&gt; }&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Imagine coming up with this solution on phone ... A lady called him at 10.30 PM in the night from Google's US office. So prepare well. :-) I wish you all "All The Best".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1071901798050896290?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1071901798050896290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1071901798050896290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1071901798050896290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1071901798050896290'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/maximumsumsubsequence-problem.html' title='MaximumSumSubsequence Problem - implemented in Java'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5403161050873830221</id><published>2007-07-05T00:39:00.000-07:00</published><updated>2007-07-09T02:20:23.568-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Find if a number is a "Power Of 2"</title><content type='html'>Just one line of code does everything :)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.util.*;&lt;br /&gt;class PowerOf2 &lt;br /&gt;{&lt;br /&gt; public static void main(String[] args) &lt;br /&gt; {&lt;br /&gt;  int num = 5;&lt;br /&gt;  System.out.println("Is this number power of 2? "+((num!=0)&amp;&amp;(num &amp; (num-1))==0));&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Any comments?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5403161050873830221?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5403161050873830221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5403161050873830221' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5403161050873830221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5403161050873830221'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/find-if-number-is-power-of-2.html' title='Find if a number is a &quot;Power Of 2&quot;'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3659948432215589904</id><published>2007-07-05T00:06:00.000-07:00</published><updated>2007-07-05T00:08:12.300-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Structures and Algorithms'/><title type='text'>Atoi  - implemented in Java</title><content type='html'>My Solution:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Atoi &lt;br /&gt;{&lt;br /&gt; public static void main(String[] args) &lt;br /&gt; {&lt;br /&gt;  //System.out.println("Change the value of str to see program's behavior for various inputs");&lt;br /&gt;  String str = "123.25";&lt;br /&gt;  boolean isValid = true;&lt;br /&gt;  boolean isFloat = false;&lt;br /&gt;  char ch[] = str.toCharArray();&lt;br /&gt;  int sum=0;&lt;br /&gt;  double fraction=0;&lt;br /&gt;  int count = str.substring(0,str.indexOf('.')).length();&lt;br /&gt;  int fracCount = 1;&lt;br /&gt;  for (int i=0;i&lt;ch.length;i++)&lt;br /&gt;  {&lt;br /&gt;   if(ch[i] == 46)&lt;br /&gt;   {&lt;br /&gt;    isFloat = true;&lt;br /&gt;    continue;&lt;br /&gt;   } &lt;br /&gt;   &lt;br /&gt;   if(isFloat) {&lt;br /&gt;    if(isNum(ch[i])) {&lt;br /&gt;     fraction+= (ch[i]-48)*(1/(Math.pow(10,fracCount++)));&lt;br /&gt;    } else {&lt;br /&gt;     System.out.println("Sorry .... not a valid number");&lt;br /&gt;     isValid=false;&lt;br /&gt;     break;&lt;br /&gt;    }&lt;br /&gt;    continue;&lt;br /&gt;   }&lt;br /&gt;   else {   &lt;br /&gt;    if(isNum(ch[i])) {&lt;br /&gt;     sum+= (ch[i]-48)*Math.pow(10,--count);&lt;br /&gt;    } else {&lt;br /&gt;     System.out.println("Sorry .... not a valid number");&lt;br /&gt;     isValid=false;&lt;br /&gt;     break;&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  }//end of for loop&lt;br /&gt;  if(isValid)&lt;br /&gt;  System.out.println("Value is"+(sum+fraction));&lt;br /&gt; }//end of main&lt;br /&gt;&lt;br /&gt; public static boolean isNum(char ch) {&lt;br /&gt;  if(ch&gt;=48 &amp;&amp; ch&lt;=57)&lt;br /&gt;   return true;&lt;br /&gt;  else &lt;br /&gt;   return false;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Any comments?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3659948432215589904?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3659948432215589904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3659948432215589904' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3659948432215589904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3659948432215589904'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/atoi-implemented-in-java.html' title='Atoi  - implemented in Java'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5635329240783251001</id><published>2007-07-04T23:56:00.000-07:00</published><updated>2007-07-09T02:21:14.638-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><title type='text'>A small Java program for "Array Rotation"</title><content type='html'>My Solution:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class ArrayRotate &lt;br /&gt;{&lt;br /&gt; public static void main(String[] args) &lt;br /&gt; {&lt;br /&gt;  int a[] = {1,2,3,4,5};&lt;br /&gt;  int count=0,k=0,j=0;&lt;br /&gt;  for(int i=0;i&lt;5;i++) {&lt;br /&gt;   &lt;br /&gt;   int first = a[0];&lt;br /&gt;   k=0;&lt;br /&gt;   j=0;&lt;br /&gt;   System.out.println("\n");&lt;br /&gt;   &lt;br /&gt;   while(k &lt; a.length) {&lt;br /&gt;    j++;&lt;br /&gt;    if(j &gt;= a.length) {&lt;br /&gt;     a[k] = first;&lt;br /&gt;     System.out.print(a[k]+" ");&lt;br /&gt;    } else {&lt;br /&gt;     a[k] = a[j];&lt;br /&gt;     System.out.print(a[k]+" ");&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    k++; &lt;br /&gt;   }//end of While&lt;br /&gt;&lt;br /&gt;  }//end of for loop&lt;br /&gt; }//end of function main&lt;br /&gt;}//end of class ArrayRotate&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Any Comments?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5635329240783251001?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5635329240783251001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5635329240783251001' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5635329240783251001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5635329240783251001'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/small-java-program-for-array-rotation.html' title='A small Java program for &quot;Array Rotation&quot;'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1197194132406375802</id><published>2007-07-04T23:36:00.001-07:00</published><updated>2009-09-02T19:36:42.301-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Solution for the question - "How do you find, if a machine is big endian or little endian?"</title><content type='html'>My Solution is this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;       int i = 1;&lt;br /&gt;       char *p= (char *)&amp;i;&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;       if(*p == 1)&lt;br /&gt;         printf("Little Endian");&lt;br /&gt;       else&lt;br /&gt;         printf("Big Endian");&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Any comments?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1197194132406375802?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1197194132406375802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1197194132406375802' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1197194132406375802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1197194132406375802'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/07/solution-for-question-how-do-you-find.html' title='Solution for the question - &quot;How do you find, if a machine is big endian or little endian?&quot;'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-5065994950910688876</id><published>2007-06-30T08:34:00.000-07:00</published><updated>2007-07-01T05:40:12.426-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google interview questions</title><content type='html'>One of my best friends has undergone Google interview process while I was at home during holidays. Following are his first phone interview questions. He hasn't signed on  NDA, so I can share this information with U all.&lt;br /&gt;&lt;br /&gt;1. Quick sort average and worst case time complexity &lt;br /&gt;&lt;br /&gt;Ans - Avg   -- O(nlogn)&lt;br /&gt;      Worst -- O(n^2)&lt;br /&gt;&lt;br /&gt;2. what is the value of 2^12 = 4 * 1024 = 4096&lt;br /&gt;&lt;br /&gt;3. Order the following operations - Fastest Operation - first&lt;br /&gt;&lt;br /&gt;  a. Read CPU register&lt;br /&gt;  b. Disk Seek&lt;br /&gt;  c. Context Switch&lt;br /&gt;  d. Read from main memory&lt;br /&gt;&lt;br /&gt;My Answer is - a,d,c,b&lt;br /&gt;(Correct me, If I am wrong!!!)&lt;br /&gt;4.How will you find your system is Bigendian or small endian?&lt;br /&gt;5.Reverse a singly linked list&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-5065994950910688876?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/5065994950910688876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=5065994950910688876' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5065994950910688876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/5065994950910688876'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/06/google-interview-questions_30.html' title='Google interview questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1158858696344266773</id><published>2007-06-23T01:44:00.001-07:00</published><updated>2007-07-07T08:00:34.366-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft Interview Questions</title><content type='html'>1) *&lt;span&gt;  If you had an infinite supply of water and a 5 quart and 3 quart pail, how would you measure exactly 4 quarts? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Answers -- Fill 5 quart pile using full 3 quart pile, stop when 5 quart is filled (second time), now you have 1 quart left in the 3 quart pile, empty 5 quart pile and fill it with the remaining 1 quart, and another full 3quart pile makes the 5 quart pile with 4 quart!!!!&lt;br /&gt;&lt;br /&gt;&lt;span&gt;2) if you are on a boat and you throw out a suitcase, will the level of water increase?&lt;br /&gt;&lt;br /&gt;3) On an average, how many times would you have to open the Seattle phone book to find a specific name?&lt;br /&gt;&lt;br /&gt;4) There are 3 ants at 3 corners of a triangle, they randomly start moving towards another corner. What is the probability that they don't collide?&lt;br /&gt;&lt;br /&gt;5) If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1158858696344266773?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1158858696344266773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1158858696344266773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1158858696344266773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1158858696344266773'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/06/1-if-you-had-infinite-supply-of-water.html' title='Microsoft Interview Questions'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6500126524830101439</id><published>2007-06-22T09:03:00.000-07:00</published><updated>2007-06-22T09:06:24.389-07:00</updated><title type='text'>Let us Rank</title><content type='html'>&lt;span style="font-weight:bold;"&gt;what is your Dream company ??????????????????????&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hii&lt;br /&gt;please quote your dream company as a comment so that we can rank the company present in the hearts of the many people..&lt;br /&gt;&lt;br /&gt;Thank you&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6500126524830101439?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6500126524830101439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6500126524830101439' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6500126524830101439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6500126524830101439'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/06/let-us-rank.html' title='Let us Rank'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-1908554735539853104</id><published>2007-06-21T22:07:00.000-07:00</published><updated>2007-06-21T22:11:13.434-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Question regarding a string Class</title><content type='html'>&lt;span style="font-weight:bold;"&gt;1)What do you need when you instantiate a string&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2)What is the best and worst time for the operation 'equals'&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;3)How do you spedup the 'equals' operation&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-1908554735539853104?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/1908554735539853104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=1908554735539853104' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1908554735539853104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/1908554735539853104'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/06/question-regarding-string-class.html' title='Question regarding a string Class'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-6462297253686262525</id><published>2007-06-21T22:04:00.000-07:00</published><updated>2007-06-21T22:07:48.390-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>what is the best and worst performance time for a hash tree and binary search tree?</title><content type='html'>&lt;span style="font-weight:bold;"&gt;what is the best and worst performance time for a hash tree and binary search tree? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Answer: Best is O(c), worst is O(log n)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-6462297253686262525?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/6462297253686262525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=6462297253686262525' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6462297253686262525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/6462297253686262525'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/06/what-is-best-and-worst-performance-time.html' title='what is the best and worst performance time for a hash tree and binary search tree?'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-3092518418414902682</id><published>2007-06-10T12:34:00.000-07:00</published><updated>2007-06-10T12:39:56.056-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Order the functions in order of their asymptotic performance</title><content type='html'>Order the functions in order of their asymptotic performance &lt;br /&gt;&lt;br /&gt;  1) 2^n&lt;br /&gt;  2) n^Googol ( 10^100)&lt;br /&gt;  3) n!&lt;br /&gt;  4) n^n&lt;br /&gt;&lt;br /&gt;Answer: &lt;br /&gt;1)n^(whatever constant) &lt;br /&gt;2)2^n&lt;br /&gt;3)n! (==&gt; n^n / e^n )&lt;br /&gt;4)n^n&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-3092518418414902682?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/3092518418414902682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=3092518418414902682' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3092518418414902682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/3092518418414902682'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/06/google-interview-questions.html' title='Order the functions in order of their asymptotic performance'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9179416692752405527.post-8779493643613654455</id><published>2007-06-10T11:51:00.000-07:00</published><updated>2009-09-02T19:13:26.859-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sun Microsystems'/><category scheme='http://www.blogger.com/atom/ns#' term='Adobe'/><category scheme='http://www.blogger.com/atom/ns#' term='Sasken'/><category scheme='http://www.blogger.com/atom/ns#' term='Interviews'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><category scheme='http://www.blogger.com/atom/ns#' term='Yahoo'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='DEShaw'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Structures and Algorithms'/><title type='text'>Tips, tricks and questions to crack Microsoft, Yahoo and Google  programming interviews</title><content type='html'>Hope the information presented here will help you all in cracking Microsoft, Yahoo and Google  interviews. The one and only way to crack these interviews is to prepare well and be confident during the interviews. They are stressing very much on Data Structures and Algorithms during interviews. Prepare well and read out the code to them during interviews, they will be happy and you will have a high paying job!!!&lt;br /&gt;&lt;br /&gt;I wish you good luck!!!&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Calvin&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9179416692752405527-8779493643613654455?l=programminginterviews.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminginterviews.blogspot.com/feeds/8779493643613654455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9179416692752405527&amp;postID=8779493643613654455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8779493643613654455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9179416692752405527/posts/default/8779493643613654455'/><link rel='alternate' type='text/html' href='http://programminginterviews.blogspot.com/2007/06/tips-tricks-and-questions-to-crack.html' title='Tips, tricks and questions to crack Microsoft, Yahoo and Google  programming interviews'/><author><name>Calvin &amp;amp; Hobbes</name><uri>http://www.blogger.com/profile/09037125265823005782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://3.bp.blogspot.com/_OqJSfb-FKts/SMcucQC4ctI/AAAAAAAAAEk/lp1Mct8Yjro/S220/n565991099_453847_7822.jpg'/></author><thr:total>0</thr:total></entry></feed>
