Thursday, May 24, 2012

Given an array of integers and a value.Which array index will give maximum result after XORing with the given value. How can we find that efficiently?


Wednesday, May 23, 2012

You are getting a stream of characters and at any time you can be asked to find out if the string received yet is palindrome or not. There can be multiple queries.He insisted to do it in better than O(n) and No extra space.


Saturday, May 19, 2012

Power Tower Problem-

Given two power towers, find out which one is larger. Power tower is a number of the form : a1 ^ ( a2 ^ (a3 ^ (.... ^an)

You can assume that N <= 100, and each ai <= 100.
I don't have any efficient solution yet.

Source:
A sub-task in ICPC world finals 2012

Thursday, May 3, 2012

You are given a positive integer A. The goal is to construct the shortest possible sequence of integers ending with A, using the following rules

the first element of the sequence is 1,each of the successive elements is the sum of any two preceding elements (adding a single element to itself is also permissible),
each element is larger than all the preceding elements; that is, the sequence is increasing.
For example, for A = 42, a possible solutions is [1, 2, 3, 6, 12, 24, 30, 42]. Another possible solution is [1, 2, 4, 5, 8, 16, 21, 42].

Monday, April 30, 2012

Sunday, April 29, 2012

Tuesday, April 24, 2012

Three tips to succeed as a programmer

I Found its worth to read so thought to share.......

I've learned a lot of things over the years that I wish I knew before I graduated. From choosing the right job to figuring out where to focus in programming, here are three simple tips I’ve learned to help you as you embark on your career in software engineering.

1. Look for jobs that will let you program. 
You didn’t spend the past four years studying this field to stop now, right? You want your job title to be ‘software developer,’ ‘software engineer,’ ‘programmer,’ ‘coder’ or whatever other name describes exactly what you want to do.  So, make sure to steer clear of positions in marketing, testing, sales, etc. and seek out companies that are interested in hiring and mentoring you along your chosen career path.

2. Don’t give up on becoming a programmer.
Your education is only just about to begin.  After spending years obtaining a degree, brace yourself because the amount of time you’ll spend working on collaborative projects is where the real fun kicks in.  So far, you’ve probably been writing code, and that’s good. But to be a programmer, you need to learn how to read code. That’s the hard part because it requires you to understand, maintain, fix, and extend existing products.  You will have to become very good at reading code and deciphering what other programmers intended to do.

This will be frustrating and hard. You’ll feel like you’re not good at it, like the job is too difficult, like you could do so much better if you only rewrote everything from scratch. But it’s not too hard, and with practice, you will get better, and you will understand. Expect it to take time, and know that the rewards are certainly worth it - good programmers can change the world.

3. Learn how to take charge of your career.
Spend some time to figure out if you want to work on front-end code, back-end code, new product, or something else. Ideally, you’ll get to move around and learn from each unique position. So, if there’s some new and interesting opportunity to move, raise your hand and find your spark. People are not likely to come searching for you when great opportunities show up because there are probably going to be plenty of other people to choose from.

This can be hard, but you need to get out of the mindset that you are being pushy, demanding or somehow greedy when you do this. I’m not saying you need to trample over everyone around you and fight to the death, nor am I saying that you should demand to be given a new task. What I am recommending is that you find a way to politely indicate your interest and excitement about the opportunity to the right people- your boss, whoever is in charge of the opportunity, possibly the lead developer, etc. Find out how you could be a part of it and make the transition. The worst-case scenario is that you are told you are not quite ready; in which case you can work on figuring out what else is needed and be ready for the next opportunity that comes up.

Part of managing your career means taking a stock of your personal progress once or twice a year, especially early on in your career. Are you achieving your goals? Are you getting more complex tasks? Is your work increasing in scope and importance? If you notice yourself stagnating, take action right away. You don’t want to find yourself five years after starting your job still at the same level as a college new grad.

So, remember: learn how to read code, dedicate yourself to programming and manage your career.  Soon, you’ll be up and running in the programming world and making an impact.

Source: Goranka Bjedov is a capacity engineer on the Tech Ops team at Facebook. Goranka recently shared some of this advice at a computer science event with women from Mills College in Oakland, Calif.