CareerCup http://www.careercup.com/ CareerCup : Better Interviews, Better Careers en-us Interview Question: Microsoft | Coding | Software Engineer / Developer http://www.careercup.com/question?id= What will be the output of the following code for input values (2,2) and (3,3): int fun(unsigned int m, unsigned int n) { if(m==0) return n+1; if(n==0) return (fun(m-1,n+1)); return (fun(m-1,fun(m,n-1))); } - bedazzled on Tuesday August 19, 2008 bedazzled 2008-08-19T08:47+00:00 Interview Question: Yahoo | Algorithm | Software Engineer http://www.careercup.com/question?id= Thanks to careercup,i got placed in Yahoo. Written had questions in all topics in CS. Tech-intv: Suggest an algo for finding LCA of 2 nodes in a binary tree. Suggest how to find min element in a stack in O(1),where the only operations are Push and Pop. Check if there is a common node in 2 linked lists. Then a progrmmaing test. 1 was using memoisation to find value in a recurrence relation. 2.Given a regular expression and a text,find the min no of replacements to be done. 3.Implement diff command of Unix. thats all. - sriram.s on Tuesday August 19, 2008 sriram.s 2008-08-19T08:30+00:00 Interview Question: Microsoft | Application / UI Design | Software Engineer in Test http://www.careercup.com/question?id= interview for SDETC(contract) at MSFT was asked this question float returnangle(int hour,int min) so basically at 2:00 the angle is 60deg, the function should return 60. - Retrun angle given hour and minute on Tuesday August 19, 2008 Retrun angle given hour and minute 2008-08-19T00:44+00:00 Interview Question: Amazon | Java | Software Engineer / Developer http://www.careercup.com/question?id= Ok so i had my firsts phone interview with Amazon today. They interviewed me for a SE/D position in Seattle, WA. The questions are as follows: 1) What do you mean by Class and Objects in JAVA? 2) What would a s/w programmer use class in their program? What are the advantages? 3)What does the "Static" keyword do? 4) Do you know any other similar keywords? What are they? 5) What is the difference between Final, Finally, and Finalize? 6) Say you are using a map in your program, how would you count the number of times the program use put() and the get() function? How would you do that if its using multiple maps in the program? How would you do that if the map is sent as a parameter in a method? How would you do it if the multiple maps are passed into the methods (as parameters), and are use differently? (it went on forever....) 7) Tell me the algorithm for fibonacci series? (When i said there are two - recursive (time effcient) and iterative (otherwise)) Explain the recursive one? What is the time complexity? Why is it O(log n)? 8) Do you have any questions for me? ---------------------------------------------- Experience: One of a kind! Its my firs interview with such big company. The guy was pretty cut and dry. I was expecting his call @ 2.00 PM he called me 2.15PM. Introduced himself briefly, and asked whether i was expecting his call. And then just bang, bang, bang... he started asking questions. I was bit nervous at first (cause i was expecting he would ask something about my work and all that first, as other companies did)... ! Well.. no complains! Career Cup did help me a lot in my preparations. And, if i get a call for my second interview, i know i did good orelse i need to prepare more. :) - g.usask on Saturday August 16, 2008 g.usask 2008-08-16T02:27+00:00 Interview Question: Cisco Systems | Networking / Web / Internet | Software Engineer in Test http://www.careercup.com/question?id= 1. Explain any one routing protocols in detail. eg BGP , OSPF , RIP etc 2. What are the 7 stages through which OSPF converges. 3. Why BGP uses Full-Mesh 4. How will you test if you are given a black box , means you dont know whats inside it or which company is it .. You just know tht it is company covered by black paper. 5. Which routing protocol will you use if you have 50 nodes in each area. choose between OSPF , RIP and explain. 6. How can you resolve problems with a developer if he is not ready to accept the problem. 7. What we use community in SNMP protocol. 8. difference between SNMP v1 / SNMP v2 9. What is used in SNMP protocol , UDP or TCP. 10. Functions which define the TCP protocol in any programming language. e.g connect() , close() , listen() , accept() , bind() etc 11. Functions in UDP 12. Puzzle with 9 balls one of them is lighter find in minimum steps .. basically in 2 steps 13. Write a code to determine loop in a linklist. 14. Searching Algorithms and their complexity . - Robert on Friday August 15, 2008 Robert 2008-08-15T18:46+00:00 Interview Question: Amazon | Java | Software Engineer http://www.careercup.com/question?id= What do you know about Java generics - Jackie on Friday August 08, 2008 Jackie 2008-08-08T19:29+00:00 Interview Question: Microsoft | Terminology & Trivia | Software Engineer / Developer http://www.careercup.com/question?id= What is Little Endian and Big endian ? - atul.iiitm on Wednesday August 06, 2008 atul.iiitm 2008-08-06T19:09+00:00 Interview Question: Amazon | Terminology & Trivia | Software Engineer / Developer http://www.careercup.com/question?id= What are shared resources? - Anonymous on Monday August 04, 2008 Anonymous 2008-08-04T23:46+00:00 Interview Question: Amazon | Java Terminology & Trivia | Software Engineer / Developer http://www.careercup.com/question?id= what is object reflection in Java - Anonymous on Monday August 04, 2008 Anonymous 2008-08-04T23:46+00:00 Interview Question: Amazon | Java Terminology & Trivia | Software Engineer / Developer http://www.careercup.com/question?id= How does Java achieve synchronization? Given an class with Synchronized method A and B, a normal method C, there are 2 threads, one instance, can these two threads call A at the same time? call A and B at the same time? A & C at the same time? - Anonymous on Monday August 04, 2008 Anonymous 2008-08-04T23:46+00:00 Interview Question: Amazon | Algorithm | Software Engineer / Developer http://www.careercup.com/question?id= Find the two integers in an array whose sum equals to a given value - Anonymous on Monday August 04, 2008 Anonymous 2008-08-04T23:32+00:00 Interview Question: other | Experience | Software Engineer / Developer http://www.careercup.com/question?id= Tell me about a time where you did something that was difficult from a technical perspective and it solved a problem. - Forrest on Sunday August 03, 2008 Forrest 2008-08-03T17:47+00:00 Interview Question: Bloomberg LP | Brain Teasers | Financial Software Developer http://www.careercup.com/question?id= Brain teaser. You have 8 coins, only 1 is more heavy. How to detect it - Bloomberg london on Thursday July 31, 2008 Bloomberg london 2008-07-31T18:09+00:00 Interview Question: Bloomberg LP | Algorithm Data Structures | Financial Software Developer http://www.careercup.com/question?id= List as many data structures as you can think of. How do you detect a loop in a linked list? - Bloomberg london on Thursday July 31, 2008 Bloomberg london 2008-07-31T08:58+00:00 Blog Post: Picking the Right Companies http://www.careercup.com/blog?id=56396 I've been working (working: v. to write one or two sentences with the intention of finishing it up later that day, or the next day, or...) for a while on a post about how to pick which companies to apply to. <a href="http://www.talesfromthe.net">Jon Pincus</a>, my former manager from Microsoft, has done a better job that I would have, so I'll just let him take it from here... <br> <br><b>Jon Pincus</b>: "<a href="http://www.talesfromthe.net/jon/?p=35">You probably won’t be able to get your dream job in your next job; what you want is something that’s noticeably closer than where you are now, and makes it a lot more likely that the following job has even more of the dream job characteristics.</a>" <br> <br>Or, if you're one of those people who want to go to a big company and are just trying to come up with names, Google Sets can actually be useful here. If you put in Google, Microsoft and Apple, it'll return <a href="http://labs.google.com/sets?hl=en&q1=Google&q2=Microsoft&q3=Apple&q4=&q5=&btn=Small+Set+%2815+items+or+fewer%29">related terms</a> such as Intel, Sun, Yahoo and Blackberry. It's not a perfect list, but it's a start! - None on Thursday June 19, 2008 None 2008-06-19T17:30+00:00 Blog Post: Preparing Effective Resumes http://www.careercup.com/blog?id=56378 When I was in high school, a teacher returned an essay of mine with the following written on the top of the paper: "Know your audience." The task was to write a persuasive essay on any topic of our choosing. I just so happened to pick a topic on which the teacher had extensive knowledge and strong feelings. I hadn't been thinking about this at the time I chose the topic, but he was right - I should have known this wasn't a good topic. Lesson learned. <br> <br>Writing a resume is no different. Tailor what you're writing to the specific company and position. <br> <br><b>Resume Cosmetics</b> <br><ul><li><i>Avoid the Text Blob: </i>Employers don't read your resume - they glance at it for, oh, 10 - 15 seconds. You can't absorb key points from a large blob of text, so bullet your accomplishments instead. Write short, concise sentences. Craft your resume such that a quick glance is enough to say "wow".</li><li><i>Use a Template: </i>Do *not* just type everything into Microsoft Word - format your resume nicely by using a template. Microsoft Word has lots of built in resume tables - use one, or make your resume.</li><li><i>Pages</i>: if you're a recent college graduate (last few years), your resume should probably be one page. Can't get it all in one page? Trim it down to the most important stuff. This is actually a *good* thing to do, because the best stuff will stand out more.</li><li><i>Formatting Tip: </i>Electronic copies: if you create a good format in Micosoft Word, your resume probably uses tables. You may have noticed that table borders show up when you view them in Word but not when you print them out. And guess how many people will view your resume? That's right - on Word. So, you'll want to *really* hide your table borders. Here's how: instead of setting the borders to invisible (invisible on paper, but visible electronic), set them to visible but white. They'll be truly invisible then. <br></li><li><i>Filename</i>: A lot of people send me resumes named liked "Resume.doc", and they get lost. If you don't want your resume to be lost, put your name in the filename (eg, "John Smith Resume - April 2006.doc"). I *highly* recommend that you save it on your computer with such a filename this way you won't forget to send it with the proper name.</li></ul><b>Resume Content:</b> <br><ul><li><i>Accomplishments, not Responsibilities</i>: Employers want to know not just what you were assigned to do, but what you actually accomplished. For example, saying something like "Reduced time to perform X by 75% by optimizing Y" looks much more impressive than "Responsible for optimizing X." List your accomplishments over your responsibilities, and be specific.</li><li><i>Projects</i>: Employers want to see practical experience - that means internships and projects (this is especially true for Software Engineering positions). Yes, have a specific section on your resume for projects - 3 to 4 projects is ideal, whether they're class project or personal projects. If they're personal projects, say so! It shows passion and motivation. <br></li><li><i>Kill the Fluff: </i>I have never once said "oooh... this person claims to have great team working skills. Let's hire them!" Maybe I'm wrong here, but I don't think employers believe fluff stuff just because it's on a resume. <br></li><li><i>For US Positions: </i>Please don't list your age, marital status, gender, etc. I see this a lot with international applicants. In the US, it is illegal to use those as factors in a hiring decision. We don't want those on your resume.</li></ul><b>Resume Wording &amp; Proofing</b> <br><ul><li><i>Bullets:</i> Bullet each item for a job - you don't need to write complete sentences. Use action words.</li><li><i>Spelling &amp; Grammar:</i> Once you've done all this, make sure to check for spelling mistakes, grammatical mistakes and typos. Get as many people as possible to read over your resume and tell them to be picky. This is especially important for non-Native English speakers. Many companies will, unfortunately, toss your resume for a simple spelling mistake.</li><li><i>Personal Information: </i>This should be obvious, but double check that your phone number, address and email address are correct. Don't list your cell phone unless you are ok with receiving calls on it. <br> </li></ul> <b>Resume Customization: <br></b>I've said that you need to customize your resume based on the position, so I'll explain a little bit about what I'd do for each company. But first, a short summary of the various things I could include: <br><ul><li>Microsoft Software Engineering Internships: 2001, 2002, 2003</li><li>Apple Software Engineering Internship: 2004</li><li>Google Software Engineering: 2005 - Present <br> </li><li>TAing in College, including being Head TA</li><li>Webdesign / webprogramming for a small company in Philadelphia before going to Google <br> </li><li>Creating a course in college and teaching it</li><li>Teaching at University of Washington while working at Google</li><li>Planning a lot of large social events with 200+ people (see http://www.theseattleantifreeze.com) <br> </li><li>3 or 4 "meaty" projects in college</li><li>CareerCup (a website for technical job applications)</li></ul> <i>Software Engineer (anywhere): </i>I'd want to show off the technical problems I've done, as well as show myself to have good initiative. So, I would emphasize the technical work I've done at Google, Microsoft and Apple (big names = prestige). I'd drop the webdesign work - doesn't add much given the other jobs. I'd talk a bit about CareerCup, since that shows independent work. I wouldn't talk much about teaching or event planning, but I'd given them a brief mention. <br> <br><i>Program Manager</i>:<i> </i>I'd want to show off some technical stuff, but I also need to show good planning skills, design work, initiative. Google/Microsoft/Apple would have some stuff, but I wouldn't go into as much technical detail. I'd talk more about CareerCup (initiative, ability to drive a project). Planning large social events would be somewhat important too (shows leadership). Teaching at UW and Penn would be good to talk about as well because it shows communication skills and leadership. <br> <br><i>Board Position for Theater</i>:<i> </i>I recently applied for a board position for the young professionals group of a Seattle theater. I talked a bit about Google, Microsoft and Apple, but dropped a lot of the technical details. I talked a bunch about event planning, because they would want me to help plan events. I talked more about the various websites I maintain, because, who knows, maybe they would want me to help out with their website. I talked about creating a course at Penn and UW (initiative, communication skills, etc). <br> <br>I never once exaggerated what I did - I simply cut details or elaborate depending on how important something is. <br> <br><b>Resumes for Software Engineers: <br></b>I'll talk specifically about this since I see tons of Software Engineering resumes. <br><ul><li>A company like Google or Amazon, which does a lot of server / web work, will be most interested in projects you've done relating to the web or to scalable systems. Microsoft, however, might be more interested in client-side work. Again - customize!</li><li>Languages (Foreign &amp; Programming): Many employers will expect you to actually be able to *use* the languages you list on your resume - that means if you list French, you should be able to speak french. If you list C++, you should be able to write in C++ - and they might just test you on it. A good thing to do is to list your languages like this: <br> &nbsp;&nbsp;&nbsp;&nbsp; Proficient with: Java, C++ <br> &nbsp;&nbsp;&nbsp;&nbsp; Previously worked with: C, C#, Javascript, HTML <br>Oh, and this is just a pet peeve of mine that has to be said: if you've worked with C++ and C#, don't list them as "C++/C#". Yes, their names sound similar but the languages aren't. The same goes for Java/JavaScript</li><li>GPA: If your GPA isn't on your resume, the assumption is that it's below a 3.0. So, if you have a 3.2, list it! You can list either your in-major GPA or your total GPA, or both. Feel free to list which ever one's higher. Also, many universities have a policy that you can round your GPA to the nearest tenth. Check with your school, but if so, you should round that 3.67 to a 3.7. Every little bit helps, right? <br> </li></ul> ------------------ <br>As a point of reference, here's my resume: <a href="http://www.careercup.com/userresumes/GayleLaakmann.doc">Gayle Laakmann - Resume 2004</a>. Give yourself 15 seconds to look and the resume and then put it away. What was your impression of it? Did you get a good feel for my past experience? My resume is certainly not perfect (for one, it's too crowded, and quite out of date). I could probably trim it down a bit. That should give you a good start though. <br> <br>The most important thing to remember is that all you get to show off your years and years of experience is about 15 seconds. Can you tell the employer enough in 15 seconds to make them pick up the phone and call? - None on Thursday June 19, 2008 None 2008-06-19T17:30+00:00 Blog Post: Building Up Your Raw Skills http://www.careercup.com/blog?id=56377 Technology is a somewhat unique field - in my completely biased opinion - in that your raw skills are tangible and testable. That is to say, in an interview, there's typically less emphasis on "fluff" and more emphasis on what you can actually do. <br> <br>So, how do you build these raw skills? <br> <br>Regardless of what position you're looking for, if you want to know how to get there, you should ask someone in the field. Think about where you want to be in the next few years. Find a person who is right now where you want to be and ask them (ask them what?) If you don't know anyone offhand, well, that's what Google is for. Find someone and email them. People are pretty willing to help - if you only ask! <br> <br>That brings me to the specifics. I've been a software engineer at Google for the last two years, so people ask me pretty frequently how they can get a job at Google. The number one thing that I think is missing from applicants is real project experience. <br> <br>If you're in school, you should study hard and all that good stuff. But, that's not enough. You need project experience - companies want to see what you can actually code. By the time you've graduated, aim to get at least three major software development projects under your belt. Here are a few ideas as to how to get those projects: <br><ul> <br><li>Many schools offer the ability to do an independent study. Think of an application that you want to build, pitch it to a professor, and maybe you can get credit for it by doing as an independent study.</li> <br><li>Talk to professors that you know - or even ones that you don't - and ask them if you can help them out with research. If you want to be a software engineer, focus specifically on the projects where you'll be writing code in a language like C++ or Java (as opposed to, say, MatLab).</li> <br><li>Check out the code to an open source project and build it. Take some time to learn the project architecture, then start coding. Start with fixing a few bugs, and then move into real feature work.</li> <br><li>Enroll in courses which have large projects. Yeah, they're hard, but no pain no gain, right?</li> <br> <br>If you're not in school right now, you might be able to enroll in courses at a local university. But if not, you can still do projects on your own. Start with something small - like a Google Maps mashup listing your favorite restaurants - and go from there. <br> <br>You'll learn a lot from coding on your own, but the benefits go beyond that - simply the fact that you did coding on your own rather than for work / school shows the passion and dedication that every company wants to see. - None on Thursday June 19, 2008 None 2008-06-19T17:27+00:00 Blog Post: How to Get Your Dream Job http://www.careercup.com/blog?id=56395 Every few weeks, I get an email from someone asking if I can get them a job at their favorite tech company. Sometimes I can get this process started for them, sometimes I can’t, but either way, the process of getting a job is about far more than just submitting your resume. <br> <br>So, here it is: getting a job in ten not-always-easy steps. Over the next few weeks or so, I’m going to write about each one of these in more detail. <br> <br>(1) <b><a href="/blog/?b=a9885c7d-77ce-48eb-9348-5b6bebcd4016">Build Raw Skills</a></b> <br> <br>Think a few years out about what position you’d like. What do you need to do to get there? <br> <br>(2) <b><a href="blog/?b=d3a37f94-63cf-46b1-bfe0-8898f10abbf6">Prepare a *good* resume</a></b> <br> <br>Great experience isn’t enough. You need to show this in your resume. Remember – a resume is not a timeline of everything you’ve done; it’s a proof of your skills. <br> <br>(3) <b><a href="http://www.careercup.com/blog/?b=f919bc00-a341-4121-9f3f-36d43f18e82c">Picking the right companies</a></b> <br> <br>To list just a few things to think about: company size, company culture, the role of someone in your position, how long the company has been around, what the company actually does, growth of the company, location, etc. <br> <br>(4) <b> Prepare a cover letter</b> <br> <br>This is a company’s first introduction to you, so make it perfect. <br> <br>(5) <b>Apply!</b> <br> <br>Getting your foot in the door at a company isn’t always easy, but there are a few tricks I’ve learned... <br> <br>(6) <b>Preparing for the interview</b> <br> <br>Know what to expect and prepare accordingly. If you’re reading CareerCup, you’re probably off to a great start. <br> <br>(7) <b>Interview</b> <br> <br>This is what it all comes down, and there’s a lot you can do to shape the outcome. <br> <br>(8) <b>Negotiate</b> <br> <br>You can negotiate (almost) any offer – even if they say it’s "non-negotiable" <br> <br>(9) <b>Make a decision</b> <br> <br>If you have several offers, you’re in a great spot. How do you pick the one that’s right for you? <br> <br>(10) <b>Accepting &amp; Denying</b> <br> <br>Accepting an offer is easy, but don’t forget – it’s important that you decline the offer the right way too. <br> <br> <br>Stay tuned – I’ll elaborate on each one of these in the upcoming weeks. - None on Thursday June 19, 2008 None 2008-06-19T17:24+00:00 Comment: Felearrolve on Wednesday August 20, 2008 http://www.careercup.com/question?id=1509 Felearrolve said: From online including are featuring <a href=http://www.o3on.com/porno/college-pussy.html>college pussy</a> on na‹ve <a href=http://www.o3on.com/porno/bald-pussy.html>bald pussy</a> demoiselleish crude and blonde doll-sized demoiselle sluts teen babes porn. Games videos films pay vod pics web dvds <a href=http://www.o3on.com/porno/hairy-pussy.html>hairy pussy</a> dvd mall toys phones personal. outrageous sampling get having lolita getting vulgar fucked access pussy squirt a depict valid the days less stunning more unrestricted <a href=http://www.o3on.com/porno/white-pussy.html>white pussy</a> simply of age teen. Videos brook films again teen bellow files pictures gt clips mgp antiquated east haziness gratuit flourish angels let go on pics a video <a href=http://www.o3on.com/porno/lesbian-pussy.html>lesbian pussy</a> position xxx with mega positions satisfy. victory hottest incredible tag members upper-class enigmaticsubstance no greater than pussy squirt web ess man deciding rapturouss for 1st term unfeeling porn. Teen lightspeed nautical taut pussy squirt pussy squirt big wet trimmed. Mega teensy-weensy dildo new visual dodge pussy squirt vulgar wens parcel own cock favorites favorite. Than gt teen more pussy squirt with teen blog galleries pussy squirt bends pussy porno. At teen pussy squirt nonsensical <a href=http://www.o3on.com/porno/pussy-squirting.html>pussy squirting</a> gigantic babe and filly teens. Videos pics fetch pussy squirt smell of b distribute <a href=http://www.o3on.com/porno/hairy-pussy.html>hairy pussy</a> acquaint with pussy squirt <a href=http://www.o3on.com/porno/wired-pussy.html>wired pussy</a> revision. make an appearance fucking snug pass <a href=http://www.o3on.com/porno/latina-pussy.html>latina pussy</a> teen pussy squirt angel virgins side the spool blog enigmaticessence horny. Teen porn with <a href=http://www.o3on.com/porno/teen-pussy.html>teen pussy</a> ba rely essential films this a pussy squirt photo fucking teen undefiled fillys. Medieval connected with to amp stretch teen behest matured pics pussy squirt grown up. Of online grown up at cherry fillyish cream porno <a href=http://www.o3on.com/porno/young-teen-pussy.html>young teen pussy</a> amp eDialect right visual porno else pics lascivious let go. Toy models bragers association teen specimen amulet are cams been pussy squirt per in let go including nudist pussy squirt porn gleaning in <a href=http://www.o3on.com/porno/nice-pussy.html>nice pussy</a> of age having pussy squir t wayward f for including pussy squirt lascivious more tgp organize wet you. Members pictures places pussy squirt gay enterprise teen pussy squirt jeopardize consectetuer steam angels a video slides whoever galleries his teen stunning babe aged teen video suckle brooking pussy squirt casting web undressed undressed film online <a href=http://www.o3on.com/porno/old-pussy.html>old pussy</a> . grown up kim webmasters features visioning vision teen lolitas pussy squirt phones teen your. disentangle enter ass selections yet teen devise a actors dildo mgp east pictures prevision. Hi and adorable teen decompleter redhead gallery from is years new bigs elated <a href=http://www.o3on.com/porno/pussy-licking.html>pussy licking</a> virtuous confirm enterprise teen. View full comment at http://www.careercup.com/question?id=1509 Felearrolve 2008-08-20T00:14+00:00 Comment: stateelectrichotwaterheaterPa on Tuesday August 19, 2008 http://www.careercup.com/question?id=2490 stateelectrichotwaterheaterPa said: Your site- www.careercup.com is interesting site, tnks, admin. see this <a href= http://carolinecs.150m.com/state_select_hot_water_heater.html > state select hot water heater </a> View full comment at http://www.careercup.com/question?id=2490 stateelectrichotwaterheaterPa 2008-08-19T22:45+00:00 Comment: stateindustryhotwaterheaterPa on Tuesday August 19, 2008 http://www.careercup.com/question?id=1640 stateindustryhotwaterheaterPa said: Your site- www.careercup.com is good resource, tnks, admin. But look at this [url=http://carolinecs.150m.com/state_commercial_water_heater.html] state commercial water heater [/url] View full comment at http://www.careercup.com/question?id=1640 stateindustryhotwaterheaterPa 2008-08-19T22:45+00:00 Comment: statewaterheaterpartPa on Tuesday August 19, 2008 http://www.careercup.com/question?id=1640 statewaterheaterpartPa said: The site www.careercup.com is good site, good job, admin. But see this [url=http://carolinecs.150m.com/state_select_gas_water_heater.html] state select gas water heater [/url] View full comment at http://www.careercup.com/question?id=1640 statewaterheaterpartPa 2008-08-19T22:45+00:00 Comment: statewaterheaterspricePa on Tuesday August 19, 2008 http://www.careercup.com/question?id=1606 statewaterheaterspricePa said: The www.careercup.com is interesting resource, tnks, webmaster. But look at this <a href= http://carolinecs.150m.com/state_water_heater_censible.html > state water heater censible </a> View full comment at http://www.careercup.com/question?id=1606 statewaterheaterspricePa 2008-08-19T22:45+00:00 Comment: Anonymous on Tuesday August 19, 2008 http://www.careercup.com/question?id=2121 Anonymous said: if a.equals(b), a.hashCode() == b.hashCode(). But it isn't necessarily true the other way. View full comment at http://www.careercup.com/question?id=2121 Anonymous 2008-08-19T21:46+00:00 Comment: Anonymous on Tuesday August 19, 2008 http://www.careercup.com/question?id=2896 Anonymous said: == compares the addresses of 2 objects while equals() compares the "contents" of 2 objects View full comment at http://www.careercup.com/question?id=2896 Anonymous 2008-08-19T21:38+00:00 Comment: Anon on Tuesday August 19, 2008 http://www.careercup.com/question?id=56730 Anon said: #include<iostream> int main() { std::string searchstr = "aaaditolyerusitya"; std::string pattern = "a*ty?"; for(int i =0; i < searchstr.length(); i++) { int currentpos = i; bool flag = false; for(int j = 0; j<pattern.length(); ) { if(pattern[j] == '?') { currentpos++;j++; if(j == pattern.length()){ std::cout<<"Found"; return 1;} continue; } else if(pattern[j]=='*') { flag = true; j++; if(j == pattern.length()){ std::cout<<"Found"; return 1;} while(searchstr[currentpos] != pattern[j] && currentpos < searchstr.length()) currentpos++; } if(searchstr[currentpos] == pattern[j]) { if(j == pattern.length()) { std::cout<<"found"; return 1; } currentpos++;j++; } else { if(flag == true) { --j; continue; } break; } } } } View full comment at http://www.careercup.com/question?id=56730 Anon 2008-08-19T21:06+00:00 Comment: Ravi on Tuesday August 19, 2008 http://www.careercup.com/question?id=57097 Ravi said: I am not sure, if it is optimam solution. It goes as. Step 1 : Make an array of unique number(Say tempArray) from given array (Say OriArray) Step 2 : Get Sum1 = 2n * sum of all numbers in tempArray Setp 3 : Get Sum2 = sum of all numbers in OriArray Setp 4 : get diffNum = Sum2 - Sum1 Setp 5 : DiffNum is the one which has occurances 2n+1 times in OriArray. View full comment at http://www.careercup.com/question?id=57097 Ravi 2008-08-19T20:43+00:00 Comment: Anonymous on Tuesday August 19, 2008 http://www.careercup.com/question?id=2461 Anonymous said: silly View full comment at http://www.careercup.com/question?id=2461 Anonymous 2008-08-19T20:20+00:00 Comment: Rohith Menon on Tuesday August 19, 2008 http://www.careercup.com/question?id=2533 Rohith Menon said: a O(nlogn) solution find(set, n/2); find(set, n) 1. if set.size == 1 and n < set.size then answer yes 2. randomly select a card in the set, C 3. partition the cards into two sets, setL = cards equivalent to C and setR = cards not equivalent to C. 4. if (size of setL == n/2) then answer is yes if (size of setL > N/2) find (setL, n); else find(setR, n-setL.size()) View full comment at http://www.careercup.com/question?id=2533 Rohith Menon 2008-08-19T18:55+00:00 Comment: Rohith Menon on Tuesday August 19, 2008 http://www.careercup.com/question?id=2490 Rohith Menon said: Here is a solution. Got close approximation when monte carlo simulated. with rand5(), you can do rand2 and rand4. x=floor(1+(rand5/5)*2); rand2=(x>2)?2:x; (to avoid the condition when [1+(5/5)*2 = 3] happens. |||ly you can do rand4. Do a=rand2 , b=rand4, do a+b.which means you get 8 possibilities. 2 3 3 4 4 5 5 6, and doing a reject for a = b = 1; which means your sample space becomes 3 3 4 4 5 5 6. Now for rand7 you need a probability of 4/7 for 1, for any bit. So if you take P(a+b == 3 || a+b == 4), you can get probability of 4/7 (nr of 1s in any bit position). I tried a monte carlo simulation with the above probability and got close approx to 4/7. I also feel that the confidence interval for this wud be as high as >95%. When running this over many samples. I havent calculated that though. Comments/suggestions/criticisms welcome. Thanks, Rohith Menon. View full comment at http://www.careercup.com/question?id=2490 Rohith Menon 2008-08-19T18:42+00:00 Comment: Chuan on Tuesday August 19, 2008 http://www.careercup.com/question?id=56909 Chuan said: void dedupe(char *str) { int length = strlen(str); int i=0,j=0; char flag[256]; for(i=0; i<256; i++) { flag[i] = 0; } for(i=0; i<length; i++) { if(flag[str[i]] == 0) { flag[str[i]] = 1; str[j] = str[i]; j++; } } str[j] = '\0'; } View full comment at http://www.careercup.com/question?id=56909 Chuan 2008-08-19T17:31+00:00 Comment: Ravi on Tuesday August 19, 2008 http://www.careercup.com/question?id=57566 Ravi said: 7,61 View full comment at http://www.careercup.com/question?id=57566 Ravi 2008-08-19T17:24+00:00 Comment: Anon on Tuesday August 19, 2008 http://www.careercup.com/question?id=57075 Anon said: Sort the two set.... O(nlogn) Compare from starting element: If set one element is less than set two, go to next element in set one and vice versa. If the two are equal, store in another array and go to next elements in both the sets. This will take O(n) time. So the total complexity is still better than O(n2). View full comment at http://www.careercup.com/question?id=57075 Anon 2008-08-19T17:13+00:00 Comment: Anonymous on Tuesday August 19, 2008 http://www.careercup.com/question?id=2582 Anonymous said: cant we build a trie for generalized sol View full comment at http://www.careercup.com/question?id=2582 Anonymous 2008-08-19T17:13+00:00 Comment: cc on Tuesday August 19, 2008 http://www.careercup.com/question?id=57566 cc said: Here are my answers: f(0, n) = n+1; f(1, n) = n+2; f(2, n) = 2n + 3; ==> f(2, 2) = 7 f(3, n) = 2^(n+3) -3; ==> f(3, 3) = 61 View full comment at http://www.careercup.com/question?id=57566 cc 2008-08-19T17:06+00:00 Comment: Anon on Tuesday August 19, 2008 http://www.careercup.com/question?id=57076 Anon said: I still do not get Ajay's solution. If you are inserting ith line with probability 1/i then each new line will have less probability and the first line will be in buffer always. Do explain in details please. View full comment at http://www.careercup.com/question?id=57076 Anon 2008-08-19T17:01+00:00 Comment: Rohith Menon on Tuesday August 19, 2008 http://www.careercup.com/question?id=2515 Rohith Menon said: Here is a solution. Keep track of unmatched 0s and 1s int unmatched_1 = 0, unmatched_0 = 0, j = 0; for (int i = 0; i < V.size(); i++) { if (V[i] == 1) { if (unmatched_0 > 0) {V[j++] = 0; V[j++] = 1; unmatched_0--;} else {unmatched_1++;} } else { if (unmatched_1 > 0) {V[j++] = 0; V[j++] = 1; unmatched_1--;} else {unmatched_0++;} } } if (unmatched_0 > 0) for (int k = j; k < V.size(); k++) V[k] = 0; if (unmatched_1 > 0) for (int k = j; k < V.size(); k++) V[k] = 1; Thanks, Rohith Menon. View full comment at http://www.careercup.com/question?id=2515 Rohith Menon 2008-08-19T14:13+00:00 Comment: Rajul on Tuesday August 19, 2008 http://www.careercup.com/question?id=2989 Rajul said: I dont think , its the right way...... The first time they will not exchange any mesage . The A will simply lock one latch with the lock . leave the box open. Now when this will reach to B. B will lock the 2nd latch with the A's lock. Left letch ----A lock --- B Lock ------right latch. Now this system will alow any of A or B to communicate with theier own key. If any of the lock is open ........box will be open. View full comment at http://www.careercup.com/question?id=2989 Rajul 2008-08-19T12:18+00:00