Categories
AJAX Angular CSS CSS3 HTML HTML5 JavaScript jQuery NodeJS UI

UI Architect Interview Questions and Answers

what is tail call optimization ?
TCO (Tail Call Optimization) is the process by which a smart compiler can make a call to a function and take no additional stack space.

Recursive function approach has a problem. It builds up a call stack of size O(n), which makes our total memory cost O(n). This makes it vulnerable to a stack overflow error, where the call stack gets too big and runs out of space. Tail Cost Optimization (TCO) Scheme. Where it can optimize recursive functions to avoid building up a tall call stack and hence saves the memory cost.

what is Map, Set, WeakMap and WeakSet ?
Map is a collection of keyed data items, just like an Object. But the main difference is that Map allows keys of any type.

A Set is a collection of values, where each value may occur only once means it will contain unique set of keys. 

WeakSet is a special kind of Set that does not prevent JavaScript from removing its items from memory. WeakMap is the same thing for Map.
WeakMap does not support iteration and methods keys(), values(), entries(), so there’s no way to get all keys or values from it.

Map – is a collection of keyed values.

The differences from a regular Object:

Any keys, objects can be keys.
Iterates in the insertion order.
Additional convenient methods, the size property.
Set – is a collection of unique values.

Unlike an array, does not allow to reorder elements.
Keeps the insertion order.
Collections that allow garbage-collection:

WeakMap – a variant of Map that allows only objects as keys and removes them once they become inaccessible by other means.

It does not support operations on the structure as a whole: no size, no clear(), no iterations.
WeakSet – is a variant of Set that only stores objects and removes them once they become inaccessible by other means.

Also does not support size/clear() and iterations.
WeakMap and WeakSet are used as “secondary” data structures in addition to the “main” object storage. Once the object is removed from the main storage, if it is only found in the WeakMap/WeakSet, it will be cleaned up automatically.

how to do peer to peer communication in ANgular ?

what is directive & components in angular ?

if loop functions are removed from script, how can you achieve same functionality ?

how to drop both data and collection in mongodb ?

what is generic types in Typescript ? advantages ?

how to define custom types in Typescript ?

how to capture the process specific exceptions in NodeJS ?

how do you print name of file currently executing in NodeJS ?

how to use custom pipes in Angular ? can you pass additional parameters in custom pipes ?

what is the max data can be stored in a mongodb document ?

how to acheieve variable length documents in mongodb ?

how do you set autoincrement field in mongodb ?

what is the difference between throttling & debouncing ?
Throttling enforces a maximum number of times a function can be called over time. As in “execute this function at most once every 100 milliseconds.”
Debouncing enforces that a function not be called again until a certain amount of time has passed without it being called. As in “execute this function only if 100 milliseconds have passed without it being called.”

what is event bubbling ? how to stop ?
what is digest cycle in angularJS ?
how to stop propgation ?
what is interpolation ? how does it work ?
what is shadow dom ?
what is webworker ?
how to cache the page/data in HTML 5 ?
how to give offline view expereince in HTML5 ?
what is lazyloadng? how it works ?
what are pure / impure pipes ?
what is redux ? how does it work ?
unit testing code coverage how to check ?
what tool used for unit test ?
streaming , how does it work ?
any custom video/audio player developed?
how does cache works in HTML5 ?
what is method chaining ?
difference between canvas vs SVG ?
what is XSS and how to avoid it ?

difference between Responsive and Adaptive design ?
diff b/w flexbar & grid designs ?
what is cors ? how to allow ?
symmetric & asymetric keys ?
scope usage in OAuth token ?
explain component lifecycle
how to use service in Angular ?
what is event emitters ?
latest ECMA version ?
INPUT & OUTPUT variables usage in Angular
explain Digest Lifecycle in Angular ?
difference between Angular 1.x & Angular 2.x
what is SASS & SCSS ?
what is ViewChild ? OR ViewCildren ?

Explain the following :

Directives,
decorators,
Services,
Modules,
Data Binding,
Components,
Filters,
DOM ,
Events ,
Routing,
Dependency injection.

Categories
Agile AJAX Angular CSS CSS3 HTML HTML5 JavaScript jQuery NodeJS UI

Javascript / UI / Angular Architect Questions and Answers

