.NET and Flex and Action Script3 (AS3) BAZEDS,Cairngrom,Robotlegs




1.Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.
2. What’s the difference between Response.Write() andResponse.Output.Write()?Response.Output.Write() allows you to write formatted output.

3. What methods are fired during the page load?Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.

4. When during the page processing cycle is ViewState available?
After the Init() and before the Page_Load(), or OnLoad() for a control.

5. What namespace does the Web page belong in the .NET Framework class hierarchy?System.Web.UI.Page

6. Where do you store the information about the user’s locale?System.Web.UI.Page.Culture

7. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?CodeBehind is relevant to Visual Studio.NET only.

8. What’s a bubbled event?When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

9. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");

10. What data types do the RangeValidator control support?Integer, String, and Date.

11. Explain the differences between Server-side and Client-side code?Server-side code executes on the server. Client-side code executes in the client's browser.

12. What type of code (server or client) is found in a Code-Behind class?The answer is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.

13. Should user input data validation occur server-side or client-side? Why?All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.

14. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the user's browser to another page or site. This performas a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.

15. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?Valid answers are:
· A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.· A DataSet is designed to work without any continuing connection to the original data source.· Data in a DataSet is bulk-loaded, rather than being loaded on demand.· There's no concept of cursor types in a DataSet.· DataSets have no current record pointer You can use For Each loops to move through the data.· You can store many edits in a DataSet, and write them to the original data source in a single operation.· Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

16. What is the Global.asax used for?The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.

17. What are the Application_Start and Session_Start subroutines used for?This is where you can set the specific variables for the Application and Session objects.

18. Can you explain what inheritance is and an example of when you might use it?When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class.

19. Describe the difference between inline and code behind.Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.

20. Explain what a diffgram is, and a good use for one?The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.

21. Whats MSIL, and why should my developers need an appreciation of it if at all?MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.

22. Which method do you invoke on the DataAdapter control to load your generated dataset with data?The Fill() method.

23. Can you edit data in the Repeater control?No, it just reads the information from its data source.

24. Which template must you provide, in order to display data in a Repeater control?ItemTemplate.

25. How can you provide an alternating color scheme in a Repeater control?Use the AlternatingItemTemplate.

26. What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?You must set the DataSource property and call the DataBind method.

27. What base class do all Web Forms inherit from?The Page class.

28. Name two properties common in every validation control?ControlToValidate property and Text property.

29. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?DataTextField property.

30. Which control would you use if you needed to make sure the values in two different controls matched?CompareValidator control.

31. How many classes can a single .NET DLL contain?It can contain many classes.


Web Service Questions

1. What is the transport protocol you use to call a Web service?SOAP (Simple Object Access Protocol) is the preferred protocol.

2. True or False: A Web service can only be written in .NET?False

3. What does WSDL stand for?Web Services Description Language.

4. True or False: To test a Web service you must create a Windows application or Web application to consume this service?False, the web service comes with a test page and it provides HTTP-GET method to test.


State Management Questions

1. What is ViewState?ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postabacks.

2. What is the lifespan for items stored in ViewState?Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).

3. What does the "EnableViewState" property do? Why would I want it on or off?It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.

4. What are the different types of Session state management options available with ASP.NET?
ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.
What is an application server?
As defined in Wikipedia, an application server is a software engine that delivers applications to client computers or devices. The application server runs your server code. Some well known application servers are IIS (Microsoft), WebLogic Server (BEA), JBoss (Red Hat), WebSphere (IBM).

What is a base class and derived class?
A class is a template for creating an object. The class from which other classes derive fundamental functionality is called a base class. For e.g. If Class Y derives from Class X, then Class X is a base class.
The class which derives functionality from a base class is called a derived class. If Class Y derives from Class X, then Class Y is a derived class.
What is an extender class?
An extender class allows you to extend the functionality of an existing control. It is used in Windows forms applications to add properties to controls.

