Tuesday, December 30, 2008

Regarding Java Sound API

http://java.sun.com/j2se/1.5.0/docs/guide/sound/programmer_guide/contents.html

General Questions

Tell me about you!

Keep your answer to one or two minutes; don't ramble. Use your resume summary as a base to start.

What do you know about our company?

Do your homework before the interview! Spend some time online or at the library researching the company. Find out as much as you can, including products, size, income, reputation, image, management talent, people, skills, history and philosophy. Project an informed interest; let the interviewer tell you about the company.

Why do you want to work for us?

Don't talk about what you want; first, talk about their needs: You would like to be part of a specific company project; you would like to solve a company problem; you can make a definite contribution to specific company goals.

What would you do for us? What can you do for us that someone else can't?

Relate past experiences that show you've had success in solving previous employer problem(s) that may be similar to those of the prospective employer.

What about the job offered do you find the most attractive? Least attractive?

List three or more attractive factors and only one minor unattractive factor.

Why should we hire you?

Because of your knowledge, experience, abilities and skills.

What do you look for in a job?

An opportunity to use your skills, to perform and be recognized.

Please give me your definition of a .... (the position for which you are being interviewed).

Keep it brief -- give an actions- and results-oriented definition.

How long would it take you to make a meaningful contribution to our firm?

Not long at all -- you expect only a brief period of adjustment to the learning curve.

How long would you stay with us?

As long as we both feel I'm contributing, achieving, growing, etc.

Strategies for Improving GD Skills

Observe

Attend as many seminars and tutorials as possible and notice what other students do. Ask yourself:

How do other students make critical comments?

How do they ask questions?

How do they disagree with or support arguments?

What special phrases do they use to show politeness even when they are voicing disagreement?

How do they signal to interrupt, ask a question or make a point?

Practice

Start practicing your discussion skills in an informal setting or with a small group. Start with asking questions of fellow students. Ask them about the course material. Ask for their opinions. Ask for information or ask for help.

Participate
Take every opportunity to take part in social/informal discussions as well as more structured/formal discussion. Start by making small contributions to tutorial discussions; prepare a question to ask, or agree with another speaker's remarks.

Do

Speak pleasantly and politely to the group.

Respect the contribution of every speaker.

Remember that a discussion is not an argument. Learn to disagree politely.

Think about your contribution before you speak. How best can you answer the question/ contribute to the topic?

Try to stick to the discussion topic. Don't introduce irrelevant information.

Be aware of your body language when you are speaking.

Agree with and acknowledge what you find interesting.

Don't

Lose your temper. A discussion is not an argument.

Shout. Use a moderate tone and medium pitch.

Use too many gestures when you speak. Gestures like finger pointing and table thumping can appear aggressive.

Dominate the discussion. Confident speakers should allow quieter students a chance to contribute.

Draw too much on personal experience or anecdote. Although some tutors encourage students to reflect on their own experience, remember not to generalise too much.

Interrupt. Wait for a speaker to finish what they are saying before you speak.

Leading a Discussion

You may be in a seminar group that requires you to lead a group discussion, or lead a discussion after an oral presentation. You can demonstrate leadership by:

introducing yourself and the members of the group

stating the purpose of the discussion

inviting quiet group members to speak

being objective

summarizing the discussion

Chairing a Group Discussion

When chairing a discussion group you must communicate in a positive way to assist the speakers in accomplishing their objective. There are at least four leadership skills you can use to influence other people positively and help your group achieve its purpose. These skills include:

introducing the topic and purpose of the discussion,

making sure all members have approximately the same time, (i.e. no one dominates the discussion by taking too much time)

thanking group members for their contribution

being objective in summarizing the group's discussion and achievements.

Rocking FireFox!!

Mozilla firefox originally known as "Phoenix" and briefly as "Mozilla
Firebird", is a free, cross-platform, graphical web browser developed
by the Mozilla Foundation. It is a new internet browser in the market
which really brings a competition for internet explorer. It is a good
alternative for internet explorer. The firefox is open source feature
which means that source code for the program is available to anyone
who cares to download it.
The reasons why the firefox browser is getting famous is stated in the
points below.

