Question: I programmed in [MATLAB](http://www.mathworks.com/) for many years, but switched to using R exclusively in the past few years so I'm a little out of practice. I'm interviewing a candidate today who describes himself as a MATLAB expert. 

What MATLAB interview questions should I ask?

Some other sites with resources for this:

* ["Matlab interview questions" on Wilmott](http://www.wilmott.com/messageview.cfm?catid=10&threadid=51640)
* ["MATLAB Questions and Answers" on GlobaleGuildLine](http://www.globalguideline.com/interview_questions/Questions.php?sc=MATLAB_Interview_Questions_and_Answers)
* ["Matlab Interview Questions" on CoolInterview](http://www.coolinterview.com/type.asp?iType=453)

Answer: 
Possible question:
I have an array A of n R,G,B triplets. It is a 3xn matrix. I have another array B in the form 1xn which stores an index value (association to a cluster) for each triplet.

How do I plot the triplets of A in 3D space (using `plot3` function), coloring each triplet according to its index in B? (The goal is to qualitatively evaluate my clustering)

Really, really good programmers who are MATLAB novices won't be able to give you an efficient (== MATLAB style) solution. However, it is a very simple problem if you do know your MATLAB.
Depends a bit what you want to test. 

To test [MATLAB](http://en.wikipedia.org/wiki/MATLAB) fluency, there are several nice Stack Overflow questions that you could use to test e.g. array manipulations ([example 1](https://stackoverflow.com/questions/1903592/how-can-i-generate-the-following-matrix-in-matlab/1911977#1911977), [example 2](https://stackoverflow.com/questions/1846635/calculate-most-common-values)), or you could use fix-this problems like [this question](https://stackoverflow.com/questions/2462927/matlab-image-corner-coordinates-referncing-to-cell-arrays) (I admit, I'm rather fond of that one), or look into [this list](https://stackoverflow.com/questions/1710299/corner-cases-unexpected-and-unusual-matlab) for some highly MATLAB-specific stuff. If you want to be a bit mean, throw in a question like [this one](https://stackoverflow.com/questions/2142826/mapping-2-vectors-help-to-vectorize), where the best solution is a loop, and the typical MATLAB-way-of-thinking solution would just fill up the memory.

However, it may be more useful to ask more general programming questions that are related to your area of work and see whether they get the problem solved with MATLAB.

For example, since I do image analysis, I may ask them to design a class for loading images of different formats (a MATLAB expert should know how to do OOP, after all, it has been out for two years now), and then ask follow-ups as to how to deal with large images (I want to see a check on how much memory would be used - or maybe they know `memory.m` - and to hear about how MATLAB usually works with doubles), etc.