What is inheritance?
Inheritance represents the relationship between two classes where one type derives functionality from a second type and then extends it by adding new methods, properties, events, fields and constants.
C# support two types of inheritance:
· Implementation inheritance
· Interface inheritance
What is implementation and interface inheritance?
When a class (type) is derived from another class(type) such that it inherits all the members of the base type it is Implementation Inheritance.When a type (class or a struct) inherits only the signatures of the functions from another type it is Interface Inheritance.In general Classes can be derived from another class, hence support Implementation inheritance. At the same time Classes can also be derived from one or more interfaces.
What is inheritance hierarchy?
The class which derives functionality from a base class is called a derived class. A derived class can also act as a base class for another class. Thus it is possible to create a tree-like structure that illustrates the relationship between all related classes. This structure is known as the inheritance hierarchy.
How do you prevent a class from being inherited?
In VB.NET you use the NotInheritable modifier to prevent programmers from using the class as a base class. In C#, use the sealed keyword.
Define Overriding?
Overriding is a concept where a method in a derived class uses the same name, return type, and arguments as a method in its base class. In other words, if the derived class contains its own implementation of the method rather than using the method in the base class, the process is called overriding.
Can you use multiple inheritance in .NET?
.NET supports only single inheritance. However the purpose is accomplished using multiple interfaces.
Why don’t we have multiple inheritance in .NET?
There are several reasons for this. In simple words, the efforts are more, benefits are less. Different languages have different implementation requirements of multiple inheritance. So in order to implement multiple inheritance, we need to study the implementation aspects of all the languages that are CLR compliant and then implement a common methodology of implementing it. This is too much of efforts. Moreover multiple interface inheritance very much covers the benefits that multiple inheritance has.
What is an Interface?
An interface is a standard or contract that contains only the signatures of methods or events. The implementation is done in the class that inherits from this interface. Interfaces are primarily used to set a common standard or contract.
What are events and delegates?
An event is a message sent by a control to notify the occurrence of an action. However it is not known which object receives the event. For this reason, .NET provides a special type called Delegate which acts as an intermediary between the sender object and receiver object.
What is business logic?
It is the functionality which handles the exchange of information between database and a user interface.
What is a component?
Component is a group of logically related classes and methods. A component is a class that implements the IComponent interface or uses a class that implements IComponent interface.
What is a control?
A control is a component that provides user-interface (UI) capabilities.
What are design patterns?
Design patterns are common solutions to common design problems.
What is a connection pool?
A connection pool is a ‘collection of connections’ which are shared between the clients requesting one. Once the connection is closed, it returns back to the pool. This allows the connections to be reused.
What is a flat file?
A flat file is the name given to text, which can be read or written only sequentially.
What are functional and non-functional requirements?
Functional requirements defines the behavior of a system whereas non-functional requirements specify how the system should behave; in other words they specify the quality requirements and judge the behavior of a system.
E.g.Functional - Display a chart which shows the maximum number of products sold in a region.Non-functional – The data presented in the chart must be updated every 5 minutes.
What is the global assembly cache (GAC)?
GAC is a machine-wide cache of assemblies that allows .NET applications to share libraries. GAC solves some of the problems associated with dll’s (DLL Hell).
What is a stack? What is a heap?
Stack is a place in the memory where value types are stored. Heap is a place in the memory where the reference types are stored.
What is instrumentation?
It is the ability to monitor an application so that information about the application’s progress, performance and status can be captured and reported.
What is code review?
The process of examining the source code generally through a peer, to verify it against best practices.
What is logging?
Logging is the process of persisting information about the status of an application.
What are mock-ups?
Mock-ups are a set of designs in the form of screens, diagrams, snapshots etc., that helps verify the design and acquire feedback about the application’s requirements and use cases, at an early stage of the design process.
What is a Form?
A form is a representation of any window displayed in your application. Form can be used to create standard, borderless, floating, modal windows.
What is a multiple-document interface(MDI)?
A user interface container that enables a user to work with more than one document at a time. E.g. Microsoft Excel.
What is a single-document interface (SDI) ?
A user interface that is created to manage graphical user interfaces and controls into single windows. E.g. Microsoft Word
What is BLOB ?
A BLOB (binary large object) is a large item such as an image or an exe represented in binary form.
What is ClickOnce?
ClickOnce is a new deployment technology that allows you to create and publish self-updating applications that can be installed and run with minimal user interaction.
What is object role modeling (ORM) ?
It is a logical model for designing and querying database models. There are various ORM tools in the market like CaseTalk, Microsoft Visio for Enterprise Architects, Infagon etc.
What is a private assembly?
A private assembly is local to the installation directory of an application and is used only by that application.
What is a shared assembly?
A shared assembly is kept in the global assembly cache (GAC) and can be used by one or more applications on a machine.
What is the difference between user and custom controls?
User controls are easier to create whereas custom controls require extra effort.User controls are used when the layout is static whereas custom controls are used in dynamic layouts.A user control cannot be added to the toolbox whereas a custom control can be.A separate copy of a user control is required in every application that uses it whereas since custom controls are stored in the GAC, only a single copy can be used by all applications.
Where do custom controls reside?
In the global assembly cache (GAC).
What is a third-party control ?
A third-party control is one that is not created by the owners of a project. They are usually used to save time and resources and reuse the functionality developed by others (third-party).
What is a binary formatter?
Binary formatter is used to serialize and deserialize an object in binary format.
What is Boxing/Unboxing?
Boxing is used to convert value types to object.
E.g. int x = 1;
object obj = x ;
Unboxing is used to convert the object back to the value type.
E.g. int y = (int)obj;
Boxing/unboxing is quiet an expensive operation.
What is a COM Callable Wrapper (CCW)?
CCW is a wrapper created by the common language runtime(CLR) that enables COM components to access .NET objects.
What is a Runtime Callable Wrapper (RCW)?
RCW is a wrapper created by the common language runtime(CLR) to enable .NET components to call COM components.
What is a digital signature?
A digital signature is an electronic signature used to verify/gurantee the identity of the individual who is sending the message.
What is garbage collection?
Garbage collection is the process of managing the allocation and release of memory in your applications.
What is globalization?
Globalization is the process of customizing applications that support multiple cultures and regions.
What is localization?
Localization is the process of customizing applications that support a given culture and regions.



FLEX:

Q 1. Types of Binding
Ans: Using the curly braces ({}) syntax
Using ActionScript expressions in curly braces
Using the tag in MXML
Using bindings in ActionScript(BindingUtils)

Q 2. How to create your own event
Ans: Creating a subclass from the Event class
Using the Event metadata tag
Dispatching an event

Q 3. Event Bubbling
Ans: The mechanism through which event objects are passed from the objects that generates an event up through the containership hierarchy

Q 4. Life cycle of Flex Application/Component?
Ans: Preinitialize: The application has been instantiated but has not yet created any child components.
Initialize: The application has created child components but has not yet laid out those components.
creationComplete: The application has been completely instantiated and has laid out all components

Q 5. How you implement MVC in your Application
Ans: Cairngorm is based on the MVC model. It is specifically designed to facilitate complex state and data synchronization between the client and the server, while keeping the programming of the View layer detached from the data implementation.
The role of the View layer in a Cairngorm application is to throw events and bind to data stored in the Model. Components on the View can bind to Value Objects or other properties in the Model (data) layer.
In a Cairngorm Model, related data are stored in Value Objects (VOs), while simple variables can be stored as direct properties of the ModelLocator class. A static reference to the ModelLocator singleton instance is used by the View layers to locate the required data.
The Controller is the most sophisticated part of the Cairngorm architecture. The Controller layer is implemented as a singleton FrontController. The FrontController instance, which receives every View-generated event, dispatches the events to the assigned Command class based on the event's declared type.
The Command class then processes the event by running the Command class' execute() method, which is an ICommand interface method. The event object may include additional data if required by the developer. The execute() method can update the central Model, as well as invoke a Service class which typically involves communication with a remote server. The IResponder interface, which is also implemented by the Command class, includes onResult and onFault methods to handle responses returned from the invoked remote service.

