Archive for the 'Business' Category

A better solution to the FizzBuzz interview problem

Wednesday, July 2nd, 2008

Many months ago, I wrote about a simple programming problem that I was administering to interviewees at work to assess their programming skills. The basic problem is this: loop through a range of integers, outputting different strings depending on whether each integer is divisible by one given number, by another given number, by both given numbers, or by neither. It’s a very basic weed-out problem that can be solved easily by any applicant with a basic understanding of control structures and modular arithmetic.

Last week, the comments section on that post erupted with new activity. I posted my own solution, which I was then criticized for because it used more than two division operations per integer (and as you should know, division is by far the most expensive basic arithmetic operation on a computer). So I got to brainstorming and I quickly came up with a solution that uses two divisions total, no matter how large the range is. I’m pretty convinced that my solution is very close to optimal (minus some minor fudging regarding how the if-statements are laid out and how the modular incrementing is handled). Here’s the solution in Java, simply because Java is the language most job applicants seemed to want to solve the problem in:

public class FizzBuzz {
	// I got lazy and coded in the parameters as constants instead of as arguments.
	static final int x = 3; // The first integer to test divisibility on
	static final int y = 5; // The second integer to test divisibility on
	static final int a = 27; // The starting number in the range to process
	static final int b = 74; // The ending number in the range to process
	
	public static void main(String[] args) {
		int x1 = a % x; // These are our only
		int y1 = a % y; // two divides!!
		for (int i = a; i <= b; i++) {
			if (x1 == 0) System.out.print("Fizz");
			if (y1 == 0) System.out.print("Buzz");
			if (x1 != 0 && y1 != 0) System.out.print(i);
			System.out.println("");
			x1 = ( x1 == x - 1 ? 0 : x1 + 1);
			y1 = ( y1 == y - 1 ? 0 : y1 + 1);
		}
	}
}

Pretty nifty, eh? Instead of having to perform expensive division operations on each integer in the loop, we’re simply incrementing two modular counters. This solution immediately suggests a good part two for the FizzBuzz interview question. After the applicant demonstrates basic familiarity with how programming works by writing up the naive solution, test their analytical abilities by asking them to come up with a more efficient version of the same program. If they don’t know it already, explain that division operations are expensive, and then ask them to minimize the total number of division operations necessary.

There will be a fair number of people who can get through the first part of the problem but won’t be able to get through the second part of the problem without a lot of hints. It’s these people that you may want to avoid hiring, because being able to improve on the naive algorithm and find more optimized ways of doing things is very important in programming. So, if you happen to be in a hiring position at a programming company, do try this problem out, and let me know how it goes!

Yet another reason to quit Facebook (YARTQF)

Sunday, April 20th, 2008

I know I know, me harping on quitting Facebook is old news. But now there’s yet another reason to quit Facebook. Some police in the United Kingdom are now harvesting user information via a Facebook application. And keep in mind that third party applications on Facebook are vetted poorly and often have much more access to your data than is required. But that’s not all …

The privacy settings on who gets to view what data about you only matter for other users, not applications. So even if you have your privacy settings set so that no one can see your uploaded pictures, with this application, the police can see them anyway. Best yet, even if you don’t install the application, if one of your “friends” does (and keep in mind it’s not uncommon to have hundreds of “friends” on Facebook), the police still get a nice deal of information on you. Feel like tracking down every one of the friends in your list and verifying that none of them is running, knowingly or unknowingly, a 3rd party application that is violating your privacy?

I could tell which way the wind was blowing back when Beacon was first announced, and so I decided to quit immediately. That was a good decision on my part. In the intervening time, Facebook has only gotten worse and worse. How many privacy violations are you going to put up with before you too decide that it’s time to log off for good? It’s just the police in England who are doing this now, but once other police departments realize this is possible, how will they resist?

Dumbest patent ever?

Friday, April 11th, 2008

AMC-14 is (well, was intended to be, anyway) a geosynchronous communications satellite owned by SES Americom that was launched in March. The only problem is that the Proton rocket it was strapped to failed and didn’t quite deliver enough thrust to put the satellite in a proper Geostationary Transfer Orbit, so the satellite is effectively useless. The good news is that there’s a Lunar flyby trajectory that the satellite can use to correct its orbit to geosynchronous. The bad news is that the trajectory is patented by Boeing, and SES Americom isn’t going to use it for fear of a lawsuit.

Yeah, you read that correctly. Boeing applied for a patent on a specific orbital trajectory, which is pretty much the equivalent of trying to patent an equation used in physics. And because this preposterous patent was actually granted, a many million dollar communications satellite is going to waste and we leave another large piece of space debris in Earth orbit. Absolutely brilliant.

