tag:blogger.com,1999:blog-69822356004663239802019-11-09T05:26:57.270-08:00Puzzles in Job InterviewsBest Puzzles asked in Job Interviews and their solutions. Huge and wise online repository of riddles and questions asked in technical, management, software, aptitude, stress and programming rounds. JobPuzzles.com is often called a paradise for people preparing for MNCs like Google, Microsoft, Facebook, Adobe, Symantec, Expedia, TCS, Dell, Amazon etc. Our Plan for you -> Dream MNCs. Be Prepared @JobPuzzles . Get Selected. Do like the FB Page/Group for the Learners Consortium. www.w3lc.comMohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.comBlogger52125tag:blogger.com,1999:blog-6982235600466323980.post-47050297402402195272018-05-10T00:36:00.000-07:002018-05-10T00:38:56.058-07:00What is a number whose cube is equal to the number itself but its square is not equal to the number itself<div dir="ltr" style="text-align: left;" trbidi="on">Answer:<br /><br />It is always good if you solve first by your own.<br /><br /><br /><br />x3=xx3=x<br /><br />Subtract x2x2 from both sides to get:<br /><br />x3−x2=−x2+xx3−x2=−x2+x<br /><br />x(x2−x)=−1(x2−x)x(x2−x)=−1(x2−x)<br /><br />Now, we know that x2x2 is not equal to xx, which means x2−xx2−x is not equal to zero. So, it’s safe to divide both sides by x2−xx2−x :<br /><br />x=−1<br /><br /><br /><br />So, the answer is -1.<br /><br /><br /><br />Here, it was a key that since x and x square are not equal, x square - x can be cut from both sides of the equation. This results in x as minus 1 as the answer.<br /><br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com0tag:blogger.com,1999:blog-6982235600466323980.post-87654518016300219892017-10-22T00:18:00.000-07:002017-10-22T00:18:11.346-07:00Security is our duty and we shall deliver it<div dir="ltr" style="text-align: left;" trbidi="on">"Security is our duty and we shall deliver it" - This slogan was given by Mohd Anwar Jamal Faiz as a part of his Whitepaper first published on W3Lc.com, Slideshare and LinkedIn.<br /><br />Description of paper:<br />Quality Management, Information Security, Threat Hunting and Mitigation Plans for a Software Company or a Technology Start-up engaged in building, deploying or consulting in Software and Internet Applications.<br /><br />Read - World Wide web Learners Consortium - W3LC<br /><a href="http://www.w3lc.com/2017/10/security-is-our-duty-and-we-shall.html" target="_blank">http://www.w3lc.com/2017/10/security-is-our-duty-and-we-shall.html</a><br /><br />This paper could be best described in following words-<br /><br /><i>Quality Management, Information Security, Threat Hunting and Mitigation Plans for a Software Company or a Technology Start-up engaged in building, deploying or consulting in Software and Internet Applications.</i><br /><br /><br /><b>The chief sections of the document would be:</b><br /><br /><ol style="text-align: left;"><li>Introduction to Enterprise Risk & Cyber Security</li><li>The technologies we employ in</li><li>Types of Software testing</li><li>Some examples of Cyber Security Firms and what they do</li><li>How we achieve a secure product</li><li>InfoSec and Managed Security Service Provider</li><li>Training and development</li><li>Safeguarding against Phishing and Multi-Factor Authentication</li><li>Threat hunting, mitigation and Vulnerability Management</li><li>The denouement </li></ol><br /><br />You can read and download the article from:<br /><a href="https://www.slideshare.net/toughjamy/security-is-our-duty-and-we-shall-deliver-it-white-paper" target="_blank">https://www.slideshare.net/toughjamy/security-is-our-duty-and-we-shall-deliver-it-white-paper</a><br /><br />Read on LinkedIn:<br />https://www.linkedin.com/pulse/security-our-duty-we-shall-deliver-mohd-anwar-jamal-faiz/<br /><br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com10tag:blogger.com,1999:blog-6982235600466323980.post-25100034406628038652017-03-31T20:34:00.001-07:002017-03-31T21:29:38.444-07:00Sabzi Taala Chaabi... Your but others use !<p dir="ltr">इसका जवाब दो,<br>तो मानेंगे whatsapp King: 👍</p><p dir="ltr">Its a Challenge.....😉. <br>      समय लिमिट ⏳: 1 घंटा 🕛</p><p dir="ltr">आपको अगर नहीं पता तो सबको forward करो और जानने की कोशिश करो.</p><p dir="ltr">इन सवालों के जवाब दीजिये...!!</p><p dir="ltr">1. बताओ वो कौन सी सब्ज़ी है जिस में ताला और चाबी दोनों आते हैं ? बताओ क्या है</p><p dir="ltr">2. ऐसी कौन सी चीज है जो है तो तुम्हारी, पर उसे दूसरे लोग इस्तेमाल करते हैं ?</p><p dir="ltr">3. वो कौन सा काम है जो 1 आदमी अपनी पूरी ज़िंदगी में 1 बार करता है, पर वही काम 1 औरत रोज़ करती है? बताओ क्या?</p><p dir="ltr">4. परिवार हरा हम भी हरे; एक थैली में तीन - चार भरे। बताओ क्या ?</p><p dir="ltr">👍👍👍 best of luck </p><p dir="ltr">3 No.सवाल का उत्तर सिर्फ बुद्धिमान ही दे सकते है। देखते है अपने ग्रुप में कितने बुद्धिमान है</p><p dir="ltr">जवाब भेजे, <br>ग्रुप वालो थोड़ा दिमाग लगाओ,<br>यह मुश्किल नही, आसान है ।</p><p dir="ltr"><a href="http://Www.JobPuzzles.com">Www.JobPuzzles.com</a></p><p dir="ltr"><b>Answer:</b></p><p dir="ltr">1.   Laukey   ( lock + key )</p><p dir="ltr">2. Naam ( hota aapka hai. Lekin pukarte doosre log hain )</p><p dir="ltr">3. Mard shadi karte hue sindoor bharta hai.   Phir aurat roz roz maang bharti hain. 😝</p><p dir="ltr">4. Balki sahi to hoga ki ek thaili me 6-7 bhare hote hain. Answer is Matar. Matar ki sabzi.<br><br></p>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com0tag:blogger.com,1999:blog-6982235600466323980.post-22729078465783772732016-09-06T23:47:00.003-07:002016-09-06T23:47:54.045-07:00 Birthday Box Puzzle : Girl on her birthday deposits 250 rupees. Sister on her birthday takes 50<div dir="ltr" style="text-align: left;" trbidi="on">Puzzle #81:<br />Birthday box puzzle<br /><br /><br />एक लडकी ने 20 साल कि उम्र मे एक बॉक्स खरीदा<br />वो अपने हर जन्मदिन पर ऊसमे Rs.250 डाल देती<br />और उसकी बहन ऊसमे से Rs.50 अपने हर जन्मदिन पर<br />निकाल लेती। अगर लडकी कि death 60 साल मेँ हुई।<br /><br />जब बाक्स खुला तो उसमे से सिर्फ Rs.500 निकले। कैसे ??<br /><br />Www.jobpuzzles.com</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com0tag:blogger.com,1999:blog-6982235600466323980.post-5420783722675261542014-12-04T19:38:00.000-08:002014-12-04T19:38:33.572-08:00Top List of Programming Interview Puzzles. Code Solution<div dir="ltr" style="text-align: left;" trbidi="on">Following list of programming puzzles and solution (MUST). This list has been prepared with my own voyage through various interviews at Microsoft, Symantec, Google, Adobe and Expedia etc. I have also been in talks with several friends of mine. And following is the list of top problems that seem to be asked in interviews.<br /><br /><br /><br />Write a function to get the intersection point of two Linked Lists.<br />There are two singly linked lists in a system. By some programming error the end node of one of the linked list got linked into the second list, forming a inverted Y shaped list. Write a program to get the point where two linked list merge.<br /><br />--> http://www.geeksforgeeks.org/write-a-function-to-get-the-intersection-point-of-two-linked-lists/<br /><br /><br /><br />Lowest Common Ancestor in a Binary Search Tree.<br />Given values of two nodes in a Binary Search Tree, write a c program to find the Lowest Common Ancestor (LCA). You may assume that both the values exist in the tree.<br /><br />--> http://www.geeksforgeeks.org/lowest-common-ancestor-in-a-binary-search-tree/<br /><br /><br /><br />String matching where one string contains wildcard characters<br />Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns true if the two strings match. The following are allowed wild card characters in first string.<br /><br />--> http://www.geeksforgeeks.org/wildcard-character-matching/<br /><br /><br /><br />Anagram Substring Search (Or Search for all permutations)<br />Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] and its permutations (or anagrams) in txt[]. You may assume that n > m. Expected time complexity is O(n)<br /><br />--> http://www.geeksforgeeks.org/anagram-substring-search-search-permutations/<br /><br /><br /><br />Inorder Tree Traversal without recursion and without stack!<br />Using Morris Traversal, we can traverse the tree without using stack and recursion. The idea of Morris Traversal is based on Threaded Binary Tree. In this traversal, we first create links to Inorder successor and print the data using these links, and finally revert the changes to restore original tree.<br /><br />--> http://www.geeksforgeeks.org/inorder-tree-traversal-without-recursion-and-without-stack/<br /><br /><br /><br />Print all possible strings of length k that can be formed from a set of n characters<br />Given a set of characters and a positive integer k, print all possible strings of length k that can be formed from the given set.<br /><br />--> http://www.geeksforgeeks.org/print-all-combinations-of-given-length/<br /><br /><br /><br />Print all possible combinations of r elements in a given array of size n<br />Given an array of size n, generate and print all possible combinations of r elements in array. For example, if input array is {1, 2, 3, 4} and r is 2, then output should be {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4} and {3, 4}.<br /><br />--> http://www.geeksforgeeks.org/print-all-possible-combinations-of-r-elements-in-a-given-array-of-size-n/<br /><br /><br /><br />Check if a number is Palindrome<br />Given an integer, write a function that returns true if the given number is palindrome, else false. For example, 12321 is palindrome, but 1451 is not palindrome.<br /><br />--> http://www.geeksforgeeks.org/check-if-a-number-is-palindrome/<br /><br /><br /><br />Data Structure for Dictionary and Spell Checker?<br />Which data structure can be used for efficiently building a word dictionary and Spell Checker?<br /><br />--> http://www.geeksforgeeks.org/data-structure-dictionary-spell-checker/<br /><br /><br /><br /><br />Count number of binary strings without consecutive 1’s<br />Given a positive integer N, count all possible distinct binary strings of length N such that there are no consecutive 1’s.<br /><br />--> http://www.geeksforgeeks.org/count-number-binary-strings-without-consecutive-1s/<br /><br /><br /><br />Shortest path with exactly k edges in a directed and weighted graph<br />Given a directed and two vertices ‘u’ and ‘v’ in it, find shortest path from ‘u’ to ‘v’ with exactly k edges on the path.<br /><br />--> http://www.geeksforgeeks.org/shortest-path-exactly-k-edges-directed-weighted-graph/<br /><br /><br /><br />Count all possible walks from a source to a destination with exactly k edges<br />Given a directed graph and two vertices ‘u’ and ‘v’ in it, count all possible walks from ‘u’ to ‘v’ with exactly k edges on the walk.<br /><br />--> http://www.geeksforgeeks.org/count-possible-paths-source-destination-exactly-k-edges/<br /><br /><br /><br />--Take Care<br />And Best Of Luck :)<br />Anwar Jamal<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com1tag:blogger.com,1999:blog-6982235600466323980.post-67101000864701544392014-06-21T06:38:00.004-07:002014-06-21T06:38:43.230-07:00Highest floor fall - Eggs not break Puzzle. It is a 100 floor building.<div dir="ltr" style="text-align: left;" trbidi="on"><br /><br />The Puzzle:<br /><br />Determine the highest floor on a 100 floor building from which an egg may be dropped without breaking.<br /><br />You are given two identical eggs, which you can drop from various floors of the building, to carry out your test.<br /><br />Assume that, if the egg doesn't break after being dropped, it may be reused without suffering any loss of quality.<br />But if both eggs break before you have determined the highest floor, then you are over.<br /><br />Find what is the least number of times you must drop the eggs in order to determine the highest floor?<br /><br /><br /><br />Our Solution:<br /><br />The answer is: 14<br /><br />You drop the first egg from the 14th floor.<br />If it breaks, you can then determine the highest floor by dropping the second snooker ball no more than 13 times.<br />The above process would be to drop it from the 1st floor, and if it doesn't break, drop it from the 2nd floor, and if it still doesn't break, drop from the 3rd, etc<br />Hence, 13+1=14 chances<br /><br /><br />However, if the first egg survives the drop from the 14th floor, you then drop it from the 27th floor (14 + 13 = 27).<br />If it breaks, you can complete your test in no more than 12 drops with the second ball by dropping it between the floors 15 to 26.<br /><br />Then, If from the 27th floor the first ball still doesn't break, the next floor to drop it from is the 39th (14 + 13 + 12 = 39).<br />If it breaks, drop the second ball from floors 28 to 38 (max 11 drops).<br /><br />after the 39th floor should be the 50th floor (14+13+12+11),<br />then the 60th floor (14+13+12+11+10), and so on.<br /><br />If the first ball survives 11 drops, you will be on the 99th floor. In that case, it only takes one more drop to complete the whole test.<br /><br /><br /><br />So, this solves the puzzle.<br /><br /><br />Oh! stop. Think again!!!<br />You have just verified that 14 is the right answer. But how did one reached that answer?<br />Think again!!</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com3tag:blogger.com,1999:blog-6982235600466323980.post-6876839935341784082014-06-21T06:31:00.000-07:002014-06-21T06:31:19.787-07:00String around the Earth circumference Puzzle. If add some length how much hight it rises?<div dir="ltr" style="text-align: left;" trbidi="on"><br /><br />The Puzzle:<br /><br />The circumference of the Earth is approximately 40,000 km. There is a string circles the Earth, touching the ground at all locations.<br />Now if you add just 10 meters to its length, How far will it rise above the ground.<br /><br />I know your guess would be that it will still graze the surface of earth. The raise would be infinitesimally small. But think again that could a fly,<br />an ant, or a man squeeze underneath it.<br /><br /><br /><br />Solution:<br />Let p be Pi=3.14159<br />Use the formula Circumference = 2 × p × R<br /><br />Before Circumference = 2 × p × R<br />After Circumference + 10m = 2 × p × (R + Gap)<br /><br />Subtracting the two:<br />10m = 2 × p × Gap<br /><br />So, the Gap = 10m / (2 × p) = 1.6m approximately<br /><br />So, a man could fit under it easily.<br /><br /><br />Voila!! This is amazing discovery. </div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com4tag:blogger.com,1999:blog-6982235600466323980.post-45607757167161355632014-06-21T06:22:00.001-07:002014-06-21T06:22:12.286-07:009999=4 8888=8 1919=? Numerical Counting Puzzle<div dir="ltr" style="text-align: left;" trbidi="on"><br /><br />Now there is a puzzle, which will shake you:<br />9999=4<br />8888=8<br />1816=3<br />1212=0<br />1919=?<br />Solve the puzzle.<br /><br /><br />Solution:<br />The puzzle needs you to calculate the number of circles in the numbers.<br /><br />For instance - 9 has one circle in it. And then 8 has 2<br /><br />Hence see as below:<br />9999=4 (each 9 has 1 circle)<br />8888=8 (each 8 has 2 circles so 2 x 4 = 8)<br />1816=3 (8 has one circle and 6 has 1 so 2)<br />1212=0 (no circles in 1 & 2)<br />Hence, 1919=2 ( 2 circles of the number 9)<br /><br /><br />I have also seen another solution. THough not a clean one, but still the logic doesnot smells so foul:<br />See, sum of 9999 is equal to 4. Therefore, each 9 is equivalent to 1.<br />See 1212 is equal to 0. So 1 and 2 are equivalent to 0.<br />Therefore, 1919 is (0+1+0+1), so it is equivalent to 2.<br /><br /><br />--Enjoy<br /><br /><br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com6tag:blogger.com,1999:blog-6982235600466323980.post-68622149855727791002014-05-22T03:31:00.003-07:002014-05-22T03:50:39.906-07:009-5+5*0+3 simple Bodmas Illusion!!<div dir="ltr" style="text-align: left;" trbidi="on">I call this problem of 9-5+5*0+3 as a simple Bodmas Illusion!!<br /><br />Like asking a grown up to recite nursery rhymes will cause him liitle efforts. But its not that he cannot do so or he has grown lesser in knowledge. It's just you forgot because you are not doing that often. And, then comes perception. Ideas on which you have not worked recently, and have only heard buzz words, will be not in much terms with you - Even if you believe you know it well. That's perception or simply I-Know-That-Stuff-Well syndrome. For instance just ask yourself how well you know about Big data or NLP or AWS or even cloud computing in that sense. Lol ;)<br /><br />In the similar vein, I post you a simple puzzle today. What do you feel is answer to :<br /><br />9 - 5 + 5 x 0 + 3 = ?<br /><br /><br />I myself posed this question over my WhatsApp group and found many giving correct answer. But I was amazed by many who gave wrong. Here, I am not talking about some completely vague answers like 0, 10 and 90. You won't imagine, I even had these responses. Yes! That's true!!<br /><br /><br />In any case, the most preferred answers were 1 and 7. To your surprise, 1 received the largest share of vote. However, the correct answer is 7.<br /><br />People who came with 1 as answer did following:<br />Equation: 9-5+5x0+3=...? I believe the answer is 1, is that correct?<br />5x0=0<br />5+3=8<br />9-8=1<br /><br />And, yes the keyword that they stood by was BODMAS Rule.<br /><br /><br />However, the correct answer being 7, needs other explanation. And, in any sense it should not violate Bodmas as well. You know its hard to shun whatever you learnt in childhood. God! Why don't we learn to love and love and love...<br /><br />Anyways, the workflow for the correct answer is as follows;<br />5*0 is 0<br />So it becomes, 9-5+0+3<br />ie. 9-5+3<br />In algebra what we follow, we do arithmetic by the rule of BODMAS. But here, by bodmas it does not mean 9-(5+3). So, 1.<br />No, No. 1 is wrong answer. Because what we assumed here is an imaginary bracket, which never existed. Look, now you must have started feeling why the post is termed to be as Bodmas Illusion!!<br /><br />In algebraic calculations and closed group mathematics which the world follows, we practice Right to left arithmetic. So even if you add first, it is -5+3 which is -2. At last 9-2 gives 7.<br /><br />Or simply, 9-5+3 by right to left gives 4+3 hence 7.<br /><br />Had the puzzle been so simple, it would have not come in my post. You can even type "9-5+5*0+3" on Google to see what it calculates.<br /><br />Voila!!<br />Someone has learnt Bodmas again!!<br />@www.jobpuzzles.com</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com4tag:blogger.com,1999:blog-6982235600466323980.post-25137026418220415332013-10-08T06:50:00.001-07:002013-10-09T04:11:38.411-07:00ten friends 10 apple.. but 1 remain in basket<div dir="ltr" style="text-align: left;" trbidi="on">Travelling in bus. Sitting near window. Enjoying weather.<br />But its a puzzle time for u all...<br /><br /><br />You have a basket containing ten apples. You have ten friends and each desire an apple. You give each of your friends one apple. After a few minutes each of your friends has one apple each, yet there is an apple remaining in the basket.How?<br /><br /><br />From www.jobpuzzles.com<br /><br />(for answer check again after atleast 24 hours. In case u think u hit an answer..pls post)</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com6tag:blogger.com,1999:blog-6982235600466323980.post-49779468628401353522013-10-08T06:44:00.001-07:002013-10-09T04:12:59.760-07:00city name... soap fruit city bird face student<div dir="ltr" style="text-align: left;" trbidi="on">Solve this word game puzzle.<br /><br />1. I am a 11 letter Indian city.<br />2. Last 6 letters is fruit name.<br />3. 7,8,3 letters is a bird name.<br />4. 6,7,5,3 is an organ in the face.<br />5. 1,8,3 is used 4 studnt<br />6. 9,5,3 is a soap name<br /><br />101% brain work.<br /><br />From www.jobpuzzles.com<br /><br />Answer: it would be better to solve first.<br />But in case you are so eager then *********For answer scroll down....<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />Correct Answer: Pondicherry</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com1tag:blogger.com,1999:blog-6982235600466323980.post-17537077641378663302013-08-30T05:37:00.000-07:002013-08-30T05:37:54.566-07:00Box Having Defective Balls. 10 Box 1 Chance.<div dir="ltr" style="text-align: left;" trbidi="on"><strong></strong>You have been provided with 10 boxes. Each are full of balls and each ball weighs 10 gm.<br /><br />One of these box has all defective balls. That is each ball in that box is of 9 gm.<br /><br />You are also given a weighing machine. It is a digital electronic machine that shows weight of howsoever numebr of balls kept on it. That is if you put 'n' balls on it, it will tell you the total weight of n balls. And machine is big enough to accomodate any number of balls.<br /><br />You have only one chance to weigh.<br /><br />How will you find the box that is defective balls container.</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com3tag:blogger.com,1999:blog-6982235600466323980.post-36636657356044711712013-08-30T05:27:00.004-07:002013-08-30T05:27:34.612-07:00Moving Ants in Triangluar spiral - Classic Puzzle<div dir="ltr" style="text-align: left;" trbidi="on">There are three ants.<br /><br />They are sitting on the three corners of an equilateral triangle.<br /><br />If each ant randomly picks a direction. And start moving along the edge.<br /><br />What is the probability that no two ants collide?</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com3tag:blogger.com,1999:blog-6982235600466323980.post-23688016082291737462013-08-30T05:24:00.001-07:002013-08-30T05:24:52.791-07:00100 Prisoners - Set Free or Hanged Challenge<div dir="ltr" style="text-align: left;" trbidi="on">Suppose there are 100 prisoners. They all are in the prison in solitary cells. The jailor/admin of the prison offered them a challenge. He says that he will put one prisoner per day, selected randomly into a special room with a light bulb and a switch which controls the bulb.<br /><br />A prisoner can be selected more than once.<br />No other prisoners can see or control the light bulb.<br />The prisoner in the special room can either turn on the bulb, turn off the bulb or do nothing.<br /><br />On any good day the prisoners can feel winning and stop this process and say that every prisoner has been in that special electrical room at least once.<br /><br />If that happens to be true, all the prisoners will be set free. But if it is false, then all the prisoners will be executed.<br /><br />What should the prisoners do to win the challenge and come out!!<br />(PS: Police should take ownership that they wont do the crime again. Hehehe) </div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com1tag:blogger.com,1999:blog-6982235600466323980.post-26540257710837774792013-08-30T05:20:00.000-07:002013-08-30T05:20:28.277-07:00Generate random 7 from random 5<div dir="ltr" style="text-align: left;" trbidi="on"><strong></strong>Write a function to generate a random number between 1 and 7. You have been given a function that generates a random number between 1 and 5. The distribution between each of the numbers must be uniform.<br /><br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com5tag:blogger.com,1999:blog-6982235600466323980.post-12016917068677544012013-08-30T05:18:00.000-07:002013-08-30T05:18:57.605-07:00Bird Running Between Trains - Classic Puzzle<div dir="ltr" style="text-align: left;" trbidi="on">It is a classic Puzzle. And it can be seen all over the internet. <br /><br />A train leaves City X for City Y at 15 mph. Same instant, another train leaves City Y for City X at 20 mph on the same track. (There will be an accident. Huh...)<br /><br />At the same moment, there is a bird that was sitting on the engine of train at city X. It leaves the train and flies towards the City Y train at 25 mph. When the bird reaches the train from City Y, it immediately reverses its direction.<br /><br />It then continues to fly at the same speed towards the train from City X, when it reverses its direction again, and so forth. The bird continues to do this until the trains collide. How far would the bird have traveled in the entire to and fro journey.</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com2tag:blogger.com,1999:blog-6982235600466323980.post-51480081066986337662013-08-30T04:31:00.000-07:002013-08-30T04:31:31.794-07:00Bridge Crossing - Different Speed - 1/2/7<div dir="ltr" style="text-align: left;" trbidi="on">There are Four persons. They need to cross a rickety bridge at night.<br /><br />They have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge.<br /><br />Each person takes different time to cross bridge. Times for each person are 1 min, 2 mins, 7 mins and 10 mins.<br /><br />What is the shortest time needed for all four of them to cross the bridge?</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com2tag:blogger.com,1999:blog-6982235600466323980.post-54794131145622910302013-08-30T03:54:00.003-07:002013-08-30T03:54:49.547-07:00Atleast One Husband is Cheating!!<div dir="ltr" style="text-align: left;" trbidi="on">A certain community comprises of 100 married couples only. Everyone lives with the following rule:<br /><br />1. If a husband cheats on his wife, the husband is executed as soon as his wife finds out about him.<br />2. All the women only gossip about the husbands of other women.<br />3. No woman ever tells another woman if her husband is cheating on her. <br />So every woman knows about all the cheating husbands in the town except her own.<br /><br />(It can also be assumed that a husband remains silent about his infidelity. )<br /><br />One day, the leader of that small society/community announces that there is at least one cheating husband in the town.<br /><br />What do you think happens?</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com3tag:blogger.com,1999:blog-6982235600466323980.post-27811376419459054662013-03-12T06:33:00.000-07:002013-03-12T06:33:46.961-07:00New Technical Terminology Puzzle - JobPuzzles.Com<div dir="ltr" style="text-align: left;" trbidi="on">Question:<br />Everyone around wants to use me.<br />Everyone wants to share things with me.<br />I will make them there things delivered anywhere.<br />Earlier also they had people similar to me, but they were kept close.<br />I am far, and not close.<br />Yet everyone wants me.<br />Who am I??<br /><br />Answer:<br />I will post later. This is easy<br />Anyone???</div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com3tag:blogger.com,1999:blog-6982235600466323980.post-4823755453566861412013-03-12T06:30:00.001-07:002013-03-12T06:30:07.614-07:00Set HSB of Unsigned Integer Zero<div dir="ltr" style="text-align: left;" trbidi="on"><br /><div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: 13.5pt; vertical-align: baseline;"><span style="font-family: Georgia, serif; font-size: 9pt;">On My one of the Interview Stint with Adobe, I read a programming or technical puzzle by Mr. Denis Zabavchik</span><span style="font-family: Georgia, serif; font-size: 9pt; line-height: 13.5pt;">I have also been recommended this puzzle by my seniors presently scattered in Sunny Vale, Palo Alto, and Bangalore.</span></div><div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: 13.5pt; vertical-align: baseline;"><span style="font-family: Georgia, serif; font-size: 9pt;">The question is to set the highest significant bit of an unsigned integer to zero. You are intended to write a macro for that. Comeon, Techies. Get the Job Done!!</span></div><div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: 13.5pt; vertical-align: baseline;"><span style="font-family: Georgia, serif; font-size: 9pt;"><br /></span></div><div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: 13.5pt; vertical-align: baseline;"><span style="font-family: Georgia, serif; font-size: 9pt;">Solution:</span></div><div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: 13.5pt; vertical-align: baseline;"><span style="font-family: Georgia, serif; font-size: 9pt;"> </span><span style="font-family: Georgia, serif; font-size: 9pt;">#define Set_HSB_ZERO(h) \</span><span style="font-family: Georgia, serif; font-size: 9pt;"> </span><span style="font-family: Georgia, serif; font-size: 9pt;"><br />(h&=(h>>1)|(h>>2), \</span><span style="font-family: Georgia, serif; font-size: 9pt;"> </span><span style="font-family: Georgia, serif; font-size: 9pt;"><br />h|=(h>>2), \</span><span style="font-family: Georgia, serif; font-size: 9pt;"> </span><span style="font-family: Georgia, serif; font-size: 9pt;"><br />h|=(h>>4), \</span><span style="font-family: Georgia, serif; font-size: 9pt;"> </span><span style="font-family: Georgia, serif; font-size: 9pt;"><br />h|=(h>>8), \</span><span style="font-family: Georgia, serif; font-size: 9pt;"> </span><span style="font-family: Georgia, serif; font-size: 9pt;"><br />h|=(h>>16))<o:p></o:p></span></div><div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: 13.5pt; vertical-align: baseline;"><span style="font-family: Georgia, serif;"><span style="font-size: 12px;">Smile!!</span></span></div><div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: 13.5pt; vertical-align: baseline;"><span style="font-family: Georgia, serif; font-size: 9pt;"><br /></span></div></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com2tag:blogger.com,1999:blog-6982235600466323980.post-52810803069172072392013-03-12T06:23:00.002-07:002013-03-12T06:23:29.526-07:00Little House, All Alone, Break Wall to Live : Classic riidle<div dir="ltr" style="text-align: left;" trbidi="on"><br />Now there is one childish Riddle.<br />Who knows you get to answer this at certain interviews. Technically because your interviewers might be reading this Website. :)<br /><br />Question:<br />I have a little house in which I live all alone.<br />It has no doors and windows.<br />And if I want to go out I must break through the wall.<br />Though I am living in my house, but for actual living I have to go out!!<br />Who am I??<br /><br />Answer:<br />It is chicken before birth. Living in Egg.:)<br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com0tag:blogger.com,1999:blog-6982235600466323980.post-83856830493761463372013-03-12T06:17:00.003-07:002013-03-12T06:17:43.047-07:00Solution to Seven Pieces, Two Cuts - Gold Puzzle at JobPuzzles.Com<div dir="ltr" style="text-align: left;" trbidi="on"><br />This post is Solution to Seven Pieces, Two Cuts - Gold Puzzle at JobPuzzles.Com<br />For question Refer to :<br /><a href="http://job-puzzles.blogspot.in/2013/03/seven-pieces-two-cuts-gold-bar-puzzle.html">Original 7 Piece 2 Cuts Gold Bar Paying Problem at JobPuzzles.Com</a><br /><br />What you can do is to divide the 7 piece gold bar to make a piece of following sizes:<br />-->1 part (Say A)<br />-->2 part (Say B)<br />You have used your two cuts, that you were allowed to do<br />--> third will be automatically of 4 parts (Say C)<br /><br />And now you can pay him at end of each day by help of these divided parts.<br />For eg.<br />On First Day--> Give A<br />On Second Day--> Take A give B<br />On Third Day--> Give A<br />On Fourth Day--> Take A and B, and give C<br />..<br />..<br />Now you know the answer. So complete it.<br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com1tag:blogger.com,1999:blog-6982235600466323980.post-34288974782488763322013-03-12T06:15:00.001-07:002013-03-12T06:15:40.503-07:00Pointer Arithmetic Interview Puzzle at Job Puzzles.Com<div dir="ltr" style="text-align: left;" trbidi="on"><br />Pointer Arithmetic Question for technical interviews.<br />I am also giving solution to this, but it is adviced to see the solution only after trying for sometime.<br /><br />Question: What will be the output of following code and how.<br /><br />void main()<br />{<br />int *p,*q;<br />p=(int *)40;<br />q=(int *)60;<br />printf("%d\n",q-p);<br />}<br /><br /><br />Answer:<br />It is 6-40=20<br />and then 20/2 =10<br />Think How!!<br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com1tag:blogger.com,1999:blog-6982235600466323980.post-687716164154129672013-03-12T06:04:00.005-07:002013-03-12T06:19:19.197-07:00Seven Pieces, Two Cuts - Gold Bar Puzzle<div dir="ltr" style="text-align: left;" trbidi="on"><br />You have engaged someone for seven days for some work. And, you have a gold bar to pay him.<br />(God!! what is that work?? Anways that is not my puzzle!!)<br /><br />The gold bar is divided into seven connected pieces. That is you can easily break them in seven equal pieces, but still they are loosely joined.<br />You have to pay him a piece of gold at the end of every day.<br /><br />Question: You can make only two breaks in the gold bar. Then how will you pay him.<br /><br />Answer:<br />I have dedicated another post for the solution.<br /><a href="http://job-puzzles.blogspot.in/2013/03/solution-to-seven-pieces-two-cuts-gold.html">Solution to the 7 Pieces 2 Cuts Gold Bar Paying Problem at "Puzzles in Job Interviews"</a><br />First think and try to solve before jumping to the answer.<br /><br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com6tag:blogger.com,1999:blog-6982235600466323980.post-76049984740701138292013-03-12T05:59:00.001-07:002013-03-12T05:59:26.019-07:00Not Tells, Not Knows, Not Wants - what???<div dir="ltr" style="text-align: left;" trbidi="on">Tickling Riddle:<br /><br />You will be amazed to know that this Puzzle which has been around over the internet, has been asked by one candidate appearing for a Financial High Profile Job Function.<br /><br />Question:<br /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">One who has it does not tell it. </span><br /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">One who takes it does not know it. </span><br /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">One who knows it does not want it. </span><br /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">What is that??</span><br /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;"><br /></span><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">Answer:</span><br /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">Its Money!!</span><br /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;"><br /></span><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">Confused? I am also Kidding. It is Counterfeit Money!!</span><br /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 14px;">Satisfied!</span><br /><br /></div>Mohd Anwar Jamal Faizhttp://www.blogger.com/profile/01684801075444232559noreply@blogger.com1