Q 6. Difference btw Java and Flex Getters Setters
Ans: When it comes to getters and setters, Java and AS are quite different, in that getters and setters are part of the core ECMAScript language, whereas in Java, getters and setters are done through a naming convention.
In Java, it is almost never a good idea to make member variables public. If you do decide to make member variables public and then later want to change the interface to use getter/setter functions, you will have to modify all callers of your interfaces, which is onerous at best and in many cases, not possible (expecially when you are creating code that is used by other people).
Meanwhile, in ECMAScript, the externally visible interface doesn’t change when I go from a member variable to a getter/setter and back again. In some sense, the interface hiding is already accomplished in the language. Creating public member variables is “safe” in this sense.
Perhaps this is already obvious to all the AS-heads out there, but it took me a bit of time to get used to the concept.

Q 7. How many events are fired when your focus goes in one text box, you enter some text and then press tab.
Ans: PreinitializeHandler(), initializeHandler(), itemEditBegin, itemEditEnd, creationComplete()

Q 8. How you use styles different ways of using Style sheet
Ans: Using external style sheets, Using local style definitions, Using the StyleManager class ,Using the setStyle() and getStyle() methods, Using inline stylesLoading style sheets at run time

Q 9. How can you use two Styles at the same time
Ans: Using external style sheets and use Inline style commands

Q 10. Try to remember properties of few imp components
Ans:
< id="WeatherService" wsdl="http:/example.com/ws/WeatherService?wsdl" useproxy="false">
< !-- Bind the value of the ZIP code entered in the TextInput control to the ZipCode parameter of the GetWeather operation. -->
< name="GetWeather">
<>{zip.text}
< /mx:request>
< /mx:operation>


Q 11. What is the difference between Flex 2.0 and Flex 3.0
Ans: Enhanced Features like Faster compilation time, SWF file size reduction, Flex/Ajax bridge, Advanced Datagrid, Interactive debugging, Cross-Domain, Versionable, Easy to Use,Security and Code Signing,Failover and Hosting,Cross-Domain RSL, Advanced DatagridDeep Linking, Resource Bundles and Runtime Localization, Flex Component Kit for Flash CS3, Compilation, Language IntelligenceRefactoring, Class Outline,Code Search, Profiler, Module Support, Multiple SDK Support, Skin Importer, Design View Zoom/Pan,Design Mode support for ItemRenderers, Advanced Constraints, CS3 Suite integration, CSS Outline, CSS Design View, Flex 3 SDK Skinning/Style Enhancements

Q 12. How will you call Java method from Flex?
Ans: Using RemoteObject. Explain the process to interviewer

Q 13. What are the config files used for connecting Java and Flex?
Ans:
data-management-config.xml,
messaging-config.xml,
proxy-config.xml,
remoting-config.xml,
services-config.xml

Q 14. What are the channels and their types
Ans: The Channel class is the base message channel class that all channels in the messaging system must extend.
Channels are specific protocol-based conduits for messages sent between MessageAgents and remote destinations. Preconfigured channels are obtained within the framework using the ServerConfig.getChannel() method. You can create a Channel directly using the new operator and add it to a ChannelSet directly
In Flex AMFChannel is used mostly. Action Message Format
Methods
applySettings (),connect(),connectFailed(),connectSuccess(), connectTimeoutHandler()
disconnect(),disconnectFailed(),disconnectSuccess(),flexClientWaitHandler(), getMessageResponder(),internalConnect(),internalDisconnect(),internalSend(),logout()
send(),setCredentials()
Properties
authenticated,channelSets,connected,connectTimeout,endpoint,failoverURIs,protocol,
reconnecting,recordMessageSizes,recordMessageTimes,requestTimeout,uri

Q 15. Give the name of Collection which can be mapped to java and Flex and vice-versa
Ans: java.lang.String String
java.lang.Boolean, boolean Boolean
java.lang.Integer, int int
java.lang.Short, short int
java.lang.Byte, byte[] int
java.lang.Byte[] flash.utils.ByteArray
java.lang.Double, double Number
java.lang.Long, long Number
java.lang.Float, float Number
java.lang.Character, char String
java.lang.Character[], char[] String
java. math.BigInteger String
java.math.BigDecimal String
java.util.Calendar Date
java.util.Date Date
java.util.Collection mx.collections.ArrayCollection(for example, java.util.ArrayList)java.lang.Object[] Arrayjava.util.Map Object (untyped). For example, a java.util.Map[] is converted to an array (of objects).
java.util.Dictionary Object (untyped)
org.w3c.dom.Document XML object
java.lang.Object (other than previously listed types) Typed Object
Objects are serialized by using JavaBean introspection rules and also include public fields. Fields that are static, transient, or nonpublic, as well as bean properties that are nonpublic or static, are excluded.

Q 16. How can you call JavaScript from MXML
Ans: IExternalInterface.call()

Q 17. How can you access a var defined in 1 MXML flex in to another MXML file
Ans: Create 1 object of MXML fiel into another MXML File

Q 18. Is it possible to make httpService Requests synchronous?
Ansvar mytoken:AsyncToken = yourservice.send();
mytoken.addResponder(new ItemResponder(function,errorFunction));
OR
You can create a result handler to your HTTPService.
remoteObjectName.Your method
name.addEventListener("result",HandlerFunction,false,0,true);

Q 19. I need to load an image from flickr into my application. Do I need a crossdomain.xml file on flickr?
Ans: every SWF file you view runs locally on your machine. This means that a SWF would have HTTP access to all machines behind the company firewall. To prevent this, every server other than the one the SWF is loaded from, needs to have a crossdomain.xml file in its root, listing all domains that have access to that particular server

