Here are the most commonly asked Technical Interview Questions with Answers.
(Specially for CSE and IT students.)
1. What is Data Structure?
Data structure is a way of organizing data so that the information can be organized, processed, stored, and accessed quickly and effectively.
2. Data Structure Types.
Data structures can be classified into Linear data structure and Non- Linear data structure.
Linear Data Structure:
- Array
- Stack
- Queue
- Linked List
Non - Linear Data Structure:
- Graph
- Trees
3. Define Linear and Non- Linear Data Structure.
A linear data structure is a structure in which the elements are stored sequentially, and elements are connected to the previous and the next element. Elements can be traversed in a single run. The implementation of linear data structures is easier.
A non-linear data structure is another type of data structure in which the elements are not arranged in a contiguous manner. Elements cannot be traversed in a single run. Element can be connected to more than two elements.
4. Stack
Stack is a linear data structure which follows LIFO(Last In First Out) principle. A real time example of stack is plates placed over one another.
5. Linked List
A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements are linked using pointers. It consists of nodes where each node contains a data field and a link to the next node in the list.
6. Advantages of Linked List
- Dynamic data structure
- Insertion and deletion operations are easier.
- Stack and queue can be easily implemented using linked list.
- Memory is utilized efficiently.
7. Queue
A Queue is a linear structure which follows First In First Out (FIFO) principle. A good example of a queue is any queue of people where the person who came first is served first.
8. Binary Tree
A tree whose elements have at most 2 children is called a binary tree. They are named left and right child.
9. Binary Search Tree
A binary search tree follows an to arrange the elements. The value of left node must be smaller than the parent node, and the value of right node must be greater than the parent node.
10. Linear Search
A linear search is a method of searching a data set. Starting at the beginning of the data set, each item of data is examined until a match is made. Once the item is found, the search ends.
11. Stack and Queue difference
Stack:
- Follows LIFO principle.
- Insertion and deletion takes place only from one end(top).
- Insertion is called push and deletion is called pop.
Queue:
- Follows FIFO principle.
- Insertion takes place at rear end and deletion takes place at front end.
- Insertion is called enqueue and deletion is called dequeue.
12. Recursive Algorithm:
A recursive algorithm calls itself with smaller input values and returns the result for the current input by carrying out basic operations on the returned value for the smaller input.
13. Name some sorting algorithms.
- Selection Sort
- Bubble Sort.
- Insertion Sort.
- Merge Sort
- Quick Sort.
- Heap Sort
- Shell sort.
14. Bubble Sort
It is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.
15. Merge Sort
Merge Sort uses divide and conquer algorithm. It divides the input array into two halves, calls itself for the two halves, and then merges the two sorted halves.
16. For Loop Syntax
for ( initialization; condition; increment )
{
statement(s);
}
17. Switch Statement
Switch statement evaluates a given expression and based on the evaluated value, it executes the statements associated with it.
18. Method Overriding
If a subclass has the same method as declared in the parent class, it is known as method overriding in Java.
19. Method Overloading
If a class has multiple methods having same name but different in parameters, it is known as Method Overloading.
20. Polymorphism
Polymorphism is the ability of an object to take many forms.
21. Why multiple inheritance is not supported in Java
Multiple inheritance is not supported in Java to prevent ambiguity. It is supported using interfaces only.
22. What is Class?
Class is a blue print of how my objects should represent. It is also a collection of variables and methods.
23. Abstract Class
A class which is declared with the abstract keyword is known as an abstract class in Java.
24. Interface
It is a Collection of variables and abstract methods.
25. Method
It is used to perform a specific task.
26. Conditional Statements
These are decision making statements based on conditions. These conditions are specified by a set of conditional statements having boolean expressions which are evaluated to a boolean value true or false.
27. Pros and Cons of Conditional Operator
Pros:
Replace simple if statements with a single line expression. Increases code readability by reducing number of lines of code.
Cons:
Some people consider it hard to read.
28. Compound assignment Operator
Compound-assignment operator provides a shorter syntax for assigning the result of an arithmetic operator. They perform the operation on the two operands before assigning the result to the first operand.
Example:
a += 3 is same as a = a + 3.
29. Size of operator
It is a compile-time unary operator and used to compute the size of its operand. It returns the size of a variable. It can be applied to any data type, float type, pointer type variables.
30. SDLC Phases
- Requirement analysis and planning.
- Defining
- Designing
- Building
- Testing
- Deployment
Requirement analysis and planning:
Performed inputs from the customer, the sales department, market surveys and domain experts in the industry.
Defining:
clearly define and document the product requirements and get them approved from the customer.
Designing:
A design approach clearly defines all the architectural modules of the product along with its communication and data flow representation with the external and third party modules.
Building:
Coding is done with all other process to build the product.
Testing:
Product defects are reported, tracked, fixed and retested, until the product reaches the quality standards.
Deployment:
Once the product is tested and ready to be deployed it is released formally in the appropriate market.
32. Debugging
Debugging is the process of detecting and removing of existing and potential errors in a software code that can cause it to behave unexpectedly.
33. Differentiate Primary and Unique Key
Primary Key:
- Cannot accept null values
- Only one primary key
Unique Key:
- Accept Null Values
- Has more than one unique key.
34. Unique Constraint
The unique constraint ensures that all values in a column are different.
35. Foreign Key
A Foreign key is a field in one table, that refers to the primary key in another table.
36. Another name for rows and columns
Rows are also known as "Tuples" and columns are known as "Attributes".
37. Drop and Truncate difference
Drop:
It is used to remove table definition and its contents.
Truncate:
It is used to delete all rows from the table.
38. Delete and Truncate Difference
Delete:
Removes one row at a time and used to remove specified rows.
Truncate:
Delete all rows from a table.
39. DML Commands
Data manipulation language controls access to data and to the database. Insert, Update, Delete, Lock are some DML commands.
40. DDL Commands
Data definition language is a set of SQL commands used to create, modify, and delete database structures but not data. Create, Drop, Alter, Truncate, Comment, Rename are some DDL commands.
41. SQL Commands
SQL commands are instructions used to communicate with the database. It can perform various tasks like create a table, add data to tables, drop the table, modify the table, set permission for users.
42. Aggregate Functions
An aggregate function allows to perform a calculation on a set of values to return a single value. AVG, COUNT, MIN, MAX, SUM are some aggregate functions.
43. Call by value and call by reference difference
Call by value:
The value of each variable in calling function is copied into corresponding variables of the called function.
Call by Reference:
The address of actual variables in the calling function are copied into the variables of the called function.
44. Function Call
Function call is called inside a program whenever it is required to call a function. It is only called by its name in the main() function of a program. We can pass the parameters to a function calling in the main() function.
45. Void
It means “no type”, “no value” or “no parameters”. It is used to indicate, a function does not return value, does not accept parameters, does not have specific type and could not point different types.
46. Where will a function go when called?
When a function is "called" the program leaves the current section of code and begins to execute the first line inside the function.
47. Formal Parameters
The parameter used in function definition statement which contain data type on its time of declaration is called formal parameter.
48. Actual Parameters
When a function is called, the values that are passed in the function call are called the arguments or actual parameters.
49. Does variable contain address
Any programming element stored in memory has an address and that address can be found and stored in a pointer. Hence variable contains address.
0 Comments