To Download for Free Visit
www.Firefox . in

Popup Blocking

An internet browser without a popup blocker is like having a broadband
connection without a fireball. Popup blocker is a really good blocking
software which stops ads and never interferes with your browser
navigation. If you want to get rid of the problem of popup ads,
without introducing disturbing side affects, then firefox is the best
site you can choose. Trying this with internet explorer would probably
bring your pc above your head. You can also easily access the list of
websites that the popup blocker blocks, and altering its state by a
simple mouse click.

Download Manager

Download manager allows you to manipulate and take control of your
downloaded files. Mozilla Firefox’s download manager contains just
the essential to allow you to control your downloads. You can pause
your downloads and continue it later, sometimes which is not possible
with internet explorer’s download manager. The download manager
stores the information such as size and location of your downloaded
file. When the download is complete, a small notification is displayed
in the lower side of the screen.

Tab Browsing

Sometimes too many windows open at a time can be a bit annoying, which
can also be said as time consuming, firefox features tab browsing. Tab
Browsing changes the way you use the internet by allowing you to open
links on a page in background “Tabs†and then read them when
you’re ready. No confusing new windows, no need for context menus,
just hold down Ctrl when clicking a link, or use your middle mouse
button.

Integrated Search Engine

The internet explorer programmers didn’t think of this? Mozilla
Firefox have launched in with the search engine. The default search
engine is Google, of course, with the ability to access others. The
search takes a very small space, which is a plus point compared to
internet explorer.

Options

The Mozilla firefox is less confusing and less disturbing than the
internet explorer. With Mozilla’s firefox you can easily find the
way through each site. The “Downloads†option allows you to
choose, which program will automatically open a downloaded file is
made.
Page Info When you right click on a page, and select “page infoâ€
the window will start displaying huge amount of information for the
webpage you need. General information as well as a Link tab showing
all the links that the page contains are also listed in the site.

Faster Response

On Mozilla Firefox it is typically faster to load a webpage than on
the internet explorer.

Keeps HTML Formatting

While you are copying from a webpage to a file the Mozilla Firefox is
able to restore the html format. For example, when copying html
formatted text from a webpage and pasting it on a note pad, the text
through Mozilla Firefox keeps the format of text and the html format,
where the internet explorer doesn’t.

Open Source Advantage

The Mozilla Firefox is a open source project where many of the
independent programmers can work on finding security.

Smaller Download

Downloading a Mozilla Firefox programmer is very smaller and quicker,
which is compared to as half the size of internet explorer.

Block Images

The pictures on the webpage can be disturbing and so the Mozilla
Firefox gives an option of blocking the images form the webpage. This
feature can be of use when you are handing a site that holds many
pictures, and many ads, which can be a problem for faster surfing.
Internet explorer does not provide this facility.

Mozilla Firefox is an alternate browser to internet explorer. Firefox
has defiantly broken ground in the war of the browsers. I know there
are many out there who would think otherwise and never settle for any
browser other than internet explorer.


Forward this mail to all fo your friends....

EJB sample questions with multiple choices

1.What does CTM stands for

a)CORBA transaction monitor.

b)Component transaction monitor.

c)Component task monitor.



2. javax.ejb.EJBObject extends

a)javax.ejb.EJBHome

b)javax.ejb.SessionBean

c)javax.ejb.Remote

d)java.rmi.Remote



3. Bean's business methods are implemented by

a)javax.ejb.EJBHome

b)javax.ejb.EJBObject

c)javax.ejb.EntityBean



4. All EJB remote interface types types extend

a)javax.ejb.EJBHome

b)javax.ejb.SessionBean

c)javax.ejb.EJBObject



5. The life-cycle methods of a server-side bean are defined by

a)javax.ejb.EJBObject

b)javax.ejb.EJBHome