Q 20. What is the difference between httpService and Data Service?
Basically, Flex allows three types of RPC services: HttpService, WebServices, and RemoteObject Services. In Flex, using the “RemoteObjects specifies named or unnamed sources and connects to an Action Message Format (AMF) gateway, whereas using the HTTPService and WebService use named services or raw URLs and connect to an HTTP proxy using text-based query parameters or XML”. Specifically, HTTPServices use raw HTTP requests, WebServices use the SOAP protocol and RemoteObjects uses AMF3.

Q 21. How do you generate random numbers within a given limit with actionscript?
Ans:var randNum:Number = Math.random()*100;

Q 22. Have you built any components with actionscript? If so explain how you did it?
Ans:
package myComponents{
import mx.controls.Button;
public class MyButton extends Button {
public function MyButton() {
super();
label="Submit";
}}}

Q 23. How do you implement push on a flex applications?
Ans
Messaging systems let separate applications communicate asynchronously as peers by passing packets of data called messages back and forth through a Message Service. A message usually consists of a header and a body. The header contains an identifier and routing information. The body contains application data.

So, you will be building an application that allows you to asynchronously send data through the DS message service to our Flex client application. Here are some key DS messaging terms:

Producer: Producers are applications that create/send messages to the destination.
Consumer: Consumers are applications that receive messages from the destination.
Message Destination: Destinations are the resources used for both publish-subscribe and point-to-point messaging.
Message Channel: The channel is the method for connecting producers and consumers to the destination (using an endpoint).
Message Endpoint: An endpoint is the interface responsible for encoding and decoding data into messages.
Message Adaptor: The adaptor defines the messaging implementation. Options include using the ActionScriptAdapter provided with DS, or an external Java Message Service (JMS) provider.

Q 24. I am going to add images into a tag. How will it resize itself?

Q 25. What is a resource Manager??

Q 26. What are the similarities between java and flex?

Q 27. What is the dynamic keyword used for?

Q 28. How do you implement push with flex data services?

Q 29. What are the methods called when a UI component is intialized?

Q 30. How do you implement drag and drop on components that do not support ondrag and ondrop?

Q 31. Can you write to the file system from flex?

Q 32. What is a drag manager?
Ans: Manages the drag-and-drop operations; for example, its doDrag() method starts the drag operation.

Q 33. How do you call javascript from Flex?
Ans:flash.external.ExternalInterface.call(function_name: String[, arg1, ...]):Object;

Q 34. How do you use a repeater?
Ans:
< id="rp" dataprovider="{dp}">
< height="49" width="50" click="Alert.show(String (event.currentTarget.getRepeaterItem()) + ' pressed')" label="{String (rp.currentItem)}">
< /mx:repeater>

Q 35. What are three ways to skin a component in flex?
Ans: Graphical skins: Images that define the appearance of the skin. These images can JPEG, GIF, or PNG files, or they can be symbols embedded in SWF files. Typically you use drawing software such as Adobe® PhotoShop® or Adobe® Illustrator® to create graphical skins.
Programmatic skins: ActionScript or MXML classes that define a skin. To change the appearance of controls that use programmatic skins, you edit an ActionScript or MXML file. You can use a single class to define multiple skins.
Stateful skins: A type of programmatic skin that uses view states, where each view state corresponds to a state of the component.The definition of the view state controls the look of the skin. Since you can have multiple view states in a component, you can use a single component to define multiple skins.

Q 36. How do you use css styles in flex?
Ans: Using external style sheets, Using local style definitions, Using the StyleManager class ,Using the setStyle() and getStyle() methods, Using inline stylesLoading style sheets at run time.

Q 37. What is the difference between sealed class and dynamic classes?
Ans: Sealed Classes: ActionScript 3.0 introduces the concept of sealed classes. A sealed class possesses only the fixed set of properties and methods that were defined at compile time; additional properties and methods cannot be added. This enables stricter compile-time checking, resulting in more robust programs. It also improves memory usage by not requiring an internal hash table for each object instance. Dynamic classes are also possible using the dynamic keyword. All classes in ActionScript 3.0 are sealed by default, but can be declared to be dynamic with the dynamic keyword.
Dynamic classes A dynamic class defines an object that can be altered at run time by adding or changing properties and methods. A class that is not dynamic, such as the String class, is a sealed class. You cannot add properties or methods to a sealed class at run time.
dynamic class Protean
{ //Use dynamic keyword before the name of class
}

Q 38. What is e4X and XML?
Ans: E4X means "ECMAScript For XML
Using E4X, we can develop code with XML data faster than was possible with previous programming techniques. E4X provides a set of classes and functionality for working with XML data. ActionScript 3.0 includes the following E4X classes: XML, XMLList, QName, and Namespace.
Here is an example of manipulating data with E4X:
var myXML:XML =
<>
< id="'1'">
<>burger
<>3.95
< /item>
< id="'2'">
<>fries
<>1.45
< /item>
< /order>
trace (myXML.item[0].menuName); // Output: burger
trace (myXML.item.(@id==2).menuName); // Output: fries
trace (myXML.item.(menuName=="burger").price); // Output: 3.95

Q 39. What is state? What is the difference between states and ViewStack?
Ans:View Stack is to handle different MXML file eg TAB control, and states is the transition within single MXML file

Q 40. How does item renderer work? How do I add item renderer at runtime?

Q 41.. What keyword allows you to refer to private variables of a class?

Q 42. How polymorphism works on actionscript?

Q 43.. How do you overload functions in actionscript?

Q 44. What is dynamic keyword used for?
Ans: Those Classes which should be extended and changed are called Dynamic classes

Q 45. What are sealed classes?
Ans: Classes whichyou cant extend. ex String

Q 46. What are runtime shared libraries?

Q 47. What is caringhorm? How do you use it? Have you worked with Cairngorms?

Q 48. What keyword allows you to implement abstraction better?

Q 49. What design patterns have you used? In Actionscript and java?

