Tuesday, March 11, 2014

Investment Banks Interview Questions in Flex

This post is about the Flex interview questions generally asked by top investment banks.

Question: What is the need of clone() in custom event?
Question: What are the various performance considerations in Flex?
Question: What is the testing library used? What are the problems with FlexUnit?
Question:What is IDataRenderer interface and what is its importance?
Question:What is deep linking and how it works?
Question:How does marshalling and un-marshalling works in case of remoting?
Question: What is the use of registerClassAlias() method?
Question:What is the use of remote metadata tag?
Question: What is the use of Event metadata tag?
Question: What is the use of ArrayElementType metadata tag? If we specify it as String can we still add objects to the array?
Question: What is the difference between a dictionary and an object?
Question: How data is stored and retrieved in dictionary?
Question: What is the difference between dictionary and associative array?
Question:Can we use an object as an key in a dicitonary? If No then why?
Question: What is the performance problems with setStyle()?
Question: What are different ways of binding? What are their merits over others?
Question: What is an item renderer function? How is it different from label function?
Question: Have you used skinning?
Question: Have you written any custom component? If yes what are the various design considerations you have considered?
Question: What is the use of callLater() method?
Question: If we dont have overloading in ActionScript then how does we deal with it?
Question: What are the differences between ModuleLoader and ModuleManager?
Question: How can we deal with memory leaks in Flex modules?
Question: What is the difference between using BindingUtils and ChangeWatcher?
Question: What is ObjectProxy and how it is different from Object?
Question: How can two SWFs communicate to each other?

Tough/Tricky Ones
Question: We have a Flex datagrid displaying stock information where the price of the stock changes very frequently? If we make stock collection bindable where every stock value object is also bindable then every price update will redraw the grid. True or False?
Question: How can we optimize the code so that the screen is not frozen due to bombardment of so many messages?
Question: There can be thousands of stocks and when the stock price update comes we need to search the stock first before updating. How can we optimize this search?
Question: If we use item renderer for the price, Can we make sure that the item renderer refreshes itself automatically?
Question:  If we need to display price along with two arrows on right top (UP) and bottom (DOWN) showing price trend, what are the various considerations?
Answer: Here I will try to answer all the questions. If the collection is bindable along with every value object also bindable then price change will redraw the whole grid and it is a performance implication. If there will be many price updates it does not make sense to redraw the whole grid. We can rather control the updates in arraycollection (which is dataprovider of the grid) by overriding collection change handler.
We can avoid collection updates altogether and we can make every item renderer responsible for its own update. This idea is explained here. We can also make use of invalidateCell() method and it is pretty efficient. The beauty of this method is we can refresh the whole row or column or cell by specifying proper value for rowIndex and columnIndex. Also see this post.

We need not to make the whole stock value-object bindable. We can use BindingUtils to bind only price property of the object. When the price changes it will trigger the appropriate handler.
Now for the search part we can think of using a HashMap, actually a dictionary in Flex. We can keep the stock ticker (unique id) as key and the actual stock object as the value in it. We can search in constant time and then locate the stock object and then update the price. When we change the price it will also trigger the change handler as specified by BindingUtils. There can be many such scenarios further.
Question: How can we remove binding that is specified in MXML or by using Bindable tag?Question: What is the significance of ClassFactory?


Parsley
Question: How do we pass event/message from one module to another while using Parsley?
Question: What is the significance of scope property of a message in Parsley?
Question: Who are impacted by scope property dispatchers or receivers?
Question: What do we mean by custom context? How can we define one?
Question: If parent context has a class X and child context also has a class X then what will happen at the time of context initialization?
Question: If we provide different IDs to the instances of Class X in parent and child contexts, and then try to inject the class based on type what will happen? How can I fix it?


5 comments:

Unknown said...

Hi akhil,
Good work .. I appreciate your efforts ..

Reny Mohan said...

Great post! Helped me to recollect something :)

NAVEEN said...

Could you provide answers for these questions...

Akhil Mittal said...

Naveen,

Almost every question is answered in various posts on this blog. You only need to browse them.

Thanks,
Akhil

Akhil Mittal said...

Reny and Unknown,

Nice to hear that you liked it.

Thanks