1.Difference between var let and const. ?

a. Var is hoisted in JS, let and const are not hoisted.

b. Let, const are block level, var is function level The candidate has to tell at least one of these apart from any other difference he tells.

2. What is a closure and how does it work

a. A closure is an inner function that has access to the outer (enclosing) function’s variables—scope chain.

A closure is an inner function that has access to the outer (enclosing) function’s variables—scope chain.

3. What is a JavaScript class

a. ES 6 standard introduced classes in JS, which internally use the prototypal approach to implement Class .

4. How does JS implement inheritance

a. JS uses prototypal inheritance in which objects inherit properties from other objects (or) JS uses prototypes to implement inheritance

5. What is the difference between == and === in JS

a. == checks only for the value, where === checks for both value and data type

6. What is the use of hasOwnProperty method in JS

a. This method returns true, only when the passed property is present directly on the object.

7. Explain call, apply and bind

a. Call and apply are used to invoke a method, by setting the context of ‘this’ keyword. Call takes comma separated individual parameters, and apply takes array of parameters as arguments

b. Bind method does the same operation as call and apply, but returns a new function definition instead of invoking the method

8. What is ‘arguments’ keyword in JS

a. Arguments is a special property in every function, that holds all the parameters passed to that function. Its an array-like object.

9. What is arrow function

a. Arrow function is introduced in ES 6 standard of JS, and does implicit binding of this property.

10. What are benefits of TypeScript

a. * TS provides type safety for the variables

Skills checked:

JS core – Intermediate / Advanced

  1. What is a closure and how it works in JavaScript
  2. What is a ‘hosting’ , How this works in JavaScript ?
  3. call, apply and bind with example
  4. Event bubbling and Event capturing
  5. event delegation
  6. prototypical inheritance / prototypical chain
  7. strict mode and usual mode
  8. What is EventLoop?

ECMA

  1. Difference between var, let and const?
  2. What is a promise and how it works?
  3. What is a arrow function and its difference from function syntax?
  4. Generator and how it works
  5. JS modules, export and export default
  6. async/await

Angular – Intermediate / Advanced

  1. Virtual DOM concept.
  2. Subscribe, Observables and Promises.
  3. Different ways of data bindings.
  4. Sequence of Angular Lifecycle Hooks
  5. Routing
  6. Reactive Forms.

React JS and Redux – Novice / Intermediate

  1. Virtual DOM concept.
  2. Explain lifecycle of React component.
  3. Difference between state and props.
  4. Redux
  5. Role of reducer

HTML – Novice / Intermediate

  1. What is a Doctype?
  2. quirks mode and standart mode
  3. new features in html5
  4. Html storage Localstorage and sessionstorage

CSS – Novice

  1. Difference between adaptive and responsive design?
  2. What is a repaint and reflow?
  3. Media query.
  4. Layout Methodology.
  5. How browser search selector?

Networking – Intermediate

  1. What is REST?
  2. REST principles.
  3. Difference between POST and PUT requests

Design Patterns – Advanced

  1. Factory Patterns
  2. Singleton Patterns

Unit testing

  1. TDD/BDD
  2. jasmine/karma

Processes

  1. GIT
  2. Code review process and tools
  3. CI/CD
  4. SOLID
  5. SCRUM
  6. Webpack
  7. IDE

Categories
Angular CSS CSS3 HTML HTML5 JavaScript NodeJS UI

UI Developer / Lead / Architect Interview Question and Answers – Part 2

UI Developer / Lead / Architect Interview Question and Answers – Part 2

Type of components in Angular ? 

There are two types of components in Angular 


– Declarative components  

these components are  which are included in the template


– Entry components 

Any component that Angular loads imperatively and you’re not referencing it in the template. 



what is entry components in modules  ?


An entry component is any component that Angular loads imperatively, (which means you’re not referencing it in the template), by type. 

You specify an entry component by bootstrapping it in an NgModule, or including it in a routing definition. 


There are two main kinds of entry components:


The bootstrapped root component.

A component you specify in a route definition.


Explain the process to do for popup in Angular material design ?   

The Angular Material library offers support for displaying modal dialogs in Material Design. 

To enable Angular Material Dialogs in your Angular application you need to import MdDialogModule in your main application module.