Q 50. What's the difference between Java and AS3 getters and setters? Ans: I have to explicitly call a setter/getter function in Java, while AS3 allows me to Access my setters and getters as though they are variables.
Q 51. Explain the component lifecycle.
Q 52. Tell me about dataServices
Q 53. understanding of MVC
Q 54. They ask what frameworks you aree familiar with When getting developers to help create "standard" application, I'd weight a lot more heavily on the as3 questions. Aside from basic "show me how you'd write X" algorithm questions, you can ask more in depth ones about the workings of the language:
Q 55. Explain how binding works in mxml components.

Q 56. Explain the ChangeWatcher.Wach()
Ans: You can detect when a binding occurs in your application. Flex includes the mx.binding.utils.ChangeWatcher class that you can use to define a watcher for a data binding. Typically, your event watcher invokes an event listener when the binding occurs

Q 57. Why would you want to keep a reference to a ChangeWatcher and call unwatch()?
Q 58. How do you add event listeners in mxml components. Now AS3 components?
Q 59. What does calling preventDefault() on an event do? How is this enforced?
Ans: Prevent defaults helps skipping the default behaviour or any componnent. Like in radio Button when you will click it will get selected, but if you want only the skin to be changed you can use preventDefault()

Q 60. (If applicable) Explain the lifecycle of a Cairngorm action.

Q 61. I was interviewed for a Flex position. The hiring manager kept on asking Java and J2EE questions. So, I asked him politely: you are hiring me for a flex position, why do you keep on asking Java questions?
Q 62. What are some ways to specify styles on components?

Q 63. What is the problem with calling setStyle()
Ans: When you are instantiating an object and setting the styles for the first time, you should try to apply style sheets rather than use the setStyle() method because it is computationally expensive. This method should only be used when you are changing an object's styles during run time
Q 64. Explain the difference between creating an effect and setting the target as opposed to adding an effectListener
Q 65. What do repeater components do?
Q 66. How do you identify a component created in a repeater?

Q 67. What is state? What is the difference between states and ViewStack? Ans: View Stack is to handle different MXML file eg TAB control.And states is the transition within single MXML file ViewStack should be used where there is complete change in the controls used and States should be used when you just want to add or remove afew components based on certain conditions. Login/Registration/Forgot password is the best example for using States as each page will either add or remove to the already existing one.

Q 68. What is the difference between httpService and Data Service? Ans. The Flex presentation layer communicates with the business layer by using Flex data services, which are objects you insert in a Flex file. Specifically, you can use Flex data services to interact with the following:
* Web services
* HTTP services
* Remote objects
A Flex data service is an object you insert in an MXML file to communicate with the business layer of a multi-tier application. You use data services to send and receive data from web services, HTTP URLs, and remote objects such as server-based Java objects. An HTTP service is nothing more than an HTTP request to a URL. The primary purpose of HTTP services is to retrieve XML data from an external source.

Q 69. Why you don’t Embed all images in your application
Ans: That increases the size of the SWF File

Q 70. What type of images can be loaded
Ans: (PNG, GIF, JPEG, SWF at run time and PNG, GIF, JPEG, SWF, SVG at compile time)

Q 71. Explain ContainerCreationPolicy
Ans: This is used with the containers like Accordian, ViewStack etc. depending upon the ContainerCreationPolicy you have set accordingly the child pages will be loaded.
ALL Immediately create all descendants.
AUTO: Delay creating some or all descendants until they are needed.
NONE: Do not create any children.
QUEUED: Add the container to a creation queue.

Q 72. What are the factory classes
Ans: Factory class The factory class creates an object of the instance class to perform the effect on the target. You create a factory class instance in your application, and configure it with the necessary properties to control the effect, such as the zoom size or effect duration.

Q 73. Explain Metadata
Ans: You insert metadata tags into your MXML and ActionScript files to provide information to the Adobe Flex compiler. Metadata tags do not get compiled into executable code, but provide information to control how portions of your code get compiled.

Q 74. I was asked too many questions on the event bubbling, Like how to capture and event if the component is disabled.
Ans: addEventListner on the parents and enable the component in that handler

Q 75. obj.addEventListener(MouseEvent.CLICK, MouseClickHAndler); in this obj should inherit which class?
Ans: DispachEvent
You can manually dispatch events using a component instance's dispatchEvent() method. All components that extend UIComponent have this method
objectInstance.dispatchEvent(event:Event):Boolean

Q 76.Why we extent Sprite Class in our Graphical Classes?

Q 77.What is Layout Manager and explain the Properties and Methods?
AnsThe LayoutManager is the engine behind Flex's measurement and layout strategy. Layout is performed in three phases; commit, measurement, and layout.
The commit phase begins with a call to validateProperties(), which walks through a list (sorted by nesting level) of objects calling each object's validateProperties()method.

The objects in the list are processed by nesting order, with the most deeply nested object accessed first. This can also be referred to as bottom-up inside-out ordering.

The measurement phase begins with a call to validateSize(), which walks through a list (sorted by nesting level) of objects calling each object's validateSize() method to determine if the object has changed in size.

The layout phase begins with a call to the validateDisplayList() method, which walks through a list (reverse sorted by nesting level) of objects calling each object's validateDisplayList() method to request the object to size and position all components contained within it (i.e. its children).

Property of LayoutManager
usePhasedInstantiation : Boolean
A flag that indicates whether the LayoutManager allows screen updates between phases.

Q 78.How do you call a method in particular ItemRenderer. Also the ItemRenderer is your own Custom Component.
Ans
<>
< id="comboBox" dataprovider="{statesXMLList}" labelfield="@name" itemrenderer="ComboBoxItemRenderer">
< /mx:Application>
View ComboBoxItemRenderer.mxml
< ?xml version="1.0" encoding="utf-8"?>

< mx="http://www.adobe.com/2006/mxml" stylename="plain">
< text="{data.@name}" onclick="MyOwnMethodThatIWantToCall()">
< /mx:VBox>