c)javax.ejb.EntityBean



6. Session beans don’t have

a)ejbCreate() method

b)ejbStore() method

c)ejbRemove() method



7 EntityDescriptor extends

a)SessionDescriptor

b)ControlDescriptor

c)DeploymentDescriptor



8 After an entity bean is instantiated and placed in the pool, it is given reference to a -----------------------

a)javax.ejb.EJBHome

b)javax.ejb.EJBObject

c)javax.ejb.EJBContext



9 State of Entity Bean instances is persisted directly into

a)secondary storage

b)database



10 A stateful session bean is

a)shared among multiple clients

b)not shared among multiple clients



11 Entity beans are

a)shared components

b)non-shared components



12 EJB by default -------------- concurrent access to bean instances.

a)allows

b)prohibits



13 EJB specification -------------- synchronized key words.

a)prohibits

b)allows



14 JRMP lacks inherent support for ------------ and ------------------- services that is part of the

CORBAIIOP specification.



15 When a bean instance is in the --------- state, it can accept client requests.

a)Ready

b)Pooled

c)Does not exist

Advanced EJB interview questions

1. Are enterprise beans allowed to use Thread.sleep()? -
Enterprise beans make use of the services provided by the EJB container, such as life-cycle management. To avoid conflicts with these services, enterprise beans are restricted from performing certain operations: Managing or synchronizing threads
2. Is it possible to write two EJB’s that share the same Remote and Home interfaces, and have different bean classes? if so, what are the advantages/disadvantages? - It’s certainly possible. In fact, there’s an example that ships with the Inprise Application Server of an Account interface with separate implementations for CheckingAccount and SavingsAccount, one of which was CMP and one of which was BMP.

3. Is it possible to specify multiple JNDI names when deploying an EJB? - No. To achieve this you have to deploy your EJB multiple times each specifying a different JNDI name.
4. Is there any way to force an Entity Bean to store itself to the db? I don’t wanna wait for the container to update the db, I want to do it NOW! Is it possible? - Specify the transaction attribute of the bean as RequiresNew. Then as per section 11.6.2.4 of the EJB v 1.1 spec EJB container automatically starts a new transaction before the method call. The container also performs the commit protocol before the method result is sent to the client.
5. I am developing a BMP Entity bean. I have noticed that whenever the create method is invoked, the ejbLoad() and the ejbStore() methods are also invoked. I feel that once my database insert is done, having to do a select and update SQL queries is major overhead. is this behavior typical of all EJB containers? Is there any way to suppress these invocations? - This is the default behaviour for EJB. The specification states that ejbLoad() will be called before every transaction and ejbStore() after every transaction. Each Vendor has optimizations, which are proprietary for this scenario.
6. Can an EJB send asynchronous notifications to its clients? - Asynchronous notification is a known hole in the first versions of the EJB spec. The recommended solution to this is to use JMS, which is becoming available in J2EE-compliant servers. The other option, of course, is to use client-side threads and polling. This is not an ideal solution, but it’s workable for many scenarios.
7. How can I access EJB from ASP? - You can use the Java 2 Platform, Enterprise Edition Client Access Services (J2EETM CAS) COM Bridge 1.0, currently downloadable from Sun
8. Is there a guarantee of uniqueness for entity beans? - There is no such guarantee. The server (or servers) can instantiate as many instances of the same underlying Entity Bean (with the same PK) as it wants. However, each instance is guaranteed to have up-to-date data values, and be transactionally consistent, so uniqueness is not required. This allows the server to scale the system to support multiple threads, multiple concurrent requests, and multiple hosts.
9. How do the six transaction attributes map to isolation levels like “dirty read”? Will an attribute like “Required” lock out other readers until I’m finished updating? - The Transaction Attributes in EJB do not map to the Transaction Isolation levels used in JDBC. This is a common misconception. Transaction Attributes specify to the container when a Transaction should be started, suspended(paused) and committed between method invocations on Enterprise JavaBeans. For more details and a summary of Transaction Attributes refer to section 11.6 of the EJB 1.1 specification.
10. I have created a remote reference to an EJB in FirstServlet. Can I put the reference in a servlet session and use that in SecondServlet? - Yes. The EJB client (in this case your servlet) acquires a remote reference to an EJB from the Home Interface; that reference is serializable and can be passed from servlet to servlet. If it is a session bean, then the EJB server will consider your web client’s servlet session to correspond to a single EJB session, which is usually (but not always) what you want.
11. Can the primary key in the entity bean be a Java primitive type such as int? - The primary key can’t be a primitive type–use the primitive wrapper classes, instead. For example, you can use java.lang.Integer as the primary key class, but not int (it has to be a class, not a primitive)
12. What’s new in the EJB 2.0 specification? - Following are the main features supported in EJB 2.0: Integration of EJB with JMS, Message Driven Beans, Implement additional Business methods in Home interface which are not specific for bean instance, EJB QL.

