Thursday, May 24, 2012
Wednesday, May 23, 2012
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
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
Labels:Data
ACM ICPC 2012
Friday, May 4, 2012
determine whether the given string is of form pZq where q is reverse of q. p and q can contain only X and Y.
like if p=XXYX then z will be XYXX
for ex XXYXXXYXX is valid
the constraints is that "you can read only the next character at each point" .
for ex XXYXXXYXX is valid
the constraints is that "you can read only the next character at each point" .
Labels:Data
Google Interview
You are given a string of ‘n’ characters where n is even. The string only consist of 6 type of characters: (){}[]. The task is to form a well formed expression. A well formed expression consist of proper nesting of braces and their is no priority between the braces like [ > } > ). You can edit any bracket and change it to remaining types for accomplishing the task.
Example A. "(){}" is valid B. "({[]})” is valid C. “((})” is invalid
Labels:Data
DirectI Interview
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.
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].
Labels:Data
Amazon Interview
Monday, April 30, 2012
Given a function bool Zoo(int x) and its called for y times , how you will generate the true with probability x/y times .
lest say if x = 65 & y=100, how will you generate true with probability 65/100. You can represent true by 1 and false by 0.
Labels:Data
Facebook Interview
,
Random Number Generator
Sunday, April 29, 2012
Find the kth smallest element in a (MxN) matrix.
PS:Think how efficiently u can do same for an array .
Labels:Data
Microsoft Interview
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.
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.
Labels:Data
FaceBook Engineering Team
Subscribe to:
Posts
(
Atom
)