Q 79.How can you implement Singleton in Flex Application?
Ans:If you are a Java Programmer dont be mistaken by saying create Private Constructor. We cant create private Constructor in Flex.

Q 80.Give similiarities btw Java and Flex
Ans: Both are object Oriented, Encapsulation, Inheritance, Abstraction and Polymorphism are implemeted in both of the technologies.
*The package like imports
*Availability of Classes in the scripting language
*Capabilities Arrays & ArrayCollections
*On the UI end, similarities to SWING

Mostly Asked Flex FAQ's:
1) What’s the difference between Java and AS3 getters and setters?(*)
In Java, getter and setter methods have to be explicitly called.
While in AS3, they’re called automatically and externally
indistinguishable from public properties.
For instance trace(myClass.foo) might be referencing a public property
or it might be referencing the method “public get foo():Object”.  It
makes no difference to an external class.

You can expand on this a bit more to describe why this is useful.  The
implications are that, unlike in Java, all variables in a class are
generally public.  Java standard practices are to create only public
getters and setters while keeping the variables private.  The reason
for only allowing methods to be publicly accessible is so that 1) they
can be overridden and 2) their implementation can change without
altering class interface.
AS3 addresses both of these concerns because, as described above, a
public property can be replaced with a getter and setter without
changing the interface.  And an inherited public property can actually
be overridden by a subclass.
For example, this is valid:
public class A
{
public var foo:Object;
}
public class B extends A
{
override public function get foo():Object{return ‘bar’};
override public function set foo(value:Object):void{};
}
2) Explain how binding works in mxml components.
or
Explain 3 different ways to achieve data binding
Data binding is the process of tying the data in one object to another object. It provides a convenient way to pass data around in an application. Adobe Flex 2 provides three ways to specify data binding: the curly braces ({}) syntax tag in MXML and the BindingUtils methods in ActionScript. and the
Data binding requires a source property, a destination property, and a triggering event that indicates when to copy the data from the source to the destination. To use a property as the source of a data binding expression, the component must be implemented to support data binding, which means that the component dispatches an event when the value of the property changes to trigger the binding.
At compile time, the MXML compiler generates code to create ActionScript Watcher and Binding objects that correspond to the binding tags and expressions found in an MXML document. At run time, Watcher objects are triggered by change events that come from the constituent parts of binding source expressions; the Watcher objects then trigger Binding objects to execute bindings.
When you specify a property as the source of a data binding, Flex monitors not only that property for changes, but also the chain of properties leading up to it. The entire chain of properties, including the destination property, is called a “bindable property chain“. In the following example, firstName.text is a bindable property chain that includes both a firstName object and its text property:
{firstName.text}
Its not necessary that the binding executes automatically. In the following case the binding wont execute automatically as expected.
  1. Binding does not execute automatically when you change an entire item of a dataProvider property.
  2. Binding also does not execute automatically for subproperties of properties that have [Bindable] metadata.
  3. Binding also does not execute automatically when you are binding data to a property that Flash Player updates automatically, such as the mouseX property.
The executeBindings() method of the UIComponent class executes all the bindings for which a UIComponent object is the destination. All containers and controls, as well as the Repeater component, extend the UIComponent class. The executeChildBindings() method of the Container and Repeater classes executes all of the bindings for which the child UIComponent components of a Container or Repeater class are destinations. All containers extend the Container class. However, you should only use the executeBindings() method when you are sure that bindings do not execute automatically.
3) What’s the difference between ChangeWatcher.watch, and BindingUtils.bindProperty?
4) Why would you want to keep a reference to a ChangeWatcher and call unwatch()?
5)How does Flex event system works?
6) What is event Bubbling?
The mechanism through which event objects are passed from the objects that generates an event up through the containership hierarchy
7) How do you add event listeners in mxml components and AS3 components?
8) What does calling preventDefault() on an event do?  How is this enforced?
9)What is the difference between Flex 2.0 and Flex 3.0?
These are some of the differences :
  • Native support for Adobe AIR – Flex 3 introduces new components and incorporates the Adobe AIR development tools into the SDK and Flex Builder.
  • Persistent framework caching – You can make Flex 3 applications as small as 50K when leveraging the new Flash Player cache for Adobe platform components. In fact the size of the resulting swf size had reduced for a larger bit.
  • Flex Builder productivity enhancements – Flex Builder 3 introduces refactoring support, new profilers for performance and memory tuning, and code generation tools for data access.
  • Integration with Creative Suite 3 – The Flex Component Kit for Flash CS3 allows Flash CS3 users to build components that can be seamlessly integrated into a Flex application, while Flex Builder 3 adds new wizards for importing assets from CS3 applications as skins.
  • Advanced DataGrid – The Advanced DataGrid is a new component that adds commonly requested features to the DataGrid such as support for hierarchical data, and basic pivot table functionality.
  • First steps toward open source Flex. As a first step toward making Flex an open source project, Adobe have opened up the Flex and Flex Builder bug tracking system to the public, as well as published detailed roadmap information.
