Collection and sharing of, interview questions and answers asked in various interviews, faqs and articles.....
Interview Questions On JMS
Messaging occurs between applications or software components which may or may not be distributive in nature.In enterprise applications where the possibility of distributed components across the geographies are too high, messaging comes as an obvious choice to make them communicate with each other.
In Java , middleware(which acts as an infrastructural support for messaging) level messaging is supported with Java Message Service(JMS) APIs.JMS is a specification (java.sun.com/products/jms ) that describes the properties and behavior of an information pipe for Java software. It also describes how Java client applications interact with the information pipe.
JMS helps business applications asynchronously send and receive critical business data and events.It supports both message queueing and publish-subscribe styles of messaging.
The constituents of JMS are producers,consumers and messages themselves through interfaces' abstraction.The beauty lies here in loose coupling and infact message broker systems need not go in details of message-contents, they just have to deliver them between systems reliably.There is not dependency on APIs of systems involved in message communications.
In case of RMI, the message passing is tightly coupled with APIs of remote application or component.That is what makes JMS as an obvious choice in enterprise applications for reliable messaging.
When is JMS needed?
JMS can be used in following scenarios:
- When distributed components,applications within an enterprise need to communicate with one another without creating any sort of dependencies(loose coupling support by JMS).This communication could either be synchronous or asynchronous.
- When an application has to communicate with a provider without worrying its availability,.i.e. in an asynchronous way.A synchronous communication occurs when message requested is consumed immediately that means both producer and consumer are up and running at the same time while in case of asynchronous communication it is not necessary to have both entities available at the same time. An application may like to send a message to other without waiting for response and keep on doing its job.
How Does the JMS API Work with the Java EE Platform?
The JMS API in the Java EE platform has the following features.
* Application clients, Enterprise JavaBeans (EJB) components, and web components can send or synchronously receive a JMS message. Application clients can in addition receive JMS messages asynchronously. (Applets, however, are not required to support the JMS API.)
* Message-driven beans, which are a kind of enterprise bean, enable the asynchronous consumption of messages. A JMS provider can optionally implement concurrent processing of messages by message-driven beans.
* Message send and receive operations can participate in distributed transactions, which allow JMS operations and database accesses to take place within a single transaction.
The JMS API enhances the Java EE platform by
-allowing loosely coupled, reliable, asynchronous interactions among Java EE components and legacy systems capable of messaging.
-supporting distributed transactions and allowing for the concurrent consumption of messages. For more information, see the Enterprise JavaBeans specification, v3.0.
Moreover, a JMS provider can be integrated with the application server using the Java EE Connector architecture. You access the JMS provider through a resource adapter. This capability allows vendors to create JMS providers that can be plugged in to multiple application servers, and it allows application servers to support multiple JMS providers.
Explain JMS API Architecture.
A JMS application is consisted of the following parts as shown in the figure at the end of this post:
-JMS Provider is a messaging system that implements the JMS interfaces and provides administrative and control features.
-JMS Clients are any Java EE application component except Applets.
-Messages are objects that exchange information between JMS clients.
-Administrative objects are preconfigured JMS objects created by an administrator for the use of clients.
Administrative tools bind destinations and connection factories into a JNDI namespace. A JMS client can then use resource injection to access the administered objects in the namespace and then establish a logical connection to the same objects through the JMS provider.
Explain Point-to-Point Messaging Domain.
The constituents of a point-to-point (PTP) product or application are message queues, senders, and receivers. Each message is addressed to a specific queue, and receiving clients extract messages from specific queue(s) . Queues retain all messages sent to them until the messages are consumed or until the messages expire.
So in PTP messaging domain:-
# Each message has only one consumer.
# There are no timing dependencies on a sender and a receiver of a message . The receiver can fetch the message oblivious of its availability when the client sent the message.
# The receiver acknowledges the successful processing of a message.
PTP messaging is used when every message sent must be processed successfully by one consumer.
Explain Publish/Subscribe Messaging Domain.
In a publish/subscribe (pub/sub) product or application, clients(publishers as well as subscribers) address messages to a topic, which functions similar to a bulletin board. Both publishers and subscribers are generally anonymous and can dynamically publish or subscribe to the content hierarchy. The system takes care of distributing the messages arriving from a topic's multiple publishers to its multiple subscribers. Topics retain messages only as long as it takes to distribute them to current subscribers.
Pub/sub messaging has the following characteristics.
* Each message can have multiple consumers.
* Publishers and subscribers have a timing dependency. A client that subscribes to a topic can consume only messages published after the client has created a subscription, and the subscriber must continue to be active in order for it to consume messages.
Interview Questions On JMS
Messaging occurs between applications or software components which may or may not be distributive in nature.In enterprise applications where the possibility of distributed components across the geographies are too high, messaging comes as an obvious choice to make them communicate with each other.
In Java , middleware(which acts as an infrastructural support for messaging) level messaging is supported with Java Message Service(JMS) APIs.JMS is a specification (java.sun.com/products/jms ) that describes the properties and behavior of an information pipe for Java software. It also describes how Java client applications interact with the information pipe.
JMS helps business applications asynchronously send and receive critical business data and events.It supports both message queueing and publish-subscribe styles of messaging.
The constituents of JMS are producers,consumers and messages themselves through interfaces' abstraction.The beauty lies here in loose coupling and infact message broker systems need not go in details of message-contents, they just have to deliver them between systems reliably.There is not dependency on APIs of systems involved in message communications.
In case of RMI, the message passing is tightly coupled with APIs of remote application or component.That is what makes JMS as an obvious choice in enterprise applications for reliable messaging.
When is JMS needed?
JMS can be used in following scenarios:
- When distributed components,applications within an enterprise need to communicate with one another without creating any sort of dependencies(loose coupling support by JMS).This communication could either be synchronous or asynchronous.
- When an application has to communicate with a provider without worrying its availability,.i.e. in an asynchronous way.A synchronous communication occurs when message requested is consumed immediately that means both producer and consumer are up and running at the same time while in case of asynchronous communication it is not necessary to have both entities available at the same time. An application may like to send a message to other without waiting for response and keep on doing its job.
How Does the JMS API Work with the Java EE Platform?
The JMS API in the Java EE platform has the following features.
* Application clients, Enterprise JavaBeans (EJB) components, and web components can send or synchronously receive a JMS message. Application clients can in addition receive JMS messages asynchronously. (Applets, however, are not required to support the JMS API.)
* Message-driven beans, which are a kind of enterprise bean, enable the asynchronous consumption of messages. A JMS provider can optionally implement concurrent processing of messages by message-driven beans.
* Message send and receive operations can participate in distributed transactions, which allow JMS operations and database accesses to take place within a single transaction.
The JMS API enhances the Java EE platform by
-allowing loosely coupled, reliable, asynchronous interactions among Java EE components and legacy systems capable of messaging.
-supporting distributed transactions and allowing for the concurrent consumption of messages. For more information, see the Enterprise JavaBeans specification, v3.0.
Moreover, a JMS provider can be integrated with the application server using the Java EE Connector architecture. You access the JMS provider through a resource adapter. This capability allows vendors to create JMS providers that can be plugged in to multiple application servers, and it allows application servers to support multiple JMS providers.
Explain JMS API Architecture.
A JMS application is consisted of the following parts as shown in the figure at the end of this post:
-JMS Provider is a messaging system that implements the JMS interfaces and provides administrative and control features.
-JMS Clients are any Java EE application component except Applets.
-Messages are objects that exchange information between JMS clients.
-Administrative objects are preconfigured JMS objects created by an administrator for the use of clients.
Administrative tools bind destinations and connection factories into a JNDI namespace. A JMS client can then use resource injection to access the administered objects in the namespace and then establish a logical connection to the same objects through the JMS provider.
Explain Point-to-Point Messaging Domain.
The constituents of a point-to-point (PTP) product or application are message queues, senders, and receivers. Each message is addressed to a specific queue, and receiving clients extract messages from specific queue(s) . Queues retain all messages sent to them until the messages are consumed or until the messages expire.
So in PTP messaging domain:-
# Each message has only one consumer.
# There are no timing dependencies on a sender and a receiver of a message . The receiver can fetch the message oblivious of its availability when the client sent the message.
# The receiver acknowledges the successful processing of a message.
PTP messaging is used when every message sent must be processed successfully by one consumer.
Explain Publish/Subscribe Messaging Domain.
In a publish/subscribe (pub/sub) product or application, clients(publishers as well as subscribers) address messages to a topic, which functions similar to a bulletin board. Both publishers and subscribers are generally anonymous and can dynamically publish or subscribe to the content hierarchy. The system takes care of distributing the messages arriving from a topic's multiple publishers to its multiple subscribers. Topics retain messages only as long as it takes to distribute them to current subscribers.
Pub/sub messaging has the following characteristics.
* Each message can have multiple consumers.
* Publishers and subscribers have a timing dependency. A client that subscribes to a topic can consume only messages published after the client has created a subscription, and the subscriber must continue to be active in order for it to consume messages.
PHP Interview questions from YAHOO
1. Which of the following will not add john to the users array?
1. $users[] = 'john';
2. array_add($users,'john');
3. array_push($users,'john');
4. $users ||= 'john';
2. What’s the difference between sort(), assort() and ksort? Under what circumstances would you use each of these?
3. What would the following code print to the browser? Why?
$num = 10;
function multiply(){
$num = $num * 10;
}
multiply();
echo $num;
4. What is the difference between a reference and a regular variable? How do you pass by reference & why would you want to?
5. What functions can you use to add library code to the currently running script?
6. What is the difference between foo() & @foo()?
7. How do you debug a PHP application?
8. What does === do? What’s an example of something that will give true for ‘==’, but not ‘===’?
9. How would you declare a class named “myclass” ? with no methods or properties?
10. How would you create an object, which is an instance of ‘“myclass’??
11. How do you access and set properties of a class from within the class?
12. What is the difference between include & include_once? include & require?
13. What function would you use to redirect the browser to a new page?
1. redir()
2. header()
3. location()
4. redirect()
14. What function can you use to open a file for reading and writing?
1. fget();
2. file_open();
3. fopen();
4. open_file();
15. What’s the difference between mysql_fetch_row() and mysql_fetch_array()?
16. What does the following code do? Explain what’s going on there.
$date='08/26/2003';
print ereg_replace('“([0-9]+)/([0-9]+)/([0-9]+)'‚¬?,\\2/\\1/\\3,$date);
17. Given a line of text $string, how would you write a regular expression to strip all the HTML tags from it?
18. What’s the difference between the way PHP and Perl distinguish between arrays and hashes?
19. How can you get round the stateless nature of HTTP using PHP?
20. What does the GD library do?
21. Name a few ways to output (print) a block of HTML code in PHP?
22. Is PHP better than Perl? - Discuss.
I have no idea if there are different levels of PHP tests within YAHOO but this seems to be much easier level than something like the Zend Certification questions which require at times encyclopedic knowledge of the language (thank god I passed!).
If you havent had a chance to read the articles about interviewing programmers, they are here.
Most common HR Interview questions
1. Tell us about yourself
2. What is your view on life: what difficulties you have and how your overcome them.
3. What you like in applying possition?
4. Why you think this job is right for you and what is your pluses in comparission to other candidates?
5. What is your positive and strong moments?
6. What is your weak points.
7. Why did you quit your previous job.
8. Why did you deside to change your job?
9. What is your other job offers?
10. How succesful were your interviews in other places?
11. Will this job affect your personal life?(different hours, travel, etc.)
12. How do you see yourself in five ten years?
13. What changes would you do in your new place?
14. Who can tell us your previous job achivements?
15. What pay you want?
16. Do you have any professional connections and how you can use them on your new place?
17. How do you improve your personal experience?
18. What do you like to do in your free time?
19. When you can start?
20. What questions do you have?
Most common HR Interview questions
1. Tell us about yourself
2. What is your view on life: what difficulties you have and how your overcome them.
3. What you like in applying possition?
4. Why you think this job is right for you and what is your pluses in comparission to other candidates?
5. What is your positive and strong moments?
6. What is your weak points.
7. Why did you quit your previous job.
8. Why did you deside to change your job?
9. What is your other job offers?
10. How succesful were your interviews in other places?
11. Will this job affect your personal life?(different hours, travel, etc.)
12. How do you see yourself in five ten years?
13. What changes would you do in your new place?
14. Who can tell us your previous job achivements?
15. What pay you want?
16. Do you have any professional connections and how you can use them on your new place?
17. How do you improve your personal experience?
18. What do you like to do in your free time?
19. When you can start?
20. What questions do you have?