Interview Questions 1 - 10  «Prev Next»

Procedural Data Abstraction

  1. What is abstraction?

    Answer:
    Abstraction is a powerful technique that helps programmers deal with complex issues in piecemeal fashion. An abstraction is a model of a physical entity or activity.

  2. What is procedural abstraction?

    Answer:
    Procedural abstraction is the philosophy that procedure development should separate the concern of what is to be achieved by a procedure (a Java method) from the details of how it is to be achieved.

  3. What is data abstraction?

    Answer:
    The idea of data abstraction is to specify the data objects for a problem and operations to be performed on these data objects without being overly concerned with how they (the data objects) will be represented and stored in memory.

  4. What is the difference between the 1) logical view and the 2) physical view of an object?

    Answer:
    For the logical view of the data object, we can describe what information is stored in the data object without being specific as to how the information is organized and represented.

  5. What is one advantage of procedural abstraction and data abstraction?

    Answer:
    They enable the designer to make implementation decisions in a piecemeal fashion. (Excerpt: The higher class can access the data objects only through its methods.)

  6. What are the advantages of allowing Higher Level Classes to access the DAO only through its methods?

    Answer:
    If the higher level classes reference a DAO only through its methods, the higher-level class will not have to be rewritten.

  7. What is information hiding?

    Answer:
    The process of hiding the details of a class's implementation from users of the class is called information hiding. In computer science, information hiding is the principle of segregation of the design decisions in a computer program that are most likely to change, thus protecting other parts of the program from extensive modification if the design decision is changed. The protection involves providing a stable interface which protects the remainder of the program from the implementation (the details that are most likely to change).

  8. What is the purpose of encapsulation?

    Answer:
    One way to make code reusable is to encapsulate or combine data elements together with methods that operate on that data in a separate program module. Object Oriented Programming
    Encapsulation is a quality that exists in classes with well-defined and controlled interfaces. When a class is fully encapsulated, it is possible to change the implementation of the class without impacting other objects that use the class.
    A fully encapsulated class declares all of its variables as private and provides methods for getting and setting the properties represented by field variables.

  9. What is an ADT (Abstract Data Type)?

    Answer:
    The combination of data together with its methods. The notion of abstract data types is related to the concept of data abstraction, important in object-oriented programming and design by contract methodologies for software

  10. How do you access the data within an (ADT) Abstract Data Type?

    Answer:
    The term ADT is an abbreviation of Abstract Data Type. An ADT is a data type that is written using good information hiding techniques. Thus in Java, an ADT is basically the same thing as a well-encapsulated class definition.