Next, make sure to also add MdDialogModule to the imports array of @NgModule

Make use of the MdDialog service which is part of MdDialogModule in our components

create a new component using cmd “ng g component DialogDemo”

which creates 4 files  html / css / ts / spec.ts  as below 


src/app/dialog-demo/dialog-demo.component.css

src/app/dialog-demo/dialog-demo.component.html

src/app/dialog-demo/dialog-demo.component.spec.ts

src/app/dialog-demo/dialog-demo.component.ts



In dialog-demo.component.html file add html code for modal popup display code using MdDialog, MdButton and MdCard elements and directives. 

import {MdCardModule} from ‘@angular/material’;

import {MdButtonModule} from ‘@angular/material’;

import {MdDialogModule} from ‘@angular/material’;


And add the types to the imports array also :

imports: [

BrowserModule,

BrowserAnimationsModule,

MdCardModule,

MdButtonModule,

MdDialogModule

  ],

  

  

add the component selector to the markup code of our main application component in file app.component.html. 

<app-dialog-demo></app-dialog-demo>

Now you can customize the code based on the actions/events/data sharing etc.. in the modal (Dialog) popup component/services in ts files. 



what is the criteria to choose on JS frameworks ? 

There are many criteria when it comes to choosing a JS framework like 

Functionality , Usability, Reliability, Efficiency, Maintainability and Portability 

and also finalize based on the 

Project requirements suitability 

Browser Support {typically with Safari on the Mac} 

Strength of development team supporting the framework.

Maturity of the framework

Frequency of public updates and releases.

Documentation quality.

Existence of an active community.

Benchmark tests on performance aspects

Extensibility of the framework with Plugin support 

API Style Support 

Commericial Support availablity 

and functionalitywise support like 


DOM navigation/manipulation

Basic UI components support

Advanced UI widget library

Themes and skinning support

Validations support

Ease of server interaction

Multiple data exchange formats support 

how to trigger LazyLoading feature in AngularJS ?

we need lazy loading to improve the performance of loading time of the application. 

Instead of loading all components at first time , in angular we can split this into children and load it whenever required.

Lazy Loading is load only what we need to use when first starting up the application. 

If user navigate to a new page, then the component for that page will load immediately.


Lazy loading is performed by allowing the router config to provide the module to load on route execution. 

To utilize lazy loading you must split your code into modules.

In the app.router.ts you will have the special router called loadChildren, this is used for lazy loading module 

and it accepts value as a string. 

The path of the loadChildren is based on src directory, you need to provide the full path of your feature module 

and put the ‘#’ sign then your export module class name.

Finally, we need to import the app.router.ts that is root router of the application to the app.module.ts.


how to do State Management in AngularJS  ? 

State Management OR Managing state means need to coordinate multiple backends, web workers, and UI components, all of which update the state concurrently. 

Patterns like Redux and Flux are designed to address this problem by making this coordination more explicit.

A typical web application has the following six types of state:


Server state

Persistent state

The URL and router state

Client state

Transient client state

Local UI state


Backend manages the server state, persistent state (the talks) and the client state (the filters).

The router manages the URL and the router state.

WatchService manages the transient client state (watched talks).

The individual components manage the local UI state.


and maintaining / synchronizing these states across the application using custom observers OR usnig tools like Redux. 


what is content in angular ?

Transclusion in AngularJS OR Content Projection in Angular is a way to let you define a fixed view template, and 

at the same time allow you to define a slot for dynamic content by using <ng-content> tag.

and using the type of selector like Attribute, HTML tag, or CSS class etc.. you can load the dynamic content in the ng-content directive section. 

Whenever some libraries conflict issues are coming , how do you solve ?

You can avoid the conflicts with other libraries using namespaces OR Alias like jQuery noConflict method. 

OR 

if libraries are managed using packages.json than using peerDependencies package attribute you can manage multiple versions of files.


Difference between routing and templating ? 

Routing -> To navigate to different pages in the application with no page reloading we use Angular Routing using ngRoute module.

The ngRoute module routes your application to different pages without reloading the entire application.


Templating -> templating allows you to create one master page for the structure and then just replace pieces of the page with different content based on the url.


