Java JNDI Interview Preparation Guide
Download PDF

JNDI frequently Asked Questions in various Java naming and directory interfaces job Interviews by interviewer. The set of JNDI interview questions here ensures that you offer a perfect answer to the interview questions posed to you. Get preparation of JNDI job interview

7 JNDI Questions and Answers:

1 :: Java Naming And Directory Interfaces (JNDI) Job Interview Questions And Answers!

Is JNDI a protocol? Where is it used?
Explain the components of JNDI.
What is Context and InitialContext?
Difference between JNDI lookup(), list(), listBindings(), and search().
What protocols does JNDI provide an interface to?
What are native methods? How do you use them?

2 :: Explain what is a naming service in JNDI?

A naming service maintains a set of bindings that relate names to objects.
A naming service follows naming convention due to which all objects in a naming system are named in the same way.
Clients use the naming service to locate objects by name.

3 :: Can you explain why we need JNDI if communication to systems via LDAP is possible?

JNDI is also used to lookup resources like a database or a message queue. With JNDI you get a uniform way to access directory services.

4 :: Tell me what do you know about LDAP?

Lightweight Directory Access Protocol
Developed by the University of Michigan.
It is a protocol for locating organizations, individuals, and other resources such as files and devices in a network, whether on the public Internet or on a corporate intranet.

5 :: What is the importance of JNDI?

To centralize the information storage the enterprises uses LDAP. The information is of user names, passwords, email addresses, printers, determination of database access. Multiple database management is reduced by centralizing the information.

6 :: What do you know about the directory service of JNDI?

Searching for files and directories done by providing Directory services. A directory service is a set of names. The user and resource information and machine addresses are summarized by directory service. For example, for a given user name, the service returns the attributes of the user such as telephone no, email address etc. A directory service use the databases that specialized and hierarchical in design.

7 :: How to use LDAP to work with a directory service?

An LDAP directory can be distributed among many servers.
Each server can have a replicated version of the total directory that is synchronized periodically.
An LDAP server is called a Directory System Agent (DSA).
An LDAP server that receives a request from a user takes responsibility for the request, passing it to other DSAs as necessary, but ensuring a single coordinated response for the user.