Category Archives: Technology

Programming Interview Tips

Behavioral Questions
Think about good examples you can describe from school (or internship) projects that were successful, in which you played an important role. Think about projects that went wrong initially and how the situation was corrected. What did you learn from the situation? what would you do different next time? think about a difficult bug you had to solve and how you approached the solution. Think about the different programming languages and which ones you like best and why. Always be very honest in your answers, since the interviewer can easily spot when you are making up stuff. Do not come across as the “perfect programmer”. Show that you have made some mistakes and have learn from them. Show that you have good communication skills, good team work skills, that you are a rapid learner, that you go the extra mile…

Technical Questions
Refresh some of the core CS concepts:

  • Data structures
    • Study some of the basic data structures:
      • array, list, tree, binary search tree (bsd), queue, heap, map (dict/hash), set
    • What are the main characteristics/properties of each structure?
    • What are the pros and cons of each structure?
    • What is the big-O complexity of the common operations (insert, find, delete, access) on these structures?
      • e.g accessing an element from an array is O(1), while on a list is O(n)
      • e.g searching for an element in a BSD is O(log n)
  • Algorithms
    • Learn some basic algorithms, know how they work, and what is their big-O complexity

During the technical interview: ask lots of questions to the interviewer. Repeat the problem statement to him to prove that you understood the problem. Verify assumptions with the interviewer: “is it ok to assume that this function will never receive a NULL string?”. It is ok to ask for help, don’t stay silent. Selecting the correct data structure for a solution usually takes you 80% there. Consider different data structures and always start with the simpler ones (array, list) before you jump into trees and graphs. Do some design before you implement any code. If you have access to paper / white board, draw your data structure, fill it with some sample data and verbally walk the interviewer through your solution. Write clean code, use good meaningful self documented variable names, use proper indentation. Pretend the interviewer is a coworker and work with him through the problem. This shows him that you are a person he would like to work with on a daily basis. The same goes for you, see if you would like to be on a team with this person.

Here are two books that help you prepare for a technical interview. I highly recommend getting at least one and solving some of the problems in them. And actually SOLVE the problems. Do not just read the answer, because if you do that, the solution wont stick in your brain. If you solve it, you won’t ever forget it.

  • Programming Interviews: The Insiders’ Guide Paperback by Adnan Aziz
  • Cracking the Coding Interview by Gayle Laakmann McDowell

Adnan Aziz has a website at UT and posted a PDF for free that includes a lot of content from one of the books, which you can download for free.

You should also look into online tools that help you prepare for programming interviews like:

  • LeetCode
  • HackerRank
  • InterviewCake

Hacked too

A few days ago, my fellow blogger Kirsch posted about his blog being hacked. Well, I was victim of the same attack. Both of our blogs run on DreamHost and use WordPress.

I found a detailed description of the attack here, however this description refers to a 2 year old attack. I highly doubt WordPress would go this long without a patch to fix the vulnerability.

Everything has been restored to normal thanks to my backups and tools provided by DreamHost.

Why can’t Skype have a slick user interface like Adium?

I read that Skype had released a beta of their latest version for OS X and decided to give it a try, hoping to see some improvements on the user interface, but I was really dissapointed. Why does it have such bulkier and wasteful user interface? Skype could learn a thing or two from Adium. Granted, I had to tweak Adium preferences a bit to get such slick and compact layout, but at least they give me the option to do so.

El centro de entretenimiento perfecto

El título de este artículo suena mucho mejor en inglés, pero ese es el precio que tengo que pagar, desde que decidí escribir en español.

Les presento mi nuevo centro de entretenimiento, que lejos de ser perfecto si está increible:

  • Televisión LCD de 42 pulgadas Westinghouse (VK-42F240S)
  • Mac Mini (MB138LL/A)
  • Amplificador Onkyo (TX-LR552)
  • Bocinas Wharfedale (Diamond 9.2)
  • Subwoofer JBL (PowerBass PB10)

Video digital: Mac Mini (salida: DVI) – TV (entrada: HDMI)
Audio digital: Mac Mini (salida: óptica) – Amplificador (entrada: óptica)

Lo mejor es poder tener toda mi colección de música centralizada en la Mac Mini y poder editar las fotografías que tomo en una pantalla enorme. Los videos de Hulu y los episodios de Lost en alta definición (HD) se ven fantásticos.

Soy feliz. (y soy del verde)

High dynamic range (HDR) imaging

High Dynamic Range (HDR) imaging is the process of taking several pictures of the same subject with different exposures and then combining all of them to produce an image with a wide range of intensity levels. In other words, HDR uses the pictures with longer exposure to obtain more detail and color on the darker parts of the picture and does the opposite with the pictures with short exposure. The end result is a picture that is closer to what your eyes actually see.

To produce an HDR image you take several pictures of the same subject using different exposures. You must use a tripod because you want all the pictures to align perfectly. At minimum you will take 3 pictures: one underexposed, one overexposed and one that is just normal (with the ‘right’ amount of exposure), but you can take more using different levels of under and over exposure.

Once you have the pictures, you need an imaging software to merge them. I first tried to follow these instructions using Gimp on my Ubuntu virtual image, but the process was really slow and the result wasn’t very good. Notice how the merged pictures don’t align perfectly:

Then I downloaded a trial version of Adobe Photoshop CS4 and the best thing is that it does all the merging and aligning for you and here is the result of that:

The result looks good, but I’m not impressed. I’ve seen really amazing HDR pictures on the web, so I’m going to keep experimenting with it and post any further progress I make with this technique.

Taking doodling one step up

I have to admit it: I am a doodler. I’ve done it since I was in elementary school, I did it in high school, college and I still do it at work. Wikipedia argues that doodling happens to students during boring classes. I don’t think that is my case: when I’m doodling at work I still pay attention to whatever is being discussed at the meeting. But I can understand how some people might see that as a sign of distraction.

Today I borrowed Marcospen tablet and gave it a try. I saw a tablet for sale at woot a few months ago and got curious about it. I must tell you it is more difficult to doodle on the tablet, but it is really fun. Here is the result:
Lincoln the turtle

Let’s get virtual

Almost a year ago I was posting about my new MacBook and how I installed Bootcamp in it to try it out. It was a fun test although I have only launched my Windows XP partition a couple of times in the past year. There is nothing I cannot run in OS X so having Windows XP on my MacBook has been pretty useless.

A few months ago I also successfully tried an Ubuntu Live CD. Ubuntu is a Linux distribution and a Live CD allows you to run the operative system without installing it in your computer.

Today I was reading the unofficial apple weblog and found out about VirtualBox: a virtualization open source software from Sun Microsystems. Up until now I knew that you could use VMWare (which I use at work) or Parallels on your Mac, but those were all commercial packages and I didn’t wanted to spend any money since all I wanted was to learn and experiment. I was really excited to find out that I could install Ubuntu on my Mac using VirtualBox for free.

Creating a new Virtual Machine (VM) was really simple and currently Ubuntu 8.04 is being installed as I write this post.

Ubuntu installation on VitualBox

It actually is taking me longer to write this post, than for Ubuntu to get installed on the VM. The installation is done, and now it is downloading 46 software updates which means that at least the network is working like a charm!

Ubuntu running on VitualBox on a MacBook

Now this is the bragging part of the post:
I can now run 3 freaking operative systems on my MacBook and if I create a Windows VM image I can run them simultaneously!

The world is no longer flat my friends.

Yes I did notice that the Ubuntu clock is one hour behind…