Anyone who doesn’t think the patent system has gone completely insane in these past few decades, try to defend this one.

Where are all the computer science majors?

Saturday, February 23rd, 2008

On Thursday, I attended the career fair at University of Maryland, College Park on behalf of my employer. It was a pretty sweet deal. Instead of spending the day coding in the office, I got to return to campus on a weekday during all the hustle and bustle of usual college life. I ran into and caught up with some people I know who haven’t graduated yet. It was a fun time, and the slightest bit surreal because, just one year ago, I was at the same career fair, only in the opposite role of one of the students prospecting for jobs. I still remember very well what it felt like to be a student talking with the various employers, and I crafted my own pitch around what I think would be most effective on the me from one year ago.

Although I had a great time at the career fair, and those five hours seemed to disappear in the blink of an eye while I was chatting with everyone, I can’t help but feel that my company didn’t get the best return out of it. Registration for the career fair was $700 for the small booth that we had; as these things go, that’s pretty expensive. Compared to that expense, we didn’t really talk to enough people that we would be interested in hiring.

My company is looking for full-time “programmer analysts”, which is a fancy way of saying software developer consultants. All of our literature and our poster used that term, and we began thinking that maybe compatible people were simply passing us by because they didn’t realize we were actually looking for them. So we put up a prominent “Software developers needed” sign, and did get slightly more people throughout the rest of the day.

To be a good programmer analyst, you have to be a good programmer. That pretty much means a computer science major, or someone in a related major (such as Computer Engineering) who has significant programming experience. We aren’t looking for experience with any particular languages, the theory being that good programmers can quickly adapt and learn whatever is necessary to complete the job. Besides, the choice of programming language isn’t up to us; it’s whatever our clients want. And while most of them want Java or .NET, there’s a fair number of other languages some of them use that no one learns in school.

Read the rest of this entry »

Netscape’s death marks the end of a web era

Saturday, February 23rd, 2008

Let’s have a moment of silence for Netscape Navigator, which has finally shuffled off that mortal coil at the age of fourteen. Netscape was once the dominant web browser, sitting comfortably atop an 80% market share. But its failure to innovate, and Microsoft’s bundling of Internet Explorer with Windows, ultimately led to its downfall. It’s a huge shame, because IE would go on to cause huge harm to the web owing to its noncompliance to standards. We all would’ve been better off had Netscape remained on top.

Eventually, Mozilla Firefox would come along to challenge IE’s reign of terror, and AOL released re-branded and slightly modified versions of Mozilla Firefox and called them Netscape. They didn’t have much of a connection with the Netscape of yore except for the name, and now even that has come to an end. Netscape has reached end of life. Long live Netscape!

I’ll still crack a smile whenever I run across a long-forgotten web page bearing the now-obsolete recommendation “Best viewed with Netscape”.

Did we learn nothing from the dotcom burst?

Thursday, February 21st, 2008

The scariest, indeed the defining, aspect of stock market bubbles is that nobody sees them coming. If we saw them coming, the prices wouldn’t rise any higher than the companies involved were actually worth, and there’d be no bubble. In hindsight, of course, bubbles are incredibly obvious, and everyone and their dog can point to them and recite a litany of reasons why they were bound to happen. Yet it’s very hard to distinguish bubbles from true organic stock growth on a going-forward basis. For instance, the advent of computing looked for all purposes like a bubble — oh look at this newfangled technology, it can’t hardly be as revolutionary as they claim it is. But of course, it was even more revolutionary than anyone except scifi authors had anticipated, and companies like IBM, Intel, Microsoft, et al, all minted their own billionaires off it.

The dotcom bubble seemed to most people to be the next revolutionary stage in computing. It would be even more groundbreaking, and mint even more billionaires, than the original computing revolution. Of course, the Achilles heel was that very few people actually knew how to monetize these new dotcom websites. The ideas were grandiose. The business reality simply wasn’t there. I sometimes feel that we failed to learn the lessons of the past dotcom bubble, and that we’re currently in another one. After all, the vicious thing about bubbles is that no one can see them coming, not even when they’ve already happened before.

How do sites like Facebook, MySpace, Digg, and YouTube justify their valuations? They have lots of eyeballs, sure, but the monetization simply isn’t there. Their sole selling point is their exponential growth, pushing the problem of how to effectively make money off their site into the future; after all, for the present, they can just continue growing, right? Except they can’t grow indefinitely. The addressable market is only so large. They will stagnate. And what will happen to them then?