13. How many types of protocol implementations does RMI have? - RMI has at least three protocol implementations: Java Remote Method Protocol(JRMP), Internet Inter ORB Protocol(IIOP), and Jini Extensible Remote Invocation(JERI). These are alternatives, not part of the same thing, All three are indeed layer 6 protocols for those who are still speaking OSI reference model.

14. What is the need of Remote and Home interfaces. Why can’t there be one? - In a few words, I would say that the main reason is because there is a clear division of roles and responsabilities between the two interfaces. The home interface is your way to communicate with the container, that is who is responsable of creating, locating even removing one or more beans. The remote interface is your link to the bean, that will allow you to remotely access to all its methods and members. As you can see there are two distinct elements (the container and the beans) and you need two different interfaces for accessing to both of them.

15. What is the difference between Java Beans and EJB? - Java Beans are client-side objects and EJBs are server side object, and they have completely different development, lifecycle, purpose.

16. Question With regard to Entity Beans, what happens if both my EJB Server and Database crash, what will happen to unsaved changes? Is there any transactional log file used? - Actually, if your EJB server crashes, you will not even be able to make a connection to the server to perform a bean lookup, as the server will no longer be listening on the port for incoming JNDI lookup requests. You will lose any data that wasn’t committed prior to the crash. This is where you should start looking into clustering your EJB server. Any unsaved and uncommited changes are lost the moment your EJB Server crashes. If your database also crashes, then all the saved changes are also lost unless you have some backup or some recovery mechanism to retrieve the data. So consider database replication and EJB Clustering for such scenarios, though the occurence of such a thing is very very rare. Thx, Uma All databse have the concept of log files(for exampe oracle have redo log files concept). So if data bases crashes then on starting up they fill look up the log files to perform all pending jobs. But is EJB crashes, It depend upon the container how frequenlty it passivates or how frequesntly it refreshes the data with Database.

17. Question Can you control when passivation occurs? - The developer, according to the specification, cannot directly control when passivation occurs. Although for Stateful Session Beans, the container cannot passivate an instance that is inside a transaction. So using transactions can be a a strategy to control passivation. The ejbPassivate() method is called during passivation, so the developer has control over what to do during this exercise and can implement the require optimized logic. Some EJB containers, such as BEA WebLogic, provide the ability to tune the container to minimize passivation calls. Taken from the WebLogic 6.0 DTD - “The passivation-strategy can be either “default” or “transaction”. With the default setting the container will attempt to keep a working set of beans in the cache. With the “transaction” setting, the container will passivate the bean after every transaction (or method call for a non-transactional invocation).”