AngularUI Router -> The UI-Router is a routing framework for AngularJS provides a different approach than ngRoute in that it changes your application views based on state of the application and not just the route URL. 



Difference between unidirectional data binding and bidirectional data binding ? 

One way binding is bind the data from model to view. 

Where as two way binding is bind the data from model to view and view to model. 

Data flows from the Scope/Controller to the View and from the View to the scope/controller). 

‘ng-model’ is an angular directive used for achieving two-way data binding.



Difference between responsive and adaptive design ? 

Responsive sites and adaptive sites are the same in that they both change appearance based on the browser environment , size, device etc…


Responsive Web Design makes your web page look good on all devices (desktops, tablets, and phones). 

Responsive Web Design is about using HTML and CSS to resize, hide, shrink, enlarge, or move the content to make it look good on any screen. 

Fluid grids, flexible images, and media queries are the three technical ingredients for responsive web design.


Adaptive design detects the device and other features and then

provides the appropriate feature and layout based on a predefined set of viewport sizes and other characteristics 



Difference b/w Javascript vs ES5 or ES6 ? 

scripting language is a programming language designed specifically for acting on an existing entity or system. 

ECMA means European Computer Manufacturer’s Association  ECMAScript (ES)  –>  Is the specification defined in ECMA-262 for creating a general purpose scripting language. 

ECMAScript provides the rules, details, and guidelines that a scripting language must observe to be considered ECMAScript compliant.


JavaScript (JS)  –> A general purpose scripting language that conforms to the ECMAScript specification. 

JavaScript mostly implements the ECMAScript specification as described in ECMA-262. 


A JavaScript engine –> A program or interpreter that understands and executes JavaScript code. 

JavaScript engines are commonly found in web browsers, including V8 in Chrome, SpiderMonkey in Firefox, and Chakra in Edge. 


ECMAScript 5 –> 

It is the fifth edition of the ECMA-262 standard, and major features of the ECMAScript specification. 


ECMAScript 6  –> 

It is the sixth edition of the ECMA-262 standard, and features major changes and improvements to the ECMAScript specification.


Babel

A transpiler that can convert ES6 code to ES5 code.



Which is First ? Chicken or  Egg — ECMAScript or JavaScript 

A confusing bit of history is that JavaScript was created in 1996. It was then submitted to Ecma International in 1997 for standardization, which resulted in ECMAScript. At the same time, because JavaScript conformed to the ECMAScript specification, JavaScript is an example of an ECMAScript implementation.

ECMAScript is based on JavaScript, and JavaScript is based on ECMAScript.

To read more on this topic, here is the best article resource : https://www.toptal.com/angular/angular-components-overview-101

Categories
AJAX Angular CSS CSS3 HTML HTML5 JavaScript jQuery NodeJS UI Uncategorized VueJS

SAP – UI Architect – Angular Interview Questions and Answers

List and explain XSS attack types?

Cross-site scripting (XSS) is a code injection attack that allows an attacker to execute malicious JavaScript in another user’s browser.

XSS attacks are of three types:

  • Persistent XSS, where the malicious string originates from the website’s database.
  • Reflected XSS, where the malicious string originates from the victim’s request.
  • DOM-based XSS, where the vulnerability is in the client-side code rather than the server-side code.

Methods of preventing XSS

  • Encoding, which escapes the user input so that the browser interprets it only as data, not as code.
  • Validation, which filters the user input so that the browser interprets it as code without malicious commands.

What is CORS , how to manage? How to secure the requests?

Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell a browser to let a web application running at one origin (domain) have permission to access selected resources from a server at a different origin. A web application makes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, and port) than its own origin.

two response headers are most important for security:  

  • Access-Control-Allow-Origin specifies which domains can access a site’s resources. For example, if ABC Corp. has domains ABC.com and XYZ.com, then its developers can use this header to securely grant XYZ.com access to ABC.com’s resources. 
  • Access-Control-Allow-Methods specifies which HTTP request methods (GET, PUT, DELETE, etc.) can be used to access resources. This header lets developers further enhance security by specifying what methods are valid when XYZ accesses ABC’s resources. 

As CORS can lead to multiple security vulnerabilities , so instead of allowing CORS use a trusted server as a proxy / reverse proxy and allow all requests/resources to be served  from that dedicated server.