Face it, online advertising sucks in a multitude of ways. It’s trivial to block (just install the Adblock Plus extension for Firefox*). No other form of advertising can be combated nearly as effectively. Click rates are horrendously low. People using the web have learned to tune it out to a very large degree. It’s just not enough of a revenue stream to sustain the huge valuations of sites like Facebook. $15 billion?! Come on! And Digg? Digg is just terrible now. It’s so overwhelmed by the lowest common denominator that no one takes it seriously. I use it for finding mildly amusing stupid photographs and that’s about it. It’s constantly derided for its low quality advertising that no one clicks on. Can anyone really justify the amount of money it is claimed to be worth? It works out to how many hundreds of dollars per active user?

Read the rest of this entry »

Quitting Facebook yields poignant memories

Wednesday, February 13th, 2008

I’ve long had issues regarding Facebook and privacy. In November, I deactivating my Facebook account. It was mostly symbolic, as deactivating your account doesn’t actually do anything; the next time you login, it’s reactivated as if nothing had happened at all. But in the intervening period, I didn’t use Facebook once. Deactivating it was my first step towards getting rid of it completely. And now I’ve taken the next step.

Yesterday, I temporarily reactivated my Facebook account, but only to wipe out all of its contents (which is apparently the only way Facebook will then let you delete your account). It was kind of a sad experience. I had to remove all of my friends from my account and un-tag myself from all of my pictures. Luckily I hadn’t uploaded any of my own. It brought back a lot of memories of fun times from college that in all likelihood will never happen again, such as dorm parties. As I deleted friend after friend, I was stricken by the sad truth that I will never see the majority of these people again in my entire life. Deleting them from my Facebook account, which was severing the only link I had left with many of them, was symbolic and poignant. It had me moping around for a good hour afterwards.

Forget how mechanically hard Facebook makes it to quit (why can’t they have a simple “Delete my account” link like nearly every other site out there, MySpace included?). It’s even harder emotionally to quit. I was only able to do it because I value my privacy so highly, and I don’t like the thought of my personal data being at the whims of a company like Facebook which demonstrably does not value privacy. But the majority of people wouldn’t be able to quit, even if they were concerned with the privacy aspects. Facebook, like a symbiotic parasite, becomes an essential part of your life. It’s a black hole that sucks in many of your social interactions, that you can’t take with you when you leave. All of your messages, contacts, photographs, and other personal mementos stay behind. I regret ever joining.

That’s why Facebook is so insidious. If you must use it, use it only to contact your friends who are hard to contact via other means. But don’t use it for anything else. Use services that respect your rights and allow you to take your data with you. Don’t upload your photographs to Facebook just to show them to friends; use something better. Don’t send PMs via Facebook, send emails. You can always save emails with ease. I wish someone had told me this advice four years ago when I signed up with Facebook, as it would have saved me a lot of the grief I went through yesterday.

To those of you who are looking to quit Facebook but find the thought unfathomable, here is my advice: do it in stages. Use Facebook less and less, and make a conscious effort to transition everything you care about it off of it. Make sure to get non-Facebook contact information on all of your actual friends (IM usernames, email addresses, and cell phone numbers would be a good start). Transition your photographs off of Facebook into a web photo gallery that you are more in control of (something like Flickr or Photobucket would be a start, but hosting it on your own site would be ideal), then stop uploading new photos to Facebook altogether. Don’t use Facebook’s PM feature anymore; use SMS text messages, instant messages, or email instead. And then, finally, pick a date when you are going to leave Facebook for good and announce it on your Facebook profile, giving people time to reach you with any last essential contact information.

Then when the date comes, do the deed and never look back. I’m not going to say it’s easy. In fact, judging by my experience, I would say it’s immensely difficult. But that feeling you get when you’re finally free from Facebook, and all of your social interactions and personal information are yours again, makes it all worthwhile. I was sad yesterday, but I’m happy today, and so shall that feeling continue.

Security hole in MySpace leads to leak of private pictures

Thursday, January 31st, 2008

MySpace has had a security hole in it for months that allows anyone to access most photographs, even those of users who’ve set their profiles to private. It’s a simple URL hack; insert the user’s ID into an appropriately constructed URL for viewing photo galleries and you get full access. MySpace doesn’t have any real access control in this instance. News Corporation, the owner of MySpace, has been well aware of this bug for a damn long time, but they still haven’t fixed it. It makes you wonder if all those promises of making MySpace safer are nothing but noise.

Well, MySpace now has a bonfire lit under its feet, because a member of tribalwar.com downloaded a huge number of private pictures from MySpace and released them as a torrent. The torrent weighs in at 17 GB and contains 567,000 photographs. Naturally, I had to download it. A day later (thank you Verizon FIOS!), the download is complete, and I’ve been browsing through them just to see what kinds of pictures people upload to MySpace behind supposedly closed doors.

