Home  >  

Evaluation Questions for Flex Programmers

Author photo
February 25, 2010 | | Comments (4)
AddThis Social Bookmark Button

Sometimes I am asked to interview potential Flex programmers for clients. A common requirement is to assess the candidate's ability to design and develop custom components. Today's blog posting is dedicated to the hiring manager who called after regular business hours today.

The following code consists of several files. You will find seven questions embedded in the files. The questions should be answered in sequence, without looking ahead at the next file. All of these files compile and run without throwing errors. The first file does not contain any questions.

 

HireTest.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:tests="*"
xmlns:mx="http://www.adobe.com/2006/mxml">
<tests:MeasureTest1 />
<tests:CreateChildren1 />
<tests:DisplayList1 />
<tests:Sequence1 />
</mx:Application>

 

MeasureTest1.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas
height="300"
width="400"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
// 1) what does measure() do?
override protected function measure():void {
// 2) Why is this method never called?
}
]]>
</mx:Script>
<mx:Label text="Hello from MeasureTest1" />
</mx:Canvas>

 

CreateChildren1.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas
height="300"
width="400"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
// 3) what does createChildren() do?
override protected function createChildren():void {
// 4) Why doesn't the Label (below) display?
}
]]>
</mx:Script>
<mx:Label text="Hello from CreateChildren1" />
</mx:Canvas>

 

DisplayList1.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas
height="300"
width="400"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
// 5) what does updateDisplayList() do?
override protected function updateDisplayList(w:Number, h:Number):void {
// 6) Why doesn't the Label (below) display?
}
]]>
</mx:Script>
<mx:Label text="Hello from UpdateDisplayList1" />
</mx:Canvas>

 

Sequence1.mxml

<?xml version="1.0" encoding="utf-8"?>
   <mx:Canvas 
   height="400" 
   width="100%"
   xmlns:mx="http://www.adobe.com/2006/mxml">
   <mx:Script>
   <![CDATA[
   // 7) What will be displayed in textArea? 
   
   override protected function commitProperties():void {
     super.commitProperties();
     textArea.text += "commitProperties\n";
   }
   
   override protected function createChildren():void { 
     super.createChildren();
     textArea.text += "createChildren\n";
   }

   override protected function layoutChrome(w:Number, h:Number):void {
     super.layoutChrome(w, h);
     textArea.text += "layoutChrome\n";
   }
   
   override protected function measure():void { 
     super.measure();
     textArea.text += "measure\n";
     invalidateSize();
} override protected function updateDisplayList(w:Number, h:Number):void { super.updateDisplayList(w, h); textArea.text += "updateDisplayList\n"; invalidateProperties(); } ]]> </mx:Script> <mx:TextArea height="200" id="textArea" text="" width="100%" /> </mx:Canvas>


What are your favorite skill-testing questions for Flex programmers?

_______________________________

Mike Slinn
Independent Flex / Java contractor and author
http://slinnbooks.com
http://mslinn.com

Read more from Mike Slinn. Mike Slinn's Atom feed mslinn on Twitter

Comments

4 Comments

David Coletta said:

I like to show people an implementation of updateDisplayList() that is missing a call to Graphics.clear() and ask questions about it: 1) what's missing, 2) when should you call it, 3) what kind of things will happen if you don't call it.

Talking about event handling is good: capture phase, bubbling, etc.

Weak references vs. strong references: when do you have to use one or the other.

How do you change the default implementations of things, like skins and layout? What kinds of things are harder to change because they are exposed via Flex but implemented in Flash?

Jochen Szostek said:

Nice test. :)

Finally I know a bit more about how the Flex lifecycle works. Thanks!

Andrew Traviss said:

A useful test is to provide a mock up of a UI which invites deep nesting and poor choice of components and have the interviewee propose an MXML structure for it. If you set up the design right, you can test for quite a bit of knowledge in a compressed time frame. You also get some impression of general skills in the process.

Mitesh dave said:

Hi Mike,
Thanks for the info you posted .it certainly enhanced my understanding of component life cycle.you can certainly take advice of david colleta of adding few more questions as per his suggestion.But in want to thanks you for sharing the knowledge. :)

Leave a comment


Type the characters you see in the picture above.


Tag Cloud

Technical Speakers

Who is the best technical speaker you have seen?

Answer

Latest Features

Recommended for You

@InsideRIA on Twitter

Archives

  • Or, visit our complete archive.  

About This Site

Welcome to the premiere community site for all things RIA sponsored by O'Reilly Media and Adobe Systems Incorporated.