What is Virtual polymorphism ?

Polymorphism is the ability for objects of different classes related by inheritance to respond differently to the same member function call.

virtual function allows a programmer to call a function and let the program determine dynamically which version of the function to use.
To enable this type of behavior, the function will be declared in the base class as a virtual function and then be redefined in each of the derived classes.
To declare a virtual function, precede the function’s prototype with the keyword virtual in the base class.
Combination of both Virtual Function with polymorphism concept is called Virtual Polymorphism.

Write a Sql query for products table to get total price of products sold in a quarter ?

 SELECT
  productname, 
  SUM(price) as total_count
  FROM products
  WHERE `date` >= startdate AND `date` <= enddate
  GROUP BY productname
  ;

Write a Sql query for products table to get total price of products sold in a quarter ?

To calculate any factorial in real-time, you can speed it with a cache, saving the numbers you’ve calculated before.

factorial = (function() {
    var cache = {},
        fn = function(n) {
            if (n === 0) {
                return 1;
            } else if (cache[n]) {
                return cache[n];
            }
            return cache[n] = n * fn(n -1);
        };
    return fn;
})();

Types of requests which can be handled through browser?

HTTP, HTTPS, FILE, and FTP protocols are supported by most of the commonly used browsers.

What is promise? Advantages of it ?

A Promise is an object representing the eventual completion or failure of an asynchronous operation. Essentially, a promise is a returned object to which you attach callbacks, instead of passing callbacks into a function.

Advantages of promises are

  • Callbacks will never be called before the completion of the current run of the JavaScript event loop.
  • Callbacks added with then() even after the success or failure of the asynchronous operation, will be called, as above.
  • Multiple callbacks may be added by calling then() several times. Each callback is executed one after another, in the order in which they were inserted.
  • One of the great things about using promises is chaining.

How to improve the Performance of webpage?

  • Reduce External HTTP Requests
  • Minify CSS, JS and HTML
  • Compress Components with Gzip
  • Optimize Your Images
  • Add CSS at top/header section
  • Add JS at bottom section
  • Reduce DNS Lookups
  • Use CDN and Cache
  • Make Fewer HTTP Requests
  • Avoid empty src or href
  • Add Expires Headers
  • Avoid CSS Expressions
  • Avoid URL Redirects
  • Remove Duplicate JavaScript and CSS
  • CleanUP the unecessary code
  • Configure Entity Tags (ETags)
  • Reduce the Number of DOM Elements
  • Avoid HTTP 404 (Not Found) Error
  • Do Not Scale Images in HTML
  • Make favicon Small and Cacheable

IF Request/Response taking too much time than How to keep alive the request ?

A Request/Gateway Timeout response code indicates that the server did not receive a complete request from the client within a specific period of time tracked by the server.
You can set custom timeout for your http request in the second parameter of http.get() method:
$http.get(‘request-path’, {timeout: 300000});
This will set timeout to 300 seconds = 5 minutes. Increasing it to something much larger should help.
OR
req.setTimeout(0) for no timeout for all requests
Another solution is doing a long polling or short polling to keep alive the request.

DB 2 queries same record update? How to manage? How to intimate the second request to update itself?

Use SQL transaction statements like BEGIN and COMMIT to avoid concurrent updates to same record.
OR
You may have additional field which indicates that column is being edited. When first user starts work, the field would be updated. The second user would query object with ‘on hold’ status and your code would handle this.

Lot of requests , how to manage?

  • Use CDN for optimized content delivery
  • Use Cache Layers like memcache , redis etc..
  • Use Load Balancing techniques for Application Servers / Cache Layers
  • Use Master / Salve configuration for DB Servers

Same application, for 2 different companies but for all users, request to come, how to manage?

Use Proxy / Reverse proxy configuration along with a flag specific to company to manage the requests to handle internally from different servers.

Bind, apply and call difference in angular ?

The bind() method creates a new function that, when called, has its “this” keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.
fun.bind(thisarg[, arg1[,arg2[,….]]])

Function.call allows us to set the this value of a function manually. Instead of simply calling a function like fn(), we use fn.call(param), passing in the object we want this to equal as the parameter.
call also allows us to pass in parameters to the function being called. Anything given after the object to be bound to thiswill be passed along to the function.

