﻿<?phpxml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
<title>Common Interview Questions / CodeGuru / All</title>
<link>http://commoninterview.com</link>
<description>The source for Job Interview Questions and Job Search Networking</description>
<pubDate>Thu, 19 Aug 2010 01:32:11 -0600</pubDate>
<language>en</language>
<item>
<title><![CDATA[Name seven of the most common sorting algorithms]]></title>
<link>http://commoninterview.com/Testing_Interview_Questions/name-seven-of-the-most-common-sorting-algorithms/</link>
<comments>http://commoninterview.com/Testing_Interview_Questions/name-seven-of-the-most-common-sorting-algorithms/</comments>
<pubDate>Thu, 19 Aug 2010 01:32:11 -0600</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Testing and QA Interview Questions</category>
<guid>http://commoninterview.com/Testing_Interview_Questions/name-seven-of-the-most-common-sorting-algorithms/</guid>
<description><![CDATA[My answer was:<br /><br /> 	Bubble Sort <br /> 	Heap Sort <br /> 	Insertion Sort <br /> 	Merge Sort <br /> 	Quick Sort <br /> 	Selection Sort <br /> 	Bucket Sort <br /><br />Follow up question was to name computational complexity for each of them.<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Find substring in a string]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/find-substring-in-a-string/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/find-substring-in-a-string/</comments>
<pubDate>Mon, 02 Aug 2010 22:49:50 -0600</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/find-substring-in-a-string/</guid>
<description><![CDATA[Task was to write a function to find substring in a given string.<br /><br />Answer:<br /><br />One possible O(n<sup>2</sup>) solution from Wikipedia:<br /><br /><code><br /> int NaiveSearch(string s[1..n], string sub[1..m])<br />{<br />    for i from 1 to n-m+1<br />{<br />       for j from 1 to m<br />       {<br />          if (s[i+j-1] != sub[j]) break;<br />          return i;<br />        }<br />}<br />   return -1;<br />}<br /></code><br /><br />Edited by moderator<br/><br/>4 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[What is the difference between binary semaphore and Mutex ?]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/what-is-the-difference-between-binary-semaphore-and-mutex--1/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/what-is-the-difference-between-binary-semaphore-and-mutex--1/</comments>
<pubDate>Fri, 23 Jul 2010 20:46:26 -0600</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/what-is-the-difference-between-binary-semaphore-and-mutex--1/</guid>
<description><![CDATA[The differences between mutexes and semaphores are that semaphores are operating system dependent, though mutexes are implemented by specialized and faster routines. Mutexes are meant to be used for mutual exclusion (post/release operation is restricted to thread that called pend/acquire) only and binary semaphores are meant to be used for event notification (post-ability from any thread) and mutual exclusion.<br /><br />http://en.wikipedia.org/wiki/Semaphore_(programming)<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[The interview humor]]></title>
<link>http://commoninterview.com/Interview_strategies/the-interview-humor/</link>
<comments>http://commoninterview.com/Interview_strategies/the-interview-humor/</comments>
<pubDate>Fri, 16 Jul 2010 23:35:16 -0600</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Interview strategies</category>
<guid>http://commoninterview.com/Interview_strategies/the-interview-humor/</guid>
<description><![CDATA[A sense of humor is part of the art of leadership, of getting along with people, of getting things done. Approaching interview and all job search process with humor would save you a lot of sleepless nights. I am certainly not talking about using jokes on the interview; it is very tricky and I always recommend avoiding it. Look on couple of my favorite interview funny stories below; hope they would give you a smile and would help to realize common mistakes they emphasize.  Remember, in every joke there is a grain of true.<br /><br /><p><strong>"Talk only about relevant skills"</strong></p><br /><p> </p><br /><p>So tell me, Mrs. Jones," asked the interviewer, "do you have any other skills you think might be worth mentioning?" "Well, actually, yes," said the applicant modestly. "Last year I had two short stories published in national magazines, and I also finished my novel.""Very impressive," commented the interviewer, "but I was thinking of skills you could apply during office hours."Mrs. Jones explained brightly, "Oh, that was during office hours."</p><br /><p><strong> </strong></p><br /><p><strong>"Be reasonable and know your price"</strong></p><br /><p> </p><br /><p>Reaching the end of a job interview, the Human Resources Person asked the young Engineer fresh out of MIT, "And what starting salary were you looking for?"The Engineer said, "In the neighborhood of $125,000 a year, depending on the benefits package."The HR Person said, "Well, what would you say to a package of 5-week vacation, 14 paid holidays, full medical and dental, company matching retirement fund to 50% of salary, and a company car leased every 2 years - say, a red Corvette?"The Engineer sat up straight and said, "Wow!!! Are you kidding?"And the HR Person said, "Certainly ...but you started it."</p><br /><p> </p><br /><p><strong>"E</strong><strong>mployer Speak: what they say and what they mean by it</strong><strong>"</strong></p><br /><p> </p><br /><p><br />"Entry level position" -You'll be making minimum wage.<br /><br />"Entry level position in an up-and-coming company"- You'll be making minimum wage; we'll be bankrupt in a year.<br /><br />"Competitive Salary" - We remain competitive by paying less than our competitors.<br /><br />"Join Our Fast Paced Company" - We have no time to train you.<br /><br />"Casual Work Atmosphere" - We don't pay enough to expect that you will dress up.<br /><br />"Must be Deadline Oriented" - You will be six months behind schedule on your first day.<br /><br />"Some Overtime required" - Some time each night, some time each weekend.<br /><br />"Duties will vary" - Anyone in the office can boss you around.<br /><br />"Must have an Eye for Detail" - We have no quality control.<br /><br />"Seeking Candidates with a Wide Variety of Experience" - You will need to replace three people who just left.<br /><br />"Problem Solving Skills a Must" - You are walking into a company in perpetual chaos. Haven't heard a word from anyone out there. Your first task is to find out what is going on.<br /><br />"Requires Team Leadership Skills" - You will have the responsibilities of a manager without the pay or respect.<br /><br />"Good Communication Skills" - Management communicates poorly, so you have to figure out what they want and do it.</p><br /><p> </p><br /><p><strong>"Understand the problem"</strong></p><br /><p> </p><br /><p>A young engineer was leaving the office at 6 p.m. when he found the CEO standing in front of a shredder with a piece of paper in his hand. "Listen," said the CEO, "this is important, and my secretary has left. Can you make this thing work?" "Certainly," said the young engineer. He turned the machine on, inserted the paper, and pressed the start button. "Excellent, excellent!" said the CEO as his paper disappeared inside the machine. "I just need one copy."</p><br /><p> </p><br /><p><strong>"Be open"</strong></p><br /><p> </p><br /><p>Q: How can you tell an extroverted engineer? A: When he talks to you, he looks at your shoes instead of his own</p><br /><p> </p><br /><p><strong>"Responsibility"</strong></p><br /><p> </p><br /><p>Employer: In this job we need someone who is responsible.Applicant: I am the one you want. On my last job, every time anything went wrong, they said I was responsible."</p><br /><p> </p><br /><p><strong>"10 years from now.."</strong></p><br /><p> </p><br /><p>Fresh from the school candidate was being interviewed for the position at Microsoft. "Tell me," inquired the interviewer, "where do you expect to be ten years from now?""Well, let's see," replied the candidate. "It's Wednesday afternoon. I guess I'll be on the golf course by now."</p><br /><p> </p><br /><p><strong>"Experience"</strong> </p><br /><p> </p><br /><p>A Manager of a retail clothing store is reviewing a potential employee's application and notices that the man has never worked in retail before. He says to the man, "For a man with no experience, you are certainly asking for a high wage."</p><br /><p>"Well Sir," the applicant replies, "the work is so much harder when you don't know what you're doing!"</p><br /><p> </p><br /><p><strong>"Sahara Forest"</strong></p><br /><p>The classified ad said, "Wanted: a very experienced lumberjack". A man answered the ad and was asked to describe his experience:"I've worked at the Sahara Forest.", said the man"You mean the Sahara Desert," said the interviewer.The man laughed and answered, "Oh sure, that's what they call it now!"</p><br /><p> </p><br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How would you make view in ASP.NET MVC to compile ?]]></title>
<link>http://commoninterview.com/technical_questions/how-would-you-make-view-in-asp-net-mvc-to-compile--1/</link>
<comments>http://commoninterview.com/technical_questions/how-would-you-make-view-in-asp-net-mvc-to-compile--1/</comments>
<pubDate>Sun, 11 Apr 2010 01:34:08 -0600</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Technical Questions</category>
<guid>http://commoninterview.com/technical_questions/how-would-you-make-view-in-asp-net-mvc-to-compile--1/</guid>
<description><![CDATA[<b>Answer:</b><br /><br />Set MvcBuildViews Property  to true in project file:<br /><br /> &lt;MvcBuildViews&gt;  true  &lt;\MvcBuildViews&gt; <br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[What are JavaScript favlets? Give an example.]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/what-are-javascript-favlets-give-an-example--1/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/what-are-javascript-favlets-give-an-example--1/</comments>
<pubDate>Sat, 03 Apr 2010 12:13:21 -0600</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/what-are-javascript-favlets-give-an-example--1/</guid>
<description><![CDATA[<b>Answer</b><br /><br />Favlets are the snippets of Javascript inside a Bookmark URL. The simplest example would be javascript:alert('hello'). Copy this code into Browser address bar and see JS executed.  <br /><br />Favets executes in the current webpage context which means javascrip has access to all DOM element, global variables, functions, etc.<br /><br />Example of favlest are W3C validation, DOM inspection, Testing and more.<br /><br />Favlets For The W3C Validator<br />http://www.jibbering.com/2002/10/favlet.html <br /><br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Count and list all permutations]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/count-and-list-all-permutations-1/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/count-and-list-all-permutations-1/</comments>
<pubDate>Fri, 26 Feb 2010 21:48:28 -0700</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/count-and-list-all-permutations-1/</guid>
<description><![CDATA[Find all permuations of given array Value[] in Lexicographic order.<br /><br /><b>Answer:</b><br /><br /><code><br />void getNext()<br />{<br />  int i = N - 1;<br />  <br />  while (Value[i-1] > = Value[i]) <br />     i = i-1;<br /><br />  int j = N;<br /><br />  while (Value[j-1] < = Value[i-1]) <br />     j = j-1;<br />  <br />  swap(i-1, j-1);    <br />  <br />  i++; <br />  j = N;<br />  <br />  while (i < j)<br />  {<br />    swap(i-1, j-1);<br />    i++;<br />    j--;<br />  }<br />}<br /><br /></code><br />[Dijkstra, p. 71].<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[What is XSS and how to prevent it?]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/what-is-xss-and-how-to-prevent-it-1/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/what-is-xss-and-how-to-prevent-it-1/</comments>
<pubDate>Sat, 20 Feb 2010 00:35:42 -0700</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/what-is-xss-and-how-to-prevent-it-1/</guid>
<description><![CDATA[<b> Answer</b><br /><br />Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications which enable malicious attackers to inject client-side script into web pages viewed by other users.<br /><br />From Wikipedia http://en.wikipedia.org/wiki/Cross-site_scripting<br /><br /><br /><u> How to prevent XSS</u><br /><br />1. Validation, escaping, filtering<br />2. Cookie security<br />3. Disabling scripts<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[What is difference between visibility:hidden and display:none in JavaScript]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/what-is-difference-between-visibilityhidden-and-displaynone-in-javascript/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/what-is-difference-between-visibilityhidden-and-displaynone-in-javascript/</comments>
<pubDate>Sat, 20 Feb 2010 00:29:14 -0700</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/what-is-difference-between-visibilityhidden-and-displaynone-in-javascript/</guid>
<description><![CDATA[<b> Answer</b><br /><br />With visibility is set to 'hidden', the element being hidden still occupies its same place in the layout of the page, while with display set to 'none'  hides an element, and it will not take up any space.<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[What are JavaScript closures]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/what-are-javascript-closures/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/what-are-javascript-closures/</comments>
<pubDate>Sat, 20 Feb 2010 00:27:32 -0700</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/what-are-javascript-closures/</guid>
<description><![CDATA[A closure is a case when a function creates an environment that binds local variables in such a way that they are kept alive after the function has returned and variables should go out of scope.<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[One-two, one-two 2]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/one-two-one-two-2-1/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/one-two-one-two-2-1/</comments>
<pubDate>Sun, 14 Feb 2010 18:21:19 -0700</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/one-two-one-two-2-1/</guid>
<description><![CDATA[A year ago the famous gangster Vito woke up in the morning and realized that he was bored of robbing banks of round sums. <br /><br />So, for the last year he has been taking from banks sums that have only digits 1 and 2 in their decimal notation. After each robbery, Vito divides the money between N members of his gang.<br /><br />Your task is to determine the minimal stolen sum which is a multiple of N, where N is in the following range (1 ≤ N ≤ 106).<br /><br />Your function should output the minimal number which is a multiple of N and whose decimal notation contains only digits 1 and 2. If it contains more than 30 digits or if there are no such numbers, then output the word "Impossible".<br /><br /><u>Sample:</u><br /><br />5  - "Impossible"<br />26836  - 2111222121212<br />26837 - 211211212222212<br /><br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[N-Gas stations problem]]></title>
<link>http://commoninterview.com/interview_puzzles/n-gas-stations-problem/</link>
<comments>http://commoninterview.com/interview_puzzles/n-gas-stations-problem/</comments>
<pubDate>Sat, 23 Jan 2010 10:57:23 -0700</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Interview Puzzles</category>
<guid>http://commoninterview.com/interview_puzzles/n-gas-stations-problem/</guid>
<description><![CDATA[There are n gas stations positioned along a circular road. Each has a limited supply of gas. You can only drive clockwise around the road. You start with zero gas. Knowing how much gas you need to get from each gas station to the next and how much gas you can get at each station, design an algorithm to find the gas station you need to start at to get all the way around the circle <br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Reverse digits in integer x and return the resulting int]]></title>
<link>http://commoninterview.com/Programming_Interview_Questions/reverse-digits-in-integer-x-and-return-the-resulting-int/</link>
<comments>http://commoninterview.com/Programming_Interview_Questions/reverse-digits-in-integer-x-and-return-the-resulting-int/</comments>
<pubDate>Sat, 23 Jan 2010 10:46:34 -0700</pubDate>
<dc:creator>CodeGuru</dc:creator>
<category>Programming Interview Questions</category>
<guid>http://commoninterview.com/Programming_Interview_Questions/reverse-digits-in-integer-x-and-return-the-resulting-int/</guid>
<description><![CDATA[This is one of my favorite questions, i.e I pass 1234 result should be 4321<br /><br />Soulution in C# should be something like following:<br /><br />int reverse(int n)<br />{<br />int p = 0<br />while(n!=0)<br />{<br /><br />p = p*10 + n%10;<br />n = n/10;<br />}<br /><br />return p;<br /><br />}<br /><br /><br/><br/>2 Vote(s) ]]></description>
</item>

</channel>
</rss>