10) What are some ways to specify styles on components?
11) What is the problem with calling setStyle()
12) How do you use css styles in flex?
13) Explain different ways of using style sheets in Flex application.
14) Explain the difference between creating an effect and setting the target as opposed to adding an effectListener
15) What do repeater components do?
16. How do you use a repeater?
17) How do you identify a component created in a repeater?
18) Explain the component lifecycle.
or
Explain the UI component life cycle including important methods like initialize() and                    createChildren()
or
What are the methods called when a UI component is intialized?
Preinitialize: The application has been instantiated but has not yet created any child components.
Initialize: The application has created child components but has not yet laid out those components.
creationComplete: The application has been completely instantiated and has laid out all components
19) How invalidate / commitProperties work specifically
20) Questions about dataServices
21) A general understanding of MVC
or
How do you implement MVC in your application
or
what is MVC and how do you relate it to flex apps?
22) Is it possible to make httpService Requests synchronous?(*)
A: No.Basically all service calls from flex, whether it is HTTPService, WebService or RemoteService, are asynchronous. But there are methods through which you can crack this and make these calls synchronous.
Solution 1 (I got from many sites): Create XMLHttpRequest with Javascript in Flex, and call a server data with the parameters we will give to the object.For example: xmlHttpRequest.open(“GET”,”http://localhost/Default.aspx”,false);
1. Request Type: GET or POST
2. Requested URL
3. Communication Type: true for asynchronous, false for synchronous.
Solution 2 (My Own Solution ;) ): Create one result handler for the service call and whatever processing you need to execute synchronously, put all in that result handler and BINGO!!! :)
23) I need to load an image from flickr into my application. Do I need a crossdomain.xml file on flickr?
24) Explain crossdomain.xml and why is it used?
25)Describe what the IResponder interface contains and how is it used?
26) What is the difference between httpService and Data Service? (*)
Flex allows three types of RPC services: HttpService, WebServices, and RemoteObject Services. In Flex, using the “RemoteObjects specifies named or unnamed sources and connects to an Action Message Format (AMF) gateway, whereas using the HTTPService and WebService use named services or raw URLs and connect to an HTTP proxy using text-based query parameters or XML”. Specifically, HTTPServices use raw HTTP requests, WebServices use the SOAP protocol and RemoteObjects uses AMF3. “RemoteObject provides two advantages over HTTP or SOAP. First, while the AMF protocol uses HTTP to transfer packets, the data is transferred in a binary format that is natively understood by the Flash Player. As a result, data can move across the network more quickly and it can be deserialized more rapidly than text-based formats such as XML. Both of these result in performance gains, particularly where large sets of data are involved. Secondly, RemoteObject provides signficant productivity advantages. The remoting service, which runs on your server, automatically marshalls data between AMF and your server-side language (e.g., PHP, Java, C#). As a result, you can directly call methods on your PHP objects without having to write an XML REST interface or create web service interfaces”.
27) How do you generate random numbers within a given limit with actionscript?
28) Have you built any components with actionscript? If so explain how you did it?
29)How do you implement push on a flex applications?
30)How do you implement push with flex data services?
31)I am going to add images into a tag. How will it resize itself?
32)What is a resource Manager??
33)What are the similarities between java and flex
34)How do you implement drag and drop on components that do not support ondrag and ondrop?
35)What is a drag manager?
36)Can you write to the file system from flex?
37)HOw do you call javascript from Flex?
The ExternalInterface API makes it very simple to call methods in the enclosing wrapper. You use the static call() method, which has the following signature:
flash.external.ExternalInterface.call(function_name:
    String[, arg1, ...]):Object;
The function_name is the name of the function in the HTML page’s JavaScript. The arguments are the arguments that you pass to the JavaScript function. You can pass one or more arguments in the traditional way of separating them with commas, or you can pass an object that is deserialized by the browser. The arguments are optional.
The following example script block calls the JavaScript f() function in the enclosing wrapper by using the call() method:



    
        import flash.external.*;

        public function callWrapper():void {
            var f:String = "changeDocumentTitle";
            var m:String = ExternalInterface.call(f,"New Title");
            trace(m);
        }
    
    
On your HTML page, you define a function as you would any other JavaScript function. You can return a value, as the following example shows:
This feature requires that the embedded movie file have an id attribute. Without it, no call from your Flex application will succeed.
The call() method accepts zero or more arguments, which can be ActionScript types. Flex serializes the ActionScript types as JavaScript numbers and strings. If you pass an objct, you can access the properties of that deserialized object in the JavaScript, as the following example shows:

    public function callWrapper():void {
        var o:Object = new Object();
        o.lname = "Danger";
        o.fname = "Nick";
        var f:String = "sendComplexDataTypes";
        ExternalInterface.call(f,o);
    }
Flex only serializes public, nonstatic variables and read-write properties of ActionScript objects. You can pass numbers and strings as properties on objects, simple objects such as primitive types and arrays, or arrays of simple objects.
The JavaScript code can then access properties of the object, as the following example shows:
You can also embed objects within objects, as the following example shows. Add the following code in your Flex application’s block:

    public function callWrapper():void {
        var f:String = "sendComplexDataTypes";
        var o:Object = new Object();
        o.lname = "Danger";
        o.fname = "Nick";
        o.b = new Array("DdW","E&T","LotR:TS");
        var m:String = ExternalInterface.call(f,o);
    }
