Escolar Documentos
Profissional Documentos
Cultura Documentos
Polymorphism
In object-oriented programming, polymorphism (from the Greek meaning "having multiple
forms") is the characteristic of being able to assign a different meaning or usage to
something in different contexts - specifically, to allow an entity such as a variable, a function,
or an object to have more than one form. There are several different kinds of polymorphism.
Method Overloading: In Java, it is possible to define two or more methods of same name in
a class, provided that there argument list or parameters are different. This concept is known
as Method Overloading.
Method Overriding: Child class has the same method as of base class. In such cases child
class overrides the parent class method without even touching the source code of the base
class. This feature is known as method overriding.
2. Inheritance: In object-oriented programming, inheritance is the concept that when a class of
objects is defined, any subclass that is defined can inherit the definitions of one or more
general classes. This means for the programmer that an object in a subclass need not carry
its own definition of data and methods that are generic to the class (or classes) of which it is
a part. This not only speeds up program development; it also ensures an inherent validity to
the defined subclass object (what works and is consistent about the class will also work for
the subclass).
3. Socket: Sockets allow communication between two different processes on the same or
different machines.
A socket is one endpoint of a two-way communication link between two programs
running on the network. A socket is bound to a port number so that the TCP layer
can identify the application that data is destined to be sent to.
4. Provide an algorithm to reverse a linked list without using recursion.
15. What are pointers in C? Give an example where to illustrate their significance.
A pointer is a variable whose value is the address of another variable, i.e., direct address of
the memory location.
uses of pointers:
1. to access array elements
2. Pointers use in dynamic memory allocation linked lists, trees, graphs.
3. Passing data in & out of without coping.
4. Create and manage your own data types.
16. What is HTTP? Give some of its methods.
The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed,
collaborative, hypermedia information systems. The primary or most-commonly-used HTTP
verbs (or methods, as they are properly called) are POST, GET, PUT, PATCH, and DELETE.
These correspond to create, read, update, and delete (or CRUD) operations, respectively.
GET-The GET method is used to retrieve information from the given server using a
given URI. Requests using GET should only retrieve data and should have no other
effect on the data.
HEAD-Same as GET, but transfers the status line and header section only.
POST-A POST request is used to send data to the server, for example, customer
information, file upload, etc. using HTML forms.
PUT-Replaces all current representations of the target resource with the uploaded
content.
DELETE-Removes all current representations of the target resource given by a URI.
CONNECT-Establishes a tunnel to the server identified by a given URI.
OPTIONS-Describes the communication options for the target resource.
TRACE-Performs a message loop-back test along the path to the target resource.
17. Briefly describe a B+ tree. What is bulk loading in it?
19. Describe the merge sort principle and what will be its time complexity?
21. What is a web server? What are the load limits in it?
24. Given an array of integers, devise a program to replace every element with the next greatest
element on the right side in the array. Also, replace the last element with 5 as there no
element on the right side of it.
34. Write a program to know whether the input number is an Armstrong number.
37. How will you sort the elements of array in descending order?