Function.apply works the same exact way as call, except instead of passing in arguments one by one, we pass in an array of arguments that gets spread into the function.

In call method parameter will be passed separately. whereas in apply you can pass parameters as Array arguments.

Globalization or internationalization , how to do in angular?

Internationalization (i18n) is the process of developing products in such a way that they can be localized for languages and cultures easily. Localization (l10n), is the process of adapting applications and text to enable their usability in a particular cultural or linguistic market.
internationalizing an application means abstracting all of the strings and other locale-specific bits (such as date or currency formats) out of the application. Localizing an application means providing translations and localized formats for the abstracted bits.
AngularJS supports i18n/l10n for date, number and currency filters.
Localizable pluralization is supported via the ngPluralize directive.
All localizable AngularJS components depend on locale-specific rule sets managed by the $locale service.

How to avoid same button multiple clicks  ?

There are multiple ways to avoid multiple clicks of a same button

  • Once the click event is fired , disable the button till event response is processed
  • Unbind the click event on first click event
  • Provide a time interval for between the same object click event
Categories
CSS CSS3 HTML HTML5 JavaScript jQuery

HCL – Web / UI Developer – interview questions and answer – HTML5 , CSS3 , JS & jQuery

1) Explain about HTML5 local storage ?
There are two ways to store data in HTML as objects locally :

  1. localStorage – store data  across session acess
  2. sessionStorage – storing data for current session only

Data will be stored in key/value pair format.
example:
localStorage.empid=”420″;
sessionStorage.companyname = “SHARAG INFOTECH”;
2)  explain CSS media queries ?
CSS media queries are used to develop responsive templates for different layout of screen, print, mobile , tablet or any other resolutions
CSS media queries can be added in 3 ways as like CSS style sheet :

  1. Internal stylesheet :  <style type=”text/css”>
    @media only screen and (max-width: 600px){
    /* rules apply to the device resolution is 480px or less  */
    }
    </style>
  2. Imported stylesheet :   @import “tablet.css”   (min-width: 800px) and (max-width: 1200px);
  3. External stylesheet:  <link rel=”stylesheet” type=”text/css” href=”deskto.css” media=”screen and (min-width: 1200px), print and (min-resolution: 300dpi)” />

