0% found this document useful (0 votes)
11 views

detailed_answers_to_programming_questions

Uploaded by

nacc7419
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

detailed_answers_to_programming_questions

Uploaded by

nacc7419
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Q: Basics about structure, linked list, queue.

A: A structure in programming groups related variables of different types under a


single name, allowing logical grouping of data. A linked list is a dynamic data
structure where elements (nodes) are linked using pointers, making it efficient for
insertion and deletion. A queue is a linear data structure that follows the First-
In-First-Out (FIFO) principle, widely used in scheduling and buffering.

Q: Define Polymorphism.
A: Polymorphism in programming allows methods or functions to process objects
differently based on their type. For example, in Object-Oriented Programming, it
enables method overloading and overriding, providing flexibility and reusability.

Q: Define the term’s classes and objects.


A: A class is a blueprint or template that defines the attributes and behaviors
(methods) of objects. An object is an instance of a class, representing a real-
world entity with specific data and functionality.

Q: Difference between Call by Value and Call by Address?


A: In call by value, a copy of the variable is passed to the function, and
modifications do not affect the original variable. In call by address, the address
of the variable is passed, allowing the function to modify the original data
directly.

Q: Difference between merge sort and insertion sort?


A: Merge sort is a divide-and-conquer algorithm that recursively splits the array
and merges it in sorted order. It has O(n log n) time complexity and is suitable
for large datasets. Insertion sort iteratively places elements in the correct
position, with O(n^2) complexity for large datasets but efficient for small or
nearly sorted data.

Q: Differentiate between null and void pointer.


A: A null pointer is a pointer that points to nothing (null address) and is used as
a marker. A void pointer is a generic pointer that can hold the address of any data
type, but it requires explicit casting for operations.

Q: Explain about Joins, Views, Normalization, Triggers?


A: Joins are SQL operations that combine rows from multiple tables based on a
related column. Views are virtual tables created by querying data from one or more
tables. Normalization is the process of organizing a database to reduce redundancy
and improve integrity. Triggers are automated actions executed in response to
specific database events.

Q: Explain constructor and destructor.


A: A constructor is a special method in a class that initializes objects when they
are created, often setting initial values. A destructor is a method that cleans up
resources when an object is destroyed, such as closing files or releasing memory.

Q: Explain data structures in Python.


A: Python provides several built-in data structures: lists (dynamic arrays), tuples
(immutable sequences), sets (unordered collections of unique items), dictionaries
(key-value pairs), stacks, queues, and deques (double-ended queues).

Q: Explain function overloading concept.


A: Function overloading allows multiple functions with the same name to exist but
with different parameter lists. It improves code readability and reusability.
However, it is natively supported in some languages like C++ but simulated in
Python.

You might also like