Most of the images aren’t that interesting. There are a lot of wedding or other formal occasion photos. There are lots of pictures of babies. There are lots of miscellaneous pictures of people mugging for the camera, often in a party environment with drinks in hand. After going through several hundred of the photographs, I could take it no longer. The signal to noise ratio is simply too low. Maybe there’ll be a best of torrent at some point?

But I did find three photos out of the ones that I looked at that are interesting. This is a bit of flavor of what the entire torrent likely contains:

Read the rest of this entry »

CompUSA closing for good

Saturday, December 8th, 2007

It’s with a good deal of sadness that I read recently that CompUSA is closing for good. Last year they underwent a major restructuring and closed down about half of their stores in an effort to restore profitability, but that plan apparently failed. The remaining stores will be closed down soon after this holiday shopping season.

I have a lot of fond memories from CompUSA. When I was younger, my dad would take me there and I would be in computer wonderland. It’s where we got all of our computer stuff: Keyboards, mice, floppy disks (and later blank CDs), joysticks, video cards, RAM, and especially games. Even back in middle school, I experienced more excitement going to CompUSA than going to a toy store. I loved that place. We would go there at least once a month, not necessarily even to buy anything, but just to see all of the new stuff that was coming out in the field that we loved. Believe it or not, CompUSA was once a happening place. We made it a routine part of our regular errands (much to the chagrin of my mother and sister).

But over time, things changed. Internet shopping caught on, and I started making the majority of my computer-related purchases online (especially at NewEgg). I couldn’t resist the lower prices and better selection. Also, we got a broadband Internet connection, and it suddenly became feasible to download games rather than paying for them in stores (and much easier on my slim teenaged budget).

And somewhere along the way, CompUSA got worse. Much, much, worse. When I revisited the local stores in recent years, CompUSA had become a shell of its former self. They had taken the use of rebates to extreme levels, with many products having two separate rebates that only got the price down to the normal sales price on NewEgg. Copying all of the rebate submission materials was a chore, and then inevitably one of the two would be rejected because of a photocopied UPC. A lot of the time the advertised price was an outright lie, because it factored in two different rebates that often could not be redeemed simultaneously. It was very off-putting.

CompUSA simply became obsolete. They branched out into more products, including televisions, cell phones, and gaming consoles, but couldn’t compete on a price basis with their competitors in any of those areas. They deserved to die out. But I’ll still have all of those fond memories of going to CompUSA during those halcyon days of my youthful nerddom and lusting after dozens of computer games and parts. I do the equivalent on NewEgg now, but it’s not quite the same.

Facebook neuters Beacon, but I won’t be back

Wednesday, December 5th, 2007

Facebook finally caved after weeks of protests and added a way for users to completely opt out of Beacon. Not that I care. This latest change is too little, too late, and there are no future assurances that Facebook won’t try something again in the future. I already quit Facebook and I’m not coming back.

If you haven’t kept up on this issue, let me explain. Beacon is a service that Facebook recently launched. It integrates with a bunch of online retailers, so anytime you buy something online it is automatically added to your Facebook feed. It was launched as an opt-out service, meaning it was automatically turned on for you unless you explicitly opted out. Needless to say, this ruined a lot of people’s days, including one husband’s who bought a ring for his wife for Christmas only to have it show up on his feed on Facebook and spoil the surprise when his wife read about it. There wasn’t even any way to opt out of Beacon globally; one had to opt out individually for each participating site, but only after something was added to one’s Beacon feed from that site. Needless to say, the original implementation was inexcusably terrible and privacy-infringing.

The new implementation is only slightly better. You are finally able to opt out of Beacon entirely, but you have to make that conscious choice to say you don’t want to do it. It should instead be opt-in, meaning you have to sign up to enable the Beacon service. But opting out of Beacon doesn’t even prevent Facebook from gathering all of the personal details about what you’re buying. It simply prevents them from displaying on the site. But rest assured, Facebook will be processing through all of that personal detail for profit.

Thus, my reasons for continuing to stay away from Facebook and urging everyone I know to do the same are twofold. One, this recent change isn’t a true opt out. It’s still enabled by default, and even when you do “opt out”, all of the privacy-infringing personal details are being recorded. All of the same bad things are going on behind the scenes. And secondly, the manner in which Facebook launched this new feature was atrocious. Time and time again they’ve added new privacy-infringing features (the previous one was the mini-feed) that many people don’t want, and made them enabled by default for all users. Simply put, I’ve lost all trust in the company, and I’m confident that they will continue with these shenanigans in the future. Why wouldn’t they? They stand to make a lot more profit by treating their customers as money plants to be farmed for profit than privacy-deserving human beings. The only way to avoid future impingements on your privacy is not to play the game. Quit Facebook now.