The code triggers the following JavaScript in the wrapper:
Flex and Flash Player have strict security in place to prevent cross-site scripting. By default, you cannot call script on an HTML page if the HTML page is not in the same domain as the Flex application. However, you can expand the sources from which scripts can be called.
You cannot pass objects or arrays that contain circular references. For example, you cannot pass the following object:
var obj = new Object();
obj.prop = obj; // Circular reference.
Circular references cause infinite loops in both ActionScript and JavaScript.
38) what are three ways to skin a component in flex?
39)what is state? what is the difference between states and ViewStack?
40)how does item renderer work? How do I add item renderer at runtime?
41)what keyword allows you to refer to private variables of a class?
42)how polymorphism works on actionscript?
43)how do you overload functions in actionscript?
44)How to override Managers (example : PopupManager)
45)what is dynamic keyword used for?
or
What is the difference between sealed class and dynamic classes?
Dynamic Keyword is used to make a class dynamic. A dynamic class defines an object that can be altered at run time by adding or changing properties and methods. You create dynamic classes by using the dynamic attribute when you declare a class. For example, the following code creates a dynamic class named Protean:
dynamic class Protean {
  private var privateGreeting:String = "hi";
  public var publicGreeting:String = "hello";
  function Protean () {
    trace("Protean instance created");
  }
}
If you subsequently instantiate an instance of the Protean class, you can add properties or methods to it outside the class definition. For example, the following code creates an instance of the Protean class and adds a property named aString and a property named aNumber to the instance:
var myProtean:Protean = new Protean();
myProtean.aString = "testing";
myProtean.aNumber = 3;
trace (myProtean.aString, myProtean.aNumber); // output: testing 3
Properties that you add to an instance of a dynamic class are run-time entities, so any type checking is done at run time. You cannot add a type annotation to a property that you add in this manner.
You can also add a method to the myProtean instance by defining a function and attaching the function to a property of the myProtean instance. The following code moves the trace statement into a method named traceProtean():
var myProtean:Protean = new Protean();
myProtean.aString = "testing";
myProtean.aNumber = 3;
myProtean.traceProtean = function () {
    trace (this.aString, this.aNumber);
}
myProtean.traceProtean(); // output: testing 3
Methods created in this way, however, do not have access to any private properties or methods of the Protean class. Moreover, even references to public properties or methods of the Protean class must be qualified with either the this keyword or the class name. The following example shows the traceProtean() method attempting to access the private and public variables of the Protean class.
myProtean.traceProtean = function () {
    trace(myProtean.privateGreeting); // output: undefined
    trace(myProtean.publicGreeting); // output: hello
}
myProtean.traceProtean();
Sealed Class
A class that is not dynamic, such as the String class, is a sealed class. You cannot add properties or methods to a sealed class at run time.
46) What are runtime shared libraries? 47) What is cairngorm ? How do you use it? Have you worked with cairngorm?
or
Explain the lifecycle of a Cairngorm action.
or
What frameworks familiar with
Some of the frameworks in Flex are : EasyMVC, Cairngorm, Mate, Swiz. I had worked only on cairngorm and so putting down its details :
Overview of Cairngorm
What is Cairngorm? Cairngorm is fundamentally a methodology for breaking up your application code by logical functions; by data, by user views, and by the code that controls everything. This is routinely referred to as MVC, or Model, View, and Control.
The Pieces of Cairngorm
·Model Locator: Stores all of your application’s Value Objects (data) and shared variables, in one place. Similar to an HTTP Session object, except thatits stored client side in the Flex interface instead of server side within a middle tier application server.
· View: One or more Flex components (button, panel, combo box, Tile, etc) bundled together as a named unit, bound to data in the Model Locator, andgenerating custom Cairngorm Events based on user interaction (clicks,rollovers, dragndrop.)
· Front Controller: Receives Cairngorm Events and maps them to CairngormCommands.
· Command: Handles business logic, calls Cairngorm Delegates and/or other Commands, and updates the Value Objects and variables stored in the ModelLocator
· Delegate: Created by a Command, they instantiate remote procedure calls(HTTP, Web Services, etc) and hand the results back to that Command.
· Service: Defines the remote procedure calls (HTTP, Web Services, etc) to connect to remote data stores.
How the Pieces Fit Together
Cairngorm basically works like this: Your client interface is comprised of Views. The Views use Flex binding to display data contained in the Model Locator. The Viewsgenerate Events based on user gestures such as mouse click, button press, and drag & drop. Those Events are “broadcast” and “heard” by the Front Controller, which is a map of Events to Commands. Commands contain business logic, create Delegates toperform work, handle responses from Delegates, and update the data stored in theModel Locator. Since Views are bound to the data in the Model Locator the Viewsautomatically update when the Model Locator data is changed. Delegates callServices and hand results back to Commands, and are optional but recommended.Services make remote data calls and hand the results back to Delegates.
48) What keyword allows you to implement abstraction better?
49) What is ClassFactory and why is it needed? 50) What design patterns have you used? in Actionscript and java?
or
What design patterns do you commonly use?
51) What is AMF?
AMF is a binary format based loosely on the Simple Object Access Protocol (SOAP). It is used primarily to exchange data between an Adobe Flash application and a database, using a Remote Procedure Call. Each AMF message contains a body which holds the error or response, which will be expressed as an ActionScript Object. AMF was introduced with Flash Player 6, and this version is referred to as AMF 0. It was unchanged until the release of Flash Player 9 and ActionScript 3.0, when new data types and language features prompted an update, called AMF 3.
52) What are the Advantages and Disadvantages of flex
Flex advantages: very capable IDE, Images are part of a flash movie and can’t be downloaded directly, supported by Adobe, XML based language, ability to leverage flash components into the application, great speed increase over previous versions of flash (if that was even possible).
Flex disadvantages: Needs the flash player, Need to learn and XML based language and possibly actionscript to build real applications
53) What is the difference between Flex and AIR application?
The “Flex Framework” is a collection of AS3 classes and components used in developing RIAs. “Flex Builder” is an IDE used to develop “Flex Applications.” If you use something other than Flex Builder to develop in Flex, you need to download the Flex SDK to compile. The end result of a compiled Flex Application is an SWF file (Same as Flash). With the compiled SWF file, a user only needs to have Flash Player installed to run the application. Most Flex apps are developed, deployed to a server and then a web browser is used to serve the application to the user for use.
AIR is an alternative delivery system for Flex Applications, replacing the web server and browser so to speak. It’s primary purpose is for deploying RIAs to a user’s desktop, independant of an internet connection. AIR, also allows for the use of HTML, AJAX etc. So an AIR Application could be a collection of all these things, compiled together. To run an AIR Application, you need AIR Runtime installed on your computer.
54) List out the advantages and disadvantages of using Raster vs Vector images with flex.
55) What are the config files that are used to connect Java and Flex applications?
data-management-config.xml, messaging-config.xml, proxy-config.xml, remoting-config.xml, services-config.xml
56)Explain what a weak-referenced event listener is and why you’d use it?
57)Explain the invalidation model and how it works for properties, measuring and the display list.
58)What classes do you typically extend in the Flex SDK for creating GUI controls and why?
59)What is something you’ve coded that you were most proud of?
60)What is something you’ve coded that you were ashamed of?
61) What is the difference between width, explicitWidth, measuredMinWidth, measuredWidth, and percentWidth?

No comments:

Post a Comment