18. Does RMI-IIOP support dynamic downloading of classes? - No, RMI-IIOP doesn’t support dynamic downloading of the classes as it is done with CORBA in DII (Dynamic Interface Invocation).Actually RMI-IIOP combines the usability of Java Remote Method Invocation (RMI) with the interoperability of the Internet Inter-ORB Protocol (IIOP).So in order to attain this interoperability between RMI and CORBA,some of the features that are supported by RMI but not CORBA and vice versa are eliminated from the RMI-IIOP specification.
19. Does EJB 1.1 support mandate the support for RMI-IIOP ? What is the meaning of “the client API must support the Java RMI-IIOP programming model for portability, but the underlying protocol can be anything” ? - EJB1.1 does mandate the support of RMI-IIOP. There are 2 types of implementations that an EJB Server might provide: CORBA-based EJB Servers and Proprietry EJB Servers. Both support the RMI-IIOP API but how that API is implemented is a different story. (NB: By API we mean the interface provided to the client by the stub or proxy). A CORBA-based EJB Server actually implements its EJB Objects as CORBA Objects (it therefore encorporates an ORB and this means that EJB’s can be contacted by CORBA clients (as well as RMI-IIOP clients) A proprietry EJB still implements the RMI-IIOP API (in the client’s stub) but the underlying protocol can be anything. Therefore your EJB’s CANNOT be contacted by CORBA clients. The difference is that in both cases, your clients see the same API (hence, your client portability) BUT how the stubs communicate with the server is different.

20. The EJB specification says that we cannot use Bean Managed Transaction in Entity Beans. Why? - The short, practical answer is… because it makes your entity beans useless as a reusable component. Also, transaction management is best left to the application server - that’s what they’re there for. It’s all about atomic operations on your data. If an operation updates more than one entity then you want the whole thing to succeed or the whole thing to fail, nothing in between. If you put commits in the entity beans then it’s very difficult to rollback if an error occurs at some point late in the operation.
21. Can I invoke Runtime.gc() in an EJB? - You shouldn’t. What will happen depends on the implementation, but the call will most likely be ignored. You should leave system level management like garbage collection for the container to deal with. After all, that’s part of the benefit of using EJBs, you don’t have to manage resources yourself.

22. What is clustering? What are the different algorithms used for clustering? - Clustering is grouping machines together to transparantly provide enterprise services.The client does not now the difference between approaching one server or approaching a cluster of servers.Clusters provide two benefits: scalability and high availability. Further information can be found in the JavaWorld article J2EE Clustering.

23. What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other? - Entity Beans actually represents the data in a database. It is not that Entity Beans replaces JDBC API. There are two types of Entity Beans Container Managed and Bean Mananged. In Container Managed Entity Bean - Whenever the instance of the bean is created the container automatically retrieves the data from the DB/Persistance storage and assigns to the object variables in bean for user to manipulate or use them. For this the developer needs to map the fields in the database to the variables in deployment descriptor files (which varies for each vendor). In the Bean Managed Entity Bean - The developer has to specifically make connection, retrive values, assign them to the objects in the ejbLoad() which will be called by the container when it instatiates a bean object. Similarly in the ejbStore() the container saves the object values back the the persistance storage. ejbLoad and ejbStore are callback methods and can be only invoked by the container. Apart from this, when you use Entity beans you dont need to worry about database transaction handling, database connection pooling etc. which are taken care by the ejb container. But in case of JDBC you have to explicitly do the above features. what suresh told is exactly perfect. ofcourse, this comes under the database transations, but i want to add this. the great thing about the entity beans of container managed, whenever the connection is failed during the transaction processing, the database consistancy is mantained automatically. the container writes the data stored at persistant storage of the entity beans to the database again to provide the database consistancy. where as in jdbc api, we, developers has to do manually.


24. What is the role of serialization in EJB? - A big part of EJB is that it is a framework for underlying RMI: remote method invocation. You’re invoking methods remotely from JVM space ‘A’ on objects which are in JVM space ‘B’ — possibly running on another machine on the network. To make this happen, all arguments of each method call must have their current state plucked out of JVM ‘A’ memory, flattened into a byte stream which can be sent over a TCP/IP network connection, and then deserialized for reincarnation on the other end in JVM ‘B’ where the actual method call takes place. If the method has a return value, it is serialized up for streaming back to JVM A. Thus the requirement that all EJB methods arguments and return values must be serializable. The easiest way to do this is to make sure all your classes implement java.io.Serializable.
25. What is EJB QL? - EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence. EJB QL is introduced in the EJB 2.0 specification. The EJB QL query language defines finder methods for entity beans with container managed persistenceand is portable across containers and persistence managers. EJB QL is used for queries of two types of finder methods: Finder methods that are defined in the home interface of an entity bean and which return entity objects. Select methods, which are not exposed to the client, but which are used by the Bean Provider to select persistent values that are maintained by the Persistence Manager or to select entity objects that are related to the entity bean on which the query is defined.

Database- Frequently Asked Questions

1.) Explain Various Normalization Forms?