3) explain css inheritance ?
Inheritance propagates property values from parent elements to their children. The inherited value of a property on an element is the computed value of the property on the element’s parent element. For the root element, which has no parent element, the inherited value is the initial value of the property.
A property can also be explicitly inherited by using the inherit keyword in property.
CSS inheritance example:
class inheritance for an HTML tag :
<div class=”firstClass secondClass thirdClass fourthClass ” > </div >
CSS property inheritance from parent :
p {
color: #000;
}
p a:link {
color: inherit;
}
and using LESS method for inheritance example:
//through variable
@color: #123456;
#emp {
color: @color;
}
div {
color: @color;
}
//through class name calling [MIXINS]
.rounded-corners (@radius: 2px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
-ms-border-radius: @radius;
-o-border-radius: @radius;
border-radius: @radius;
}
#navtable {
.rounded-corners;
}
#maintable {
.rounded-corners(5px);
}
4) what is javascript inheritance ?
In simple terms, inheritance is the concept of one thing gaining the properties or behaviours of something else.
Inherited children inherit their parent’s behaviour To say A inherits from B, is saying that A is a type of B.
In JavaScript You must use a special object called prototype.
function Animal() {}; // This is the Animal *Type*
Animal.prototype.eat = function () {
alert(“All animals can eat!”);
};
function Bird() {}; // Declaring a Bird *Type*
Bird.prototype = new Animal(); // Birds inherit from Animal
Bird.prototype.fly = function() {
alert(“Birds are special, they can fly!”);
};
The effect of this is that any Birds you create (called an instance of Bird) all have the properties of Animals
var aBird = new Bird(); // Create an instance of the Bird Type
aBird.eat(); // It should alert, so the inheritance worked
aBird.fly(); // Important part of inheritance, Bird is also different to Animal
var anAnimal = new Animal(); // Let’s check an instance of Animal now
anAnimal.eat(); // Alerts, no problem here
anAnimal.fly(); // Error will occur, since only Birds have fly() in its prototype
5) explain javascript associative array ?
Associative arrays are where we can associate a key string with a value string
JavaScript objects are also associative arrays.
i.e the property  emp.Name can also be read by calling emp[‘Name’]
We can access each property by entering the name of the property as a string into the array
it refers to accessing the DOM elements of HTML also [as object or associative array]
6) explain JS Namespace ?
Namespacing is a technique employed to avoid collisions with other objects or variables in the global namespace
and also helps to organize blocks of functionality into easily manageable groups that can be uniquely identified.
JavaScript doesn’t  builtin support of namespacing but using objects and closures we can achieve a similar effect.
javascript Namespacing patterns :
1)    Single global variables :
var myApplication =  (function(){
function(){
/*…*/
},
return{
/*…*/
}
})();
2)    Object literal notation :
var myApplication = {
getInfo:function(){ /**/ },
// we can also populate our object literal to support
// further object literal namespaces containing anything
// really:
models : {},
views : {
pages : {}
},
collections : {}
};
3)    Nested namespacing :
var myApp =  myApp || {};
// perform a similar existence check when defining nested
// children
myApp.routers = myApp.routers || {};
myApp.model = myApp.model || {};
myApp.model.special = myApp.model.special || {};
// nested namespaces can be as complex as required
4)    Immediately-invoked Function Expressions :
// an (anonymous) immediately-invoked function expression
(function(){ /*…*/})();
// a named immediately-invoked function expression
(function foobar(){ /*..*/}());
// this is technically a self-executing function which is quite different
function foobar(){ foobar(); }
5)   Namespace injection :
// define a namespace we can use later
var ns = ns || {}, ns2 = ns2 || {};
// the module/namespace creator
var creator = function(val){
var val = val || 0;
this.next = function(){
return val++
};
this.reset = function(){
val = 0;
}
}
creator.call(ns);
// ns.next, ns.reset now exist
creator.call(ns2, 5000);
// ns2 contains the same methods
// but has an overridden value for val
// of 5000
for more details on namespace read http://addyosmani.com/blog/essential-js-namespacing/
7) explain Jquery live and bind methods ?
.bind() attacheds events to elements that exist or match the selector at the time the call is made.
Any elements created afterwards or that match going forward because the class was changed, will not fire the bound event.
$(‘img’).bind(‘click’, function(){…});
.live() works for existing and future matching elements.
Before jQuery 1.4 this was limited to the following events:
click, dblclick mousedown, mouseup, mousemove, mouseover, mouseout, keydown, keypress, keyup
$(‘img’).live(‘click’, function(){…});
8) what is bootstrap ?
Bootstrap is an open-source Javascript framework developed by the team at Twitter.
It is a combination of HTML, CSS, and Javascript code designed to help build user interface components.
Bootstrap is Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
Bootstrap was also programmed to support both HTML5 and CSS3
Bootstrap is a CSS and Javascript framework that is used within your HTML. Bootstrap provides more advanced functionality to your web site.
More details http://getbootstrap.com
9) type of webservice ?
there are two types of web service….1. SOAP [Simple Object Access Protocol] Webservice and 2. RESTful [REpresentational State Transfer] Webservice.
SOAP is a messaging protocol , REST is a design philosophy , not a protocol.
SOAP:
you define your interface in a .wsdl file, which describes exactly which input parameters are expected and how the return values will look like
there are tools to generate the .wsdl files out of java class hirarchies. JAXB for example
there are also tools to generate java objects/classes as part of eclipse for example (don’t know the name in the moment).
SOAP is very strict. Every request is validatet against the wsdl before processing.
A good but not so easy to start with framework for SOAP WS is Apache CXF
REST (no hands on experience up to now, feel free to correct and improve 😉 ):
a way to access a webserver or web application to retrieve data from or send to it.
it’s only negotiated, how it is accessed.
common is something like this http://server.domain.com/app/type/id=123 to retrieve object of type type with id=123
very intuitive, but no automatic validation of requests.
The main advantages of REST web services are:
Lightweight – not a lot of extra xml markup
Human Readable Results
Easy to build – no toolkits required
SOAP also has some advantages:
Easy to consume – sometimes
Rigid – type checking, adheres to a contract
Development tools