The Normal Forms Are As Follows…

First normal form (1NF) sets the basic rules for an organized database:

* Eliminate duplicative columns from the same database table.
* Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).

Second normal form (2NF) further Handles the concept of removing duplicative data:

* Meet all the requirements of the first normal form.
* Remove subsets of data that apply to multiple rows of a table and place them in separate tables.
* Create relationships between these new tables and their predecessors through the use of foreign keys.

Third normal form (3NF) goes one large step further:

* Meet all the requirements of the second normal form.
* Remove columns that are not dependent upon the primary key.

Finally, fourth normal form (4NF) has one additional requirement:

* Meet all the requirements of the third normal form.
* A relation is in 4NF if it has no multi-valued dependencies


2.) What is the difference between delete,drop and truncate?

The delete statement will result in the table spaces or memories would remain as the current size and table structureremain in the database. Delete is not effective when you use it to remove all data from a table, because it takes up storeage spaces due to unclear memories. The truncate statement will result in clearing table spaces or memories and the table structure remain in the database. Therefore it free table storage spaces and only use it when you need to remove all data from a table. The drop statement will result in completely removing the table from the database. Note: Statements above are made with the assumption that a commit is has been executed. Once a commit statement is executed (commit is final). Therefore, rollback a transaction will not work if commit statement is executed.

3.) Which view shows all partitions of a table and their tablespaces?

user_tab_partitions,all_tab_partitions,dba_tab_partitions

4.) What is a value set?

A set of permitted values for the given attribute. eg GRADE attribute in STUDENT table can have only values like A, B,C, D only.

5.) Difference between user and end-user?

The final or ultimate user of a computer system. The end user is the individual who uses the product after it has been fully developed and marketed. The term is useful because it distinguishes two classes of users, users who require a bug -free and finished product (end users), and users who may use the same product for development purposes. The term end user usually implies an individual with a relatively low level of computer expertise. Unless you are a programmer or engineer, you are almost certainly an end user. An individual who uses a computer. This includes expert programmers as well as novices. An end user is any individual who runs an application program.

6.) Briefly explain the difference between first, second, third and fourth normal forms?

1NF: A table is set to be in first NF if we identify the functional dependency. 2NF: A table is set to be in first NF if we identify and delete partial functional dependency. 3NF: A table is set to be in 3rd NF when we identify and delete transitive dependency. Functional dependency: identify a non key attribute which is depends on key attribute. Partial functional dependency: identify an attribute which is partially depends on key attribute. Transitive: identify an key attribute which is independent itself.

7.) What is ER Diagram?

The Entity-Relationship (ER) model was originally proposed by Peter in 1976 [Chen76] as a way to unify the network and relational database views. Simply stated the ER model is a conceptual data model that views the real world as entities and relationships. A basic component of the model is the Entity-Relationship diagram which is used to visually represents data objects.Since Chen wrote his paper the model has been extended and today it is commonly used for database design For the databasedesigner, the utility of the ER model is: it maps well to the relational model. The constructs used in the ER model can easily be transformed into relational tables. it is simple and easy to understand with a minimum of training. Therefore, the model can be used by the database designer to communicate the design to the end user. In addition, the model can be used as a design plan by the database developer to implement a data model in a specific database management software