0% found this document useful (0 votes)
2 views65 pages

Interview Concepts

The document provides a comprehensive overview of SQL, covering its definition, types of commands, data types, keys, constraints, and normalization. It explains various SQL concepts such as queries, joins, views, and transactions, as well as the differences between SQL and NoSQL databases. Additionally, it touches on Object-Oriented Programming (OOP) and its applications in real-life scenarios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views65 pages

Interview Concepts

The document provides a comprehensive overview of SQL, covering its definition, types of commands, data types, keys, constraints, and normalization. It explains various SQL concepts such as queries, joins, views, and transactions, as well as the differences between SQL and NoSQL databases. Additionally, it touches on Object-Oriented Programming (OOP) and its applications in real-life scenarios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

SQL ​


1. What is SQL?
SQL (Structured Query Language) is a standard programming language
used to communicate with relational databases. It allows users to create,
read, update, and delete data, and provides commands to define database
schema and manage database security.

2. What is a database?

A database is an organized collection of data stored electronically,


typically structured in tables with rows and columns. It is managed by a
database management system (DBMS), which allows for efficient
storage, retrieval, and manipulation of data.

3. What are the main types of SQL commands?

SQL commands are broadly classified into:

●​ DDL (Data Definition Language): CREATE, ALTER, DROP,

TRUNCATE.

●​ DML (Data Manipulation Language): SELECT, INSERT, UPDATE,

DELETE.

●​ DCL (Data Control Language): GRANT, REVOKE.

●​ TCL (Transaction Control Language): COMMIT, ROLLBACK,

SAVEPOINT.

4. What is the difference between CHAR and VARCHAR2 data


types?
●​ CHAR: Fixed-length storage. If the defined length is not fully

used, it is padded with spaces.

●​ VARCHAR2: Variable-length storage. Only the actual data is

stored, saving space when the full length is not needed.

5. What is a primary key?

A primary key is a unique identifier for each record in a table. It ensures


that no two rows have the same value in the primary key column(s), and it
does not allow NULL values.

6. What is a foreign key?

A foreign key is a column (or set of columns) in one table that refers to the
primary key in another table. It establishes and enforces a relationship
between the two tables, ensuring data integrity.

7. What is the purpose of the DEFAULT constraint?

The DEFAULT constraint assigns a default value to a column when no


value is provided during an INSERT operation. This helps maintain
consistent data and simplifies data entry.

8. What is normalization in databases?

Normalization is the process of organizing data in a database to reduce


redundancy and improve data integrity. This involves dividing large
tables into smaller, related tables and defining relationships between
them to ensure consistency and avoid anomalies.

9. What is denormalization, and when is it used?


Denormalization is the process of combining normalized tables into larger
tables for performance reasons. It is used when complex queries and joins
slow down data retrieval, and the performance benefits outweigh the
drawbacks of redundancy.

10. What is a query in SQL?

A query is a SQL statement used to retrieve, update, or manipulate data in


a database. The most common type of query is a SELECT statement,
which fetches data from one or more tables based on specified conditions.

11. What are the different operators available in SQL?

●​ Arithmetic Operators: +, -, *, /, %

●​ Comparison Operators: =, !=, <>, >, <, >=, <=

●​ Logical Operators: AND, OR, NOT

●​ Set Operators: UNION, INTERSECT, EXCEPT

●​ Special Operators: BETWEEN, IN, LIKE, IS NULL

12. What is a view in SQL?

A view is a virtual table created by a SELECT query. It does not store data
itself, but presents data from one or more tables in a structured way.
Views simplify complex queries, improve readability, and enhance security
by restricting access to specific rows or columns.

13. What is the purpose of the UNIQUE constraint?

The UNIQUE constraint ensures that all values in a column (or


combination of columns) are distinct. This prevents duplicate values and
helps maintain data integrity.
14. What are the different types of joins in SQL?

●​ INNER JOIN: Returns rows that have matching values in both

tables.

●​ LEFT JOIN (LEFT OUTER JOIN): Returns all rows from the left

table, and matching rows from the right table.

●​ RIGHT JOIN (RIGHT OUTER JOIN): Returns all rows from the

right table, and matching rows from the left table.

●​ FULL JOIN (FULL OUTER JOIN): Returns all rows when there is a

match in either table.

●​ CROSS JOIN: Produces the Cartesian product of two tables.

15. What is the difference between INNER JOIN and OUTER


JOIN?

●​ INNER JOIN: Returns only rows where there is a match in both

tables.

●​ OUTER JOIN: Returns all rows from one table (LEFT, RIGHT, or

FULL), and the matching rows from the other table. If there is no

match, NULL values are returned for the non-matching side.

16. What is the purpose of the GROUP BY clause?

The GROUP BY clause is used to arrange identical data into groups. It is


typically used with aggregate functions (such as COUNT, SUM, AVG) to
perform calculations on each group rather than on the entire dataset.

17. What are aggregate functions in SQL?


Aggregate functions perform calculations on a set of values and return a
single value. Common aggregate functions include:

●​ COUNT(): Returns the number of rows.

●​ SUM(): Returns the total sum of values.

●​ AVG(): Returns the average of values.

●​ MIN(): Returns the smallest value.

●​ MAX(): Returns the largest value.

18. What is a subquery?

A subquery is a query nested within another query. It is often used in the


WHERE clause to filter data based on the results of another query,
making it easier to handle complex conditions.

19. What is the difference between the WHERE and HAVING


clauses?

●​ WHERE: Filters rows before any grouping takes place.

●​ HAVING: Filters grouped data after the GROUP BY clause has

been applied.​

In short, WHERE applies to individual rows, while HAVING

applies to groups.

20. What are indexes, and why are they used?

Indexes are database objects that improve query performance by


allowing faster retrieval of rows. They function like a book’s index,
making it quicker to find specific data without scanning the entire table.
However, indexes require additional storage and can slightly slow down
data modification operations.

21. What is the difference between DELETE and TRUNCATE


commands?

●​ DELETE: Removes rows one at a time and records each deletion

in the transaction log, allowing rollback. It can have a WHERE

clause.

●​ TRUNCATE: Removes all rows at once without logging individual

row deletions. It cannot have a WHERE clause and is faster than

DELETE for large data sets.

22. What is the purpose of the SQL ORDER BY clause?

The ORDER BY clause sorts the result set of a query in either ascending
(default) or descending order, based on one or more columns. This helps
present the data in a more meaningful or readable sequence.

23. What are the differences between SQL and NoSQL


databases?

●​ SQL Databases:

○​ Use structured tables with rows and columns.

○​ Rely on a fixed schema.

○​ Offer ACID properties.

●​ NoSQL Databases:
○​ Use flexible, schema-less structures (e.g.,

key-value pairs, document stores).

○​ Are designed for horizontal scaling.

○​ Often focus on performance and scalability over

strict consistency.

24. What is a table in SQL?

A table is a structured collection of related data organized into rows and


columns. Columns define the type of data stored, while rows contain
individual records.

25. What are the types of constraints in SQL?

Common constraints include:

●​ NOT NULL: Ensures a column cannot have NULL values.

●​ UNIQUE: Ensures all values in a column are distinct.

●​ PRIMARY KEY: Uniquely identifies each row in a table.

●​ FOREIGN KEY: Ensures referential integrity by linking to a

primary key in another table.

●​ CHECK: Ensures that all values in a column satisfy a specific

condition.

●​ DEFAULT: Sets a default value for a column when no value is

specified.

26. What is a cursor in SQL?


A cursor is a database object used to retrieve, manipulate, and traverse
through rows in a result set one row at a time. Cursors are helpful when
performing operations that must be processed sequentially rather than in
a set-based manner.

27. What is a trigger in SQL?

A trigger is a set of SQL statements that automatically execute in


response to certain events on a table, such as INSERT, UPDATE, or
DELETE. Triggers help maintain data consistency, enforce business rules,
and implement complex integrity constraints.

28. What is the purpose of the SQL SELECT statement?

The SELECT statement retrieves data from one or more tables. It is the
most commonly used command in SQL, allowing users to filter, sort, and
display data based on specific criteria.

29. What are NULL values in SQL?

NULL represents a missing or unknown value. It is different from zero or


an empty string. NULL values indicate that the data is not available or
applicable.

30. What is a stored procedure?

A stored procedure is a precompiled set of SQL statements stored in the


database. It can take input parameters, perform logic and queries, and
return output values or result sets. Stored procedures improve
performance and maintainability by centralizing business logic.

31. What are the ACID properties of a transaction?


ACID is an acronym that stands for Atomicity, Consistency, Isolation, and
Durability—four key properties that ensure database transactions are
processed reliably.

1. Atomicity:

●​ A transaction is treated as a single unit of work, meaning all

operations must succeed or fail as a whole.

●​ If any part of the transaction fails, the entire transaction is rolled

back.

2. Consistency:

●​ A transaction must take the database from one valid state to

another, maintaining all defined rules and constraints.

●​ This ensures data integrity is preserved throughout the

transaction process.

3. Isolation:

●​ Transactions should not interfere with each other.

●​ Even if multiple transactions occur simultaneously, each must

operate as if it were the only one in the system until it is

complete.

4. Durability:

●​ Once a transaction is committed, its changes must persist, even in

the event of a system failure.

●​ This ensures the data remains stable after the transaction is

successfully completed.
Normalization in Database Management Systems (DBMS) is a process of

organizing data to reduce redundancy and dependency by dividing large

tables into smaller ones. It helps in improving data integrity and reducing

the chances of anomalies like update, insert, and delete anomalies. The

main goal of normalization is to ensure that each table contains data that

is logically related, with minimal repetition.

Normalization is carried out through a series of steps called normal forms

(NF). Here are the main normal forms:

1. First Normal Form (1NF)

●​ Objective: Ensure that the table is in a tabular format with atomic

values.

●​ Rules:

○​ Each column must contain atomic (indivisible) values.

○​ Each column should contain values of a single type.

○​ There should be a unique identifier for each row (a primary

key).

2. Second Normal Form (2NF)

●​ Objective: Remove partial dependencies.

●​ Rules:

○​ The table must be in 1NF.


○​ All non-key attributes should be fully functionally dependent

on the primary key (i.e., there should be no partial

dependency).

3. Third Normal Form (3NF)

●​ Objective: Remove transitive dependencies.

●​ Rules:

○​ The table must be in 2NF.

○​ There should be no transitive dependency (a non-key attribute

should not depend on another non-key attribute).

4. Boyce-Codd Normal Form (BCNF)

●​ Objective: Ensure that the table is in an even stricter form of 3NF.

●​ Rules:

○​ The table must be in 3NF.

○​ Every determinant must be a candidate key. (A determinant is

any attribute on which some other attribute is fully

functionally dependent.)

Higher Normal Forms (4NF, 5NF)

●​ Objective: Deal with more complex relationships and multi-valued

dependencies.

●​ These forms are used less frequently and mostly in specialized

cases.
Benefits of Normalization

●​ Minimizes data redundancy and saves storage space.

●​ Improves data consistency and integrity.

●​ Reduces the chances of anomalies during data operations.

Example

Consider a table that stores data about employees and departments.

Without normalization, there could be repeated department data for each

employee. Normalization would separate employees and departments into

distinct tables and link them via foreign keys.

Here’s a breakdown of the differences between NDBMS (Network

Database Management System) and RDBMS (Relational Database

Management System):

1. RDBMS (Relational Database Management System)

●​ Structure: RDBMS organizes data in a tabular format, using tables

with rows and columns, where each row represents a record, and

each column represents an attribute.

●​ Data Model: Based on relational data model.

●​ Data Relationships: Uses primary keys and foreign keys to define

relationships between tables. Data is linked by key fields rather than

pointers, making it simpler to handle.


●​ Schema: RDBMS requires a predefined schema (a structured

blueprint of the tables).

●​ Query Language: Uses SQL (Structured Query Language) to

perform CRUD (Create, Read, Update, Delete) operations.

●​ Data Integrity and ACID Compliance: RDBMS enforces data

integrity and follows ACID (Atomicity, Consistency, Isolation,

Durability) properties, making it reliable for transactions.

●​ Examples: MySQL, PostgreSQL, Oracle, SQL Server.

2. NDBMS (Network Database Management System)

●​ Structure: NDBMS organizes data using a network model, where

data is represented in a graph-like structure with nodes and edges.

Records are linked using pointers, forming a complex structure of

interconnected records.

●​ Data Model: Based on the network data model.

●​ Data Relationships: Supports many-to-many relationships directly

through a system of pointers, making it useful for complex

relationships.

●​ Schema: NDBMS also requires a defined schema but is more

complex due to its network structure.

●​ Query Language: NDBMS does not have a standardized query

language like SQL. Instead, it relies on navigational access (i.e.,

accessing records by traversing pointers).


●​ Data Integrity and ACID Compliance: NDBMS may or may not be

fully ACID-compliant. It allows more direct access to data and is

efficient for certain types of queries but does not inherently enforce

the same level of data integrity as RDBMS.

●​ Examples: Integrated Data Store (IDS), IDMS (Integrated Database

Management System), and other legacy network databases.

●​ RDBMS is widely used for applications requiring structured data

storage with simplified relationships and SQL-based querying.

●​ NDBMS is more suited for applications with complex relationships

(like networked or hierarchical data) where many-to-many

relationships are frequent and direct links are needed.

OOPS

Real-Life Applications of Object-Oriented Programming (OOP)

Object-Oriented Programming (OOP) is widely used in real-life


applications across various industries. Here are some practical examples:

1. Banking Systems 💳
Where OOP is Used:

●​ Classes & Objects: Account, Customer, Transaction, ATM.


●​ Encapsulation: Customer details (account number, balance) are
hidden and accessed via methods.
●​ Inheritance: Different types of accounts (Savings, Current) inherit
common properties from a base Account class.
●​ Polymorphism: Different types of transactions (Withdraw, Deposit,
Transfer) can have the same processTransaction() method but
behave differently.

E-Commerce Applications (Amazon, Flipkart) 🛒


Where OOP is Used:

●​ Classes: Customer, Product, Order, Cart.


●​ Encapsulation: Payment details and user credentials are protected.
●​ Inheritance: Electronics, Clothing, and Books inherit from
Product.
●​ Polymorphism: calculateDiscount() works differently for
different product types.

Gaming Development 🎮
Where OOP is Used:

●​ Classes: Player, Enemy, Weapon, Level.


●​ Inheritance: Different types of enemies (Zombie, Alien) inherit
from Enemy.
●​ Polymorphism: Attack method differs for different characters.
Social Media Applications (Facebook, Instagram) 📱
Where OOP is Used:

●​ Classes: User, Post, Message, Comment.


●​ Encapsulation: User passwords and private messages are protected.
●​ Polymorphism: Different types of posts (Image, Video, Text) have
different rendering methods.



1. What is Object Oriented Programming (OOPs)?

Object Oriented Programming (also known as OOPs) is a programming


paradigm where the complete software operates as a bunch of objects
talking to each other. An object is a collection of data and the methods
which operate on that data.

2. Why OOPs?

The main advantage of OOP is better manageable code that covers the
following:

1.​ The overall understanding of the software is increased as the

distance between the language spoken by developers and that

spoken by users.
2.​ Object orientation eases maintenance by the use of

encapsulation. One can easily change the underlying

representation by keeping the methods the same.

3.​ The OOPs paradigm is mainly useful for relatively big software.

3. What is a Class?

A class is a building block of Object Oriented Programs. It is a


user-defined data type that contains the data members and member
functions that operate on the data members. It is like a blueprint or
template of objects having common properties and methods.

4. What is an Object?

An object is an instance of a class. Data members and methods of a class


cannot be used directly. We need to create an object (or instance) of the
class to use them. In simple terms, they are the actual world entities that
have a state and behavior.

C++
Java
Python
C#
// class definition

class Student {

String name;

class GfG {

public static void main(String args[])

// creating an object

Student student1 = new Student();


// assigning member some value

student1.name = "Rahul";

System.out.println("student1.name: " + student1.name);

Output
student1.name: Rahul

5. What are the main features of OOPs?

The main feature of the OOPs, also known as 4 pillars or basic principles
of OOPs are as follows:

1.​ Encapsulation

2.​ Data Abstraction

3.​ Polymorphism

4.​ Inheritance
OOPs Main Features

6. What is Encapsulation?

Encapsulation is the binding of data and methods that manipulate them


into a single unit such that the sensitive data is hidden from the users​
It is implemented as the processes mentioned below:

1.​ Data hiding: A language feature to restrict access to members of

an object. For example, private and protected members in C++.

2.​ Bundling of data and methods together: Data and methods that

operate on that data are bundled together. For example, the data

members and member methods that operate on them are

wrapped into a single unit known as a class.


7. What is Abstraction?

Abstraction is similar to data encapsulation and is very important in OOP.


It means showing only the necessary information and hiding the other
irrelevant information from the user. Abstraction is implemented using
classes and interfaces.
8. What is Polymorphism?

The word “Polymorphism” means having many forms. It is the property of


some code to behave differently for different contexts. For example, in C++
language, we can define multiple functions having the same name but
different working depending on the context.

Polymorphism can be classified into two types based on the time when
the call to the object or function is resolved. They are as follows:

●​ Compile Time Polymorphism

●​ Runtime Polymorphism

A) Compile-Time Polymorphism

Compile time polymorphism, also known as static polymorphism or early


binding is the type of polymorphism where the binding of the call to its
code is done at the compile time. Method overloading or operator
overloading are examples of compile-time polymorphism.

B) Runtime Polymorphism

Also known as dynamic polymorphism or late binding, runtime


polymorphism is the type of polymorphism where the actual
implementation of the function is determined during the runtime or
execution. Method overriding is an example of this method.

9. What is Inheritance? What is its purpose?

The idea of inheritance is simple, a class is derived from another class and
uses data and implementation of that other class. The class which is
derived is called child or derived or subclass and the class from which the
child class is derived is called parent or base or superclass.

The main purpose of Inheritance is to increase code reusability. It is also


used to achieve Runtime Polymorphism.
10. What are access specifiers? What is their significance in
OOPs?

Access specifiers are special types of keywords that are used to specify or
control the accessibility of entities like classes, methods, and so on.
Private, Public, and Protected are examples of access specifiers or access
modifiers.​
The key components of OOPs, encapsulation and data hiding, are largely
achieved because of these access specifiers.

14. What are some commonly used Object Oriented


Programming Languages?

OOPs paradigm is one of the most popular programming paradigms. It is


widely used in many popular programming languages such as:

●​ C++

●​ Java

●​ Python

●​ JavaScript

●​ C#

●​ Ruby

15. What are the different types of Polymorphism?

Polymorphism can be classified into two types based on the time when
the call to the object or function is resolved. They are as follows:

1.​ Compile Time Polymorphism

2.​ Runtime Polymorphism


Types of Polymorphism

A) Compile-Time Polymorphism
Compile time polymorphism, also known as static polymorphism or early
binding is the type of polymorphism where the binding of the call to its
code is done at the compile time. Method overloading or operator
overloading are examples of compile-time polymorphism.

B) Runtime Polymorphism
Also known as dynamic polymorphism or late binding, runtime
polymorphism is the type of polymorphism where the actual
implementation of the function is determined during the runtime or
execution. Method overriding is an example of this method.

16. What is the difference between overloading and overriding?

A compile-time polymorphism feature called overloading allows an entity


to have numerous implementations of the same name. Method
overloading and operator overloading are two examples.

Overriding is a form of runtime polymorphism where an entity with the


same name but a different implementation is executed. It is implemented
with the help of virtual functions.
17. Are there any limitations on Inheritance?

Yes, there are more challenges when you have more authority. Although
inheritance is a very strong OOPs feature, it also has significant
drawbacks.

●​ As it must pass through several classes to be implemented,

inheritance takes longer to process.

●​ The base class and the child class, which are both engaged in

inheritance, are also closely related to one another (called tightly

coupled). Therefore, if changes need to be made, they may need

to be made in both classes at the same time.

●​ Implementing inheritance might be difficult as well. Therefore, if

not implemented correctly, this could result in unforeseen

mistakes or inaccurate outputs.

18. What different types of Inheritance are there?

Inheritance can be classified into 5 types which are as follows:

1.​ Single Inheritance: Child class derived directly from the base

class

2.​ Multiple Inheritance: Child class derived from multiple base

classes.

3.​ Multilevel Inheritance: Child class derived from the class which

is also derived from another base class.


4.​ Hierarchical Inheritance: Multiple child classes derived from a

single base class.

5.​ Hybrid Inheritance: Inheritance consisting of multiple inheritance

types of the above specified.

Note: Type of inheritance supported is dependent on the language. For


example, Java does not support multiple inheritance.

19. What is an interface?

A unique class type known as an interface contains methods but not their
definitions. Inside an interface, only method declaration is permitted. You
cannot make objects using an interface. Instead, you must put that
interface into use and specify the procedures for doing so.

20. How is an abstract class different from an interface?

Both abstract classes and interfaces are special types of classes that just
include the declaration of the methods, not their implementation. An
abstract class is completely distinct from an interface, though. Following
are some major differences between an abstract class and an interface.

Abstract Class Interface


A class that is abstract can have both An interface can only have
abstract and non-abstract methods. abstract methods.

An abstract class can have final, The interface has only static
non-final, static and non-static variables. and final variables.

Abstract class doesn’t support multiple An interface supports


inheritance multiple inheritance.

21. How much memory does a class occupy?

Classes do not use memory. They merely serve as a template from which
items are made. Now, objects actually initialize the class members and
methods when they are created, using memory in the process.

22. Is it always necessary to create objects from class?

No. If the base class includes non-static methods, an object must be


constructed. But no objects need to be generated if the class includes
static methods. In this instance, you can use the class name to directly call
those static methods.

24. What is Constructor?

A constructor is a block of code that initializes the newly created object. A


constructor resembles an instance method but it’s not a method as it
doesn’t have a return type. It generally is the method having the same
name as the class but in some languages, it might differ. For example:

In python, a constructor is named __init__.

In C++ and Java, the constructor is named the same as the class name.

Example:

C++
Java
Python
class base:

def __init__(self):

print("This is a constructor")

26. What is a destructor?

A destructor is a method that is automatically called when the object goes


out of scope or destroyed.

In C++, the destructor name is also the same as the class name but with
the (~) tilde symbol as the prefix.

In Python, the destructor is named __del__.

Example:

C++
Python
class base {

public:

~base() { cout << "This is a destructor"; }


In Java, the garbage collector automatically deletes the useless objects so
there is no concept of destructor in Java. We could have used finalize()
method as a workaround for the java destructor but it is also deprecated
since Java 9.

27. Can we overload the constructor in a class?

Yes We can overload the constructor in a class in Java. Constructor


Overloading is done when we want constructor with different constructor
with different parameter(Number and Type).

28. Can we overload the destructor in a class?

No, a destructor cannot be overloaded in a class. There can only be one


destructor present in a class.

29. What is the virtual function?

A virtual function is a function that is used to override a method of the


parent class in the derived class. It is used to provide abstraction in a class.

In C++, a virtual function is declared using the virtual keyword,

In Java, every public, non-static, and non-final method is a virtual function.

Python methods are always virtual.

Example:

C++
Java
Python
class base {

void func()

System.out.printIn("This is a virtual function")

}
30. What is pure virtual function?

A pure virtual function, also known as an abstract function is a member


function that doesn’t contain any statements. This function is defined in
the derived class if needed.

Example:

C++
Java
abstract class base {

abstract void prVirFunc();

OOPs Interview Questions and Answers

These Object-Oriented Programming (OOPs) interview questions cover


basic to advanced topics.

1. What are the four pillars of OOP?

Answer:

The four pillars of Object-Oriented Programming (OOP) are:

1.​ Encapsulation – Hiding internal details and exposing only necessary


parts using access modifiers. (Example: ATM Machine - PIN is
private, but withdraw() is public.)
2.​ Abstraction – Hiding complex implementation details and exposing
only essential functionalities. (Example: Car Steering - We turn the
wheel without knowing the internal mechanism.)
3.​ Inheritance – One class inherits properties and behaviors from
another class. (Example: Dog class inherits from Animal class.)
4.​ Polymorphism – The ability of an object to take multiple forms
(Method Overloading & Overriding). (Example: A Shape class has
different draw() methods for Circle, Rectangle, etc.)

2. What is the difference between Method Overloading


and Method Overriding?

Answer:

Feature Method Overloading Method Overriding

Definition Multiple methods with the A child class provides a new


same name but different implementation of a method
parameters in the same in the parent class
class

Where it Same class Parent-Child relationship


occurs (Inheritance)

Paramete Must be different Must be same


rs (number/type)

Return Can be different Must be the same


Type

Execution Compile-time (static Runtime (dynamic binding)


Time binding)

3. What is Encapsulation? Give an example.

Answer:
Encapsulation is the concept of hiding the data and allowing controlled
access through methods. It ensures data security and prevents accidental
modification.

Example (Java)
class BankAccount {

private double balance; // Private variable

// Public method to access private data

public void deposit(double amount) {

if (amount > 0) {

balance += amount;

public double getBalance() {

return balance;

Here, the balance variable is private, and only deposit() and


getBalance() allow access.

4. What is Abstraction? How is it implemented?

Answer:
Abstraction hides implementation details and only shows essential
functionalities to the user.

Implementation:

1.​ Using Abstract Classes


2.​ Using Interfaces

Example (Java - Abstract Class)


abstract class Vehicle {

abstract void start(); // Abstract method

class Car extends Vehicle {

void start() {

System.out.println("Car is starting with a key.");

5. What is the difference between Abstract Class and


Interface?

Answer:

Feature Abstract Class Interface

Methods Can have both abstract and Can have only abstract
non-abstract methods methods (until Java 8)
Variables Can have variables (with Only public, static, final
any access modifier) variables

Multiple Supports single Supports multiple


Inheritance inheritance inheritance

Use Case When a class provides When multiple classes


partial implementation share behavior but not
state

6. What is Polymorphism? Explain with an example.

Answer:

Polymorphism allows one interface, many implementations.​


It is of two types:

1.​ Compile-time polymorphism (Method Overloading)


2.​ Runtime polymorphism (Method Overriding)

Example (Java - Overriding)


class Animal {

void makeSound() {

System.out.println("Animal makes a sound");

class Dog extends Animal {

@Override
void makeSound() {

System.out.println("Dog barks");

Here, makeSound() is overridden in Dog class, implementing


polymorphism.

7. What is Inheritance? What are its types?

Answer:

Inheritance allows one class to inherit the properties of another class.​


It reduces redundancy and improves code reusability.

Types of Inheritance:

1.​ Single Inheritance – One class inherits from another.


2.​ Multilevel Inheritance – A child class inherits from another child
class.
3.​ Hierarchical Inheritance – One parent class has multiple child
classes.
4.​ Multiple Inheritance (Not supported in Java) – A child inherits from
multiple parent classes (achieved using interfaces).
5.​ Hybrid Inheritance – Combination of two or more types of
inheritance.

8. What is the difference between Class and Object?


Answer:

Feature Class Object

Definition A blueprint for creating An instance of a class


objects

Memory Not allocated until an object Gets memory when


Allocation is created instantiated

Example Car class Car myCar = new


Car();

9. What are Constructors?

Answer:

A constructor is a special method that gets called when an object is


created. It initializes the object.

Example (Java)
class Car {

String model;

// Constructor

Car(String model) {

this.model = model;

}
A constructor has the same name as the class and has no return type.

10. What is the difference between Static and


Non-Static methods?

Answer:

Feature Static Method Non-Static Method

Belongs Class Object


to

Access Can be accessed using Requires an instance of the class


class name

Can Only static Can access both static and


access variables/methods non-static members

Exampl Math.sqrt(25) obj.display();


e

12. What are Access Modifiers in OOP?

Answer:

Access Modifiers control the visibility of class members.

Modifie Scope
r

private Within the same class

default Within the same package


protect Within the same package +
ed subclasses

public Accessible everywhere

13. What is the difference between Interface and


Abstract Class?
Feature Abstract Class Interface

Methods Can have both abstract & Only abstract methods


concrete methods (before Java 8)

Multiple No Yes
Inheritance

Use Case Partial implementation Defines a contract

14. Can a constructor be private?

Answer:

Yes, a private constructor prevents object creation from outside the class.
It is mainly used in the Singleton Design Pattern.

DSA

1. What is an Array?

●​ Answer: An array is a collection of items stored at contiguous


memory locations. It can hold multiple elements of the same data
type, accessible by index. Arrays have a fixed size.
2. What is a Linked List?

●​ Answer: A linked list is a linear data structure where elements are


stored in nodes, and each node contains data and a reference to the
next node. Unlike arrays, linked lists don’t need contiguous memory
and can grow dynamically.

3. Explain Stack and its operations.

●​ Answer: A stack is a linear data structure following the Last In, First
Out (LIFO) principle. The main operations are:
○​ push(): Adds an item to the stack.
○​ pop(): Removes the item from the top of the stack.
○​ peek(): Returns the item at the top without removing it.
○​ isEmpty(): Checks if the stack is empty.

4. What is a Queue and how does it differ from a Stack?

●​ Answer: A queue is a linear data structure that follows the First In,
First Out (FIFO) principle. Elements are added at the back (enqueue)
and removed from the front (dequeue). Unlike a stack (LIFO), the
queue removes elements in the order they were added.

5. What is a Binary Tree?

●​ Answer: A binary tree is a tree data structure where each node has
at most two children, referred to as the left and right children. It can
be used to implement binary search trees, heaps, and more.

6. What is a Binary Search Tree (BST)?

●​ Answer: A BST is a binary tree where each node has a value, and all
values in the left subtree are smaller, while values in the right
subtree are greater than the node’s value. BSTs enable efficient
search, insertion, and deletion operations.
7. Explain the difference between Breadth-First Search (BFS) and
Depth-First Search (DFS).

●​ Answer:
○​ BFS: Explores nodes level by level, using a queue. It’s used for
finding the shortest path in unweighted graphs.
○​ DFS: Explores as far down a branch as possible before
backtracking, using a stack or recursion. It’s useful for
exploring connected components.

8. What is a Hash Table?

●​ Answer: A hash table is a data structure that maps keys to values


for efficient lookup. It uses a hash function to compute an index for
each key, which helps in O(1) average-time complexity for search,
insertion, and deletion operations.

9. What is Dynamic Programming?

●​ Answer: Dynamic programming (DP) is a method for solving


complex problems by breaking them down into overlapping
subproblems, solving each once, and storing their solutions. DP is
often used for optimization problems, like the Fibonacci sequence or
knapsack problem.

10. Explain the concept of Recursion.

●​ Answer: Recursion is a technique where a function calls itself


directly or indirectly to solve a problem by breaking it down into
smaller subproblems. Each recursive call should move towards a
base case to avoid infinite loops.

11. What is a Graph?

●​ Answer: A graph is a data structure with nodes (vertices) and edges


connecting them. Graphs can be directed or undirected and are used
in networks, social media connections, and various optimization
problems.

12. What is a Heap?

●​ Answer: A heap is a complete binary tree used to implement priority


queues. In a min-heap, the root node has the smallest value, while in
a max-heap, the root node has the largest value. Heaps allow
efficient insertion, deletion, and retrieval of the minimum or
maximum element.

13. What is the difference between Arrays and Linked Lists?

●​ Answer:
○​ Arrays have fixed size and allow random access but require
contiguous memory.
○​ Linked Lists are dynamic in size, use pointers for connections,
and are better for insertion and deletion but don’t allow direct
indexing.

14. What is Big-O Notation?

●​ Answer: Big-O notation describes the upper bound of an algorithm's


runtime complexity, giving a worst-case scenario for the growth rate
relative to the input size (e.g., O(n), O(log n)).

15. How do you reverse a Linked List?

●​ Answer: To reverse a linked list, iterate through the list while


changing each node’s next pointer to point to the previous node. Use
a temporary variable to hold the next node and update pointers
iteratively

Searching Algorithms
1.​ Linear Search​

○​ Description: Sequentially checks each element in a list until


the target element is found.
○​ Time Complexity:
■​ Worst Case: O(n)O(n)
■​ Average Case: O(n)O(n)
■​ Best Case: O(1)O(1)
2.​ Binary Search​

○​ Description: Works on a sorted list by repeatedly dividing the


search interval in half.
○​ Time Complexity:
■​ Worst Case: O(log⁡n)O(\log n)
■​ Average Case: O(log⁡n)O(\log n)
■​ Best Case: O(1)O(1)
○​ Note: Only works on sorted lists.

Sorting Algorithms

1.​ Bubble Sort​

○​ Description: Repeatedly steps through the list, compares


adjacent elements, and swaps them if they are in the wrong
order.
○​ Time Complexity:
■​ Worst Case: O(n2)O(n^2)
■​ Average Case: O(n2)O(n^2)
■​ Best Case: O(n)O(n)
2.​ Selection Sort​
○​ Description: Repeatedly finds the minimum element from the
unsorted part and puts it at the beginning.
○​ Time Complexity:
■​ Worst Case: O(n2)O(n^2)
■​ Average Case: O(n2)O(n^2)
■​ Best Case: O(n2)O(n^2)
3.​ Insertion Sort​

○​ Description: Builds the sorted list one item at a time by


inserting each item into its correct position.
○​ Time Complexity:
■​ Worst Case: O(n2)O(n^2)
■​ Average Case: O(n2)O(n^2)
■​ Best Case: O(n)O(n)
4.​ Merge Sort​

○​ Description: Divides the list into halves, sorts each half, and
then merges them back together.
○​ Time Complexity:
■​ Worst Case: O(nlog⁡n)O(n \log n)
■​ Average Case: O(nlog⁡n)O(n \log n)
■​ Best Case: O(nlog⁡n)O(n \log n)
5.​ Quick Sort​

○​ Description: Picks a pivot, partitions the list around the pivot,


and recursively sorts the partitions.
○​ Time Complexity:
■​ Worst Case: O(n2)O(n^2)
■​ Average Case: O(nlog⁡n)O(n \log n)
■​ Best Case: O(nlog⁡n)O(n \log n)

ML
Basic Machine Learning Questions

1. What is Machine Learning?​


Machine Learning is a subset of Artificial Intelligence that enables computers to learn
patterns from data and make predictions or decisions without being explicitly programmed.

2. What are the types of Machine Learning?

●​ Supervised Learning: The model is trained on labeled data (e.g., regression,


classification).
●​ Unsupervised Learning: The model finds patterns in unlabeled data (e.g.,
clustering, dimensionality reduction).
●​ Reinforcement Learning: The model learns by interacting with an environment and
receiving rewards or penalties.

3. What is the difference between Supervised and Unsupervised Learning?

Feature Supervised Unsupervised


Learning Learning

Data Labeled Unlabeled

Goal Predict outcomes Find patterns

Example Spam classification Customer segmentation

4. What is Overfitting and Underfitting?

●​ Overfitting: The model learns noise along with the data, leading to poor
generalization on new data.
●​ Underfitting: The model is too simple and fails to capture the underlying trend in the
data.

5. How can you prevent Overfitting?

●​ Use more training data


●​ Apply regularization (L1/L2)
●​ Use cross-validation
●​ Prune decision trees
●​ Reduce model complexity

Machine Learning Algorithms

6. Explain the difference between Classification and Regression.

●​ Classification: Predicts discrete labels (e.g., spam vs. not spam).


●​ Regression: Predicts continuous values (e.g., house price prediction).
7. What is the difference between KNN and K-Means?

●​ KNN (K-Nearest Neighbors) is a supervised algorithm used for


classification/regression.
●​ K-Means is an unsupervised algorithm used for clustering.

8. Explain how Decision Trees work.​


A Decision Tree splits the data into subsets based on feature values, forming a tree-like
structure where each node represents a decision based on an attribute.

9. What is the difference between Bagging and Boosting?

●​ Bagging: Multiple weak learners are trained independently and their outputs are
averaged (e.g., Random Forest).
●​ Boosting: Weak models are trained sequentially, with each model focusing on errors
of the previous one (e.g., AdaBoost, Gradient Boosting).

10. What is the Bias-Variance Tradeoff?

●​ High Bias (Underfitting): Model is too simple and makes a lot of errors.
●​ High Variance (Overfitting): Model is too complex and fits noise in the data.
●​ The goal is to find a balance between bias and variance.

Model Evaluation & Metrics

11. What metrics are used for classification problems?

●​ Accuracy
●​ Precision, Recall, F1-score
●​ ROC-AUC Curve

12. What metrics are used for regression problems?

●​ Mean Squared Error (MSE)


●​ Root Mean Squared Error (RMSE)
●​ Mean Absolute Error (MAE)
●​ R² (Coefficient of Determination)

13. What is Cross-Validation?​


Cross-validation is a technique for assessing model performance by splitting data into
training and validation sets multiple times (e.g., k-fold cross-validation).

Advanced Topics

14. What is PCA (Principal Component Analysis)?​


PCA is a dimensionality reduction technique that transforms correlated features into
uncorrelated principal components.
15. What is an Activation Function in Neural Networks?​
Activation functions introduce non-linearity into the network, enabling it to learn complex
patterns. Examples include ReLU, Sigmoid, and Tanh.

16. What is Gradient Descent?​


Gradient Descent is an optimization algorithm used to minimize the loss function by updating
model parameters iteratively.

17. Explain the difference between L1 and L2 Regularization.

●​ L1 Regularization (Lasso): Shrinks some coefficients to zero, leading to feature


selection.
●​ L2 Regularization (Ridge): Shrinks coefficients but does not set them to zero.

18. What is a Confusion Matrix?​


A confusion matrix is used to evaluate classification models by displaying True Positives
(TP), False Positives (FP), True Negatives (TN), and False Negatives (FN).

Deployment & Real-world ML

19. How do you handle missing data in a dataset?

●​ Remove rows with missing values.


●​ Impute missing values using mean/median/mode.
●​ Use predictive models to estimate missing values.

20. How do you handle imbalanced datasets?

●​ Resampling Techniques: Oversampling minority class or undersampling majority


class.
●​ Use Different Metrics: Precision-Recall, F1-score instead of accuracy.
●​ Use Different Algorithms: SMOTE (Synthetic Minority Over-sampling Technique).

Basic Concepts in Satellite Image Fusion & Machine Learning

1. What is satellite image fusion?

Answer:​
Satellite image fusion is the process of integrating data from multiple satellite images to
produce a single image with enhanced spatial, spectral, or temporal resolution. The goal is
to improve image quality for better analysis and interpretation.
2. What are the types of image fusion techniques?

Answer:

●​ Pixel-level fusion: Combines raw pixel values from multiple images.


●​ Feature-level fusion: Extracts and combines important features from images.
●​ Decision-level fusion: Combines results from different algorithms/models to
improve accuracy.

3. What are some common challenges in satellite image fusion?

Answer:

●​ Geometric misalignment: Images may be taken at different angles or times.


●​ Spectral distortion: Differences in sensor characteristics can lead to color
mismatches.
●​ Computational complexity: Processing high-resolution satellite images requires
significant computing power.
●​ Noise and artifacts: Fusion may introduce unwanted distortions.

Machine Learning in Satellite Image Fusion

4. How is Machine Learning used in satellite image fusion?

Answer:

●​ Supervised Learning: Training models to recognize and fuse images using labeled
datasets.
●​ Unsupervised Learning: Clustering-based techniques for feature extraction in
image fusion.
●​ Deep Learning: CNNs (Convolutional Neural Networks) and GANs (Generative
Adversarial Networks) improve fusion quality.

5. What are some ML-based fusion techniques?

Answer:

●​ CNN-based fusion: Uses deep convolutional networks to merge images while


preserving important spatial and spectral details.
●​ GAN-based fusion: Generates high-quality fused images by learning from real
image distributions.
●​ PCA (Principal Component Analysis): Reduces dimensionality and extracts the
most significant features.
●​ Wavelet Transform: Used for multi-resolution fusion by decomposing images into
different frequency components.

6. How does PCA help in satellite image fusion?

Answer:​
PCA transforms high-dimensional image data into a set of uncorrelated principal
components. In image fusion, the first principal component often contains the most important
information, which can be used for merging images effectively.

7. What is the role of CNNs in satellite image fusion?

Answer:​
CNNs learn spatial and spectral features from satellite images and can be used to
intelligently merge multiple images while minimizing artifacts. CNN-based fusion models can
outperform traditional methods like PCA and IHS (Intensity-Hue-Saturation) by learning
complex patterns.

8. What is the difference between Pan-sharpening and Multi-sensor Image Fusion?

Answer:

●​ Pan-sharpening: Merges a high-resolution panchromatic image with a


lower-resolution multispectral image to enhance spatial details.
●​ Multi-sensor Image Fusion: Combines images from different sensors (e.g., optical,
SAR, LiDAR) to improve data interpretation.

Preprocessing & Feature Engineering

9. How do you preprocess satellite images before fusion?

Answer:

●​ Radiometric correction: Adjusts brightness and contrast to standardize images.


●​ Geometric correction: Aligns images taken from different sensors or angles.
●​ Noise reduction: Removes distortions using filters (e.g., Gaussian, median filters).
●​ Normalization: Scales pixel values for consistency across images.

10. How do you handle high-dimensional satellite data?


Answer:

●​ Dimensionality reduction: PCA, t-SNE, or autoencoders help reduce redundant


data.
●​ Feature selection: Identify and keep only the most informative bands.
●​ Data compression: Use wavelet transforms or deep learning-based encoders.

Model Evaluation & Performance Metrics

11. What metrics are used to evaluate the quality of image fusion?

Answer:

●​ Peak Signal-to-Noise Ratio (PSNR): Measures image quality improvement.


●​ Structural Similarity Index (SSIM): Evaluates structural similarity between images.
●​ Root Mean Square Error (RMSE): Measures pixel-wise error.
●​ Entropy: Higher entropy means richer image information.

12. How can you assess if fusion has improved image quality?

Answer:

●​ Compare the fused image with the original images using SSIM and PSNR.
●​ Conduct visual analysis to check for spectral distortion and spatial clarity.
●​ Use ML-based object detection models to see if classification accuracy improves.

Project

Brief About Your Project


Your project, "Satellite Image Fusion", focuses on enhancing the spatial and spectral
resolution of satellite images using advanced pansharpening techniques. The goal is to
combine multi-source satellite images to improve their quality for various applications like
environmental monitoring, urban planning, and agriculture.

Real-Time Example of Your Project


A real-world application of your project could be:
🔹 Agriculture Monitoring: Farmers use satellite images to analyze soil health, crop
growth, and detect diseases. Your fusion techniques can provide higher-resolution
images, improving precision in decision-making.

🔹 Disaster Management: After a flood or earthquake, relief agencies need clear


satellite images to assess the damage. Your project can provide sharper images, helping
authorities plan rescue operations better.

🔹 Smart City Planning: Governments use satellite images to plan roads, infrastructure,
and traffic systems. Your fused images can improve accuracy in land mapping and
resource allocation.

What is Your Project?


Your project is a Machine Learning-based satellite image fusion model that enhances
image quality by:

1.​ Combining multiple images from different satellites.


2.​ Applying fusion techniques like Pansharpening, PCA, Wavelet Transform, or Deep
Learning-based methods.
3.​ Generating high-resolution images for better analysis in different applications.

Why is This Project Useful?


✅ Improves image clarity – Helps scientists, researchers, and policymakers get better
✅ Enhances decision-making – Useful in agriculture, urban planning, and
satellite images.​

✅ Supports AI & automation – High-quality images can be used for AI-based


environmental monitoring.​

✅ Reduces costs – Instead of launching new satellites, existing data can be improved
predictions and monitoring systems.​

with fusion techniques.

How You Use ML in Your Project?


Your project uses Machine Learning in the following ways:

1.​ Image Preprocessing – ML models help denoise, enhance contrast, and


normalize images.
2.​ Feature Extraction – Deep learning models like CNNs (Convolutional Neural
Networks) detect patterns in images.
3.​ Fusion Algorithm Optimization – ML techniques like PCA, Autoencoders, or
GANs help in better image fusion.
4.​ Quality Assessment – ML models evaluate how well the images have been fused,
ensuring high PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structural Similarity
Index) scores.

How You Collect Dataset?


Your dataset comes from:​
Publicly available satellite image datasets (NASA, ESA, Google Earth Engine, USGS


Landsat).​


Open-source repositories like Sentinel, Landsat, MODIS images.​
Synthetic datasets generated using Deep Learning models to train and test fusion
techniques.

To Whom This Project Is Useful?


🔹 Government agencies – For land mapping, city planning, and disaster management.​
🔹 Farmers & Agri-Tech companies – To improve precision farming techniques.​
🔹 Research labs & universities – For remote sensing applications.​
🔹 Environmental organizations – For deforestation monitoring and climate change
research.

Technical Questions & Answers About Your Project


Q1: What are the main techniques used for satellite image fusion?

A:

1.​ Pansharpening – Combines a high-resolution panchromatic image with a


low-resolution multispectral image.
2.​ Principal Component Analysis (PCA) – Extracts key features from different images
and fuses them.
3.​ Wavelet Transform – Breaks images into different frequency bands for fusion.
4.​ Deep Learning-based Fusion – Uses CNNs, GANs, and Autoencoders to create
high-quality images.

Q2: What metrics do you use to evaluate the quality of fused images?
A:

●​ PSNR (Peak Signal-to-Noise Ratio) – Measures image quality by comparing fused


and original images.
●​ SSIM (Structural Similarity Index) – Compares structural details in images.
●​ Entropy – Evaluates how much information is retained in the fused image.
●​ RMSE (Root Mean Square Error) – Measures the difference between the original
and fused image.

Q3: How does deep learning improve image fusion compared to


traditional methods?

A:​
Traditional methods like PCA and Wavelet Transform rely on hand-crafted features,
which may not always work well for complex images.​


Deep Learning methods:​


Learn features automatically using CNNs, Autoencoders, and GANs.​


Improve image clarity by removing noise and enhancing features.​
Handle multiple image types, making fusion more adaptable.

Q4: What are the challenges in satellite image fusion?

🚀 Noise & Artifacts – Images may have noise, affecting fusion quality.​
A:​

🚀 Alignment Issues – Images from different satellites may not align perfectly.​
🚀 Computational Cost – High-resolution image processing requires powerful hardware.​
🚀 Color Distortion – Some fusion methods may change the image's original colors.

Q5: How would you handle images with different resolutions before
fusion?

✅ Image Resampling – Resize all images to a common resolution.​


A:​

✅ Feature Extraction – Use ML models to extract important features before merging.​


✅ Edge Detection & Matching – Align images properly to avoid distortions.

Q6: What dataset preprocessing steps are required before training an


ML model for image fusion?

A:
●​ Resizing & Cropping – Standardizing image dimensions.
●​ Data Augmentation – Rotations, flips, and brightness adjustments to improve model
generalization.
●​ Normalization – Scaling pixel values to [0,1] or [-1,1].
●​ Noise Reduction – Removing unwanted distortions.

On Which Platform You Are Developing This Project?


Your project can be developed on:​


Python (OpenCV, TensorFlow, PyTorch) – For image processing and ML models.​


Google Earth Engine (GEE) – For satellite image data collection.​


AWS/GCP/Azure – For cloud-based image processing (if required).​
Jupyter Notebook / Colab – For experimentation and visualization.

Others :

Here are some basic interview questions and answers for Operating Systems (OS), Cloud
Computing, Software Development Life Cycle (SDLC), and Agile methodology.

Operating Systems (OS)

1.​ What is an operating system?​

○​ An OS is system software that manages hardware and software resources,


providing services to applications.
2.​ What are the types of operating systems?​

○​ Single-user, multi-user, multitasking, real-time, distributed, and network


operating systems.
3.​ What is a process and a thread?​

○​ A process is an independent program execution unit, while a thread is a


lightweight unit of a process.
4.​ What is virtual memory?​

○​ Virtual memory allows the system to use part of the hard disk as RAM to
manage large applications efficiently.
5.​ What is a deadlock?​
○​ A deadlock occurs when multiple processes hold resources and wait
indefinitely for others to release their resources.
6.​ What is paging and segmentation?​

○​ Paging divides memory into fixed-size pages, whereas segmentation divides


memory into variable-sized segments.
7.​ What is context switching?​

○​ Context switching is the process of saving the state of a CPU and switching to
another process.

Cloud Computing

1. What is cloud computing?

Answer:​
Cloud computing is the delivery of computing services (like servers, storage, databases,
networking, software, and analytics) over the internet (“the cloud”) to offer faster innovation,
flexible resources, and economies of scale.

2. What are the different types of cloud computing?

Answer:​
The main types of cloud computing are:

●​ Public Cloud – Services are offered to multiple customers over the internet (e.g.,
AWS, Azure, GCP).
●​ Private Cloud – Cloud services are used exclusively by a single organization.
●​ Hybrid Cloud – A combination of public and private cloud to allow data and
applications to be shared between them.
●​ Community Cloud – A shared cloud infrastructure for organizations with similar
concerns.

3. What are the different cloud service models?

Answer:​
The three primary cloud service models are:

●​ IaaS (Infrastructure as a Service): Provides virtualized computing resources (e.g.,


AWS EC2, Google Compute Engine).
●​ PaaS (Platform as a Service): Provides a platform for application development
(e.g., Google App Engine, AWS Elastic Beanstalk).
●​ SaaS (Software as a Service): Delivers software applications over the internet (e.g.,
Gmail, Dropbox, Salesforce).
Software Development Life Cycle (SDLC)

1.​ What is SDLC?​

○​ SDLC is a process for developing software systematically from planning to


maintenance.
2.​ What are the phases of SDLC?​

○​ Planning, Requirement Analysis, Design, Development, Testing, Deployment,


and Maintenance.
3.​ What are SDLC models?​

○​ Waterfall, Agile, Spiral, V-Model, and Iterative.


4.​ What is the Waterfall model?​

○​ A sequential SDLC model where each phase is completed before moving to


the next.
5.​ What is the difference between Waterfall and Agile?​

○​ Waterfall is sequential, whereas Agile is iterative and allows for continuous


changes.
6.​ What is software testing in SDLC?​

○​ Testing is the process of verifying and validating the software to ensure it


meets requirements.
7.​ What are functional and non-functional requirements?​

○​ Functional requirements define specific functionalities, while non-functional


requirements focus on performance, security, and usability.

Agile Methodology

1.​ What is Agile?​

○​ Agile is an iterative approach to software development, emphasizing flexibility,


customer collaboration, and continuous improvement.
2.​ What are Agile principles?​

○​ Customer satisfaction, iterative development, collaboration, adaptability, and


continuous delivery.
3.​ What are Agile frameworks?​

○​ Scrum, Kanban, SAFe, and XP (Extreme Programming).


4.​ What is Scrum in Agile?​

○​ Scrum is a framework within Agile that divides work into small iterations
(Sprints) with specific roles and ceremonies.
5.​ Who are the key roles in Scrum?​

○​ Product Owner, Scrum Master, and Development Team.


6.​ What are Sprint and Sprint backlog?​

○​ A Sprint is a time-boxed iteration (typically 1-4 weeks).


○​ The Sprint backlog contains tasks planned for the current Sprint.
7.​ What is a daily stand-up meeting?​

○​ A short meeting where team members discuss progress, blockers, and the
day’s plan.
8.​ What is the difference between Scrum and Kanban?​

○​ Scrum follows fixed sprints, while Kanban focuses on continuous flow without
fixed iterations.

Here’s a crisp yet powerful explanation of each technology with real-time examples:

1. NumPy (Numerical Python)

Concept: A powerful library for numerical computing, mainly used for handling arrays and
performing mathematical operations efficiently.​
Real-time Example:

●​ In image processing, NumPy is used to manipulate pixel values in images, like


converting an image to grayscale.
●​ In Machine Learning, it helps in handling large datasets and performing matrix
operations for training models.

import numpy as np

arr = np.array([[1, 2, 3], [4, 5, 6]])

print(arr.T) # Transpose of a matrix

2. Pandas (Data Manipulation & Analysis)


Concept: A data manipulation library used to handle structured data efficiently with
DataFrame and Series.​
Real-time Example:

●​ In finance, Pandas is used to analyze stock market trends by handling large CSV
files.
●​ In data analytics, it is used to clean and process data before feeding it into an ML
model.

import pandas as pd

df = pd.read_csv("sales_data.csv")

print(df.describe()) # Summary statistics of data

3. OpenCV (Computer Vision & Image Processing)

Concept: An open-source library for real-time computer vision applications like object
detection, facial recognition, etc.​
Real-time Example:

●​ In self-driving cars, OpenCV detects lane lines and traffic signs.


●​ In surveillance systems, it’s used for motion detection and face recognition.

import cv2

img = cv2.imread("image.jpg")

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

cv2.imshow("Grayscale Image", gray)

cv2.waitKey(0)

cv2.destroyAllWindows()

4. TensorFlow (Deep Learning Framework by Google)

Concept: An open-source ML framework for building neural networks and handling


large-scale deep learning models.​
Real-time Example:
●​ In Google Translate, TensorFlow powers the neural machine translation.
●​ In medical imaging, it detects diseases from X-rays using CNNs.

import tensorflow as tf

x = tf.constant([[1.0, 2.0], [3.0, 4.0]])

print(tf.matmul(x, x)) # Matrix multiplication

5. PyTorch (Deep Learning Framework by Meta)

Concept: A dynamic deep learning framework that provides flexibility for research and
production.​
Real-time Example:

●​ Used in Chatbots like ChatGPT for natural language processing (NLP).


●​ In robotics, PyTorch is used to train reinforcement learning models.

import torch

x = torch.tensor([[1, 2], [3, 4]], dtype=torch.float32)

print(torch.mm(x, x)) # Matrix multiplication


Hr :

3. What are your strengths and weaknesses?

✅ Tip: For strengths, provide real examples. For weaknesses, mention how you’re
improving.

Example Answer (Strengths):​


"One of my key strengths is adaptability. I quickly learn new technologies and apply them
effectively. For example, during my internship, I had to analyze large datasets using SQL, a
skill I initially had limited exposure to, but I adapted quickly and delivered insightful reports.
Another strength is problem-solving – I enjoy tackling complex coding challenges and
optimizing solutions."

Example Answer (Weaknesses):​


"A weakness I identified is that I sometimes focus too much on details, which can slow me
down. However, I have been working on balancing detail-oriented work with efficiency by
prioritizing tasks better and setting time limits."
4. Describe a challenging situation you faced in a project and how you
handled it.

✅ Tip: Use the STAR method (Situation, Task, Action, Result).


Example Answer:​
"During my web development internship, we faced a challenge in optimizing page load
speed due to inefficient database queries. The issue was slowing down the user experience.
I identified the root cause using SQL query optimization techniques and caching
mechanisms. By restructuring the database and implementing indexing, we reduced the
response time by 40%, improving user satisfaction. This experience reinforced my
problem-solving skills and ability to optimize performance."

5. Where do you see yourself in five years?

✅ Tip: Show career growth aligned with Encora’s technologies and goals.
Example Answer:​
"In five years, I see myself as a skilled software engineer, specializing in AI and cloud-based
solutions. I aim to work on innovative projects that leverage machine learning and
automation to improve business processes. I also want to mentor junior developers and
contribute to open-source projects, continuing to learn and grow within Encora."

6. How do you handle pressure and deadlines?

✅ Tip: Show that you remain calm, organized, and solution-focused under pressure.
Example Answer:​
"I handle pressure by staying organized and prioritizing tasks effectively. When faced with
tight deadlines, I break tasks into smaller parts and focus on completing high-priority items
first. For example, during my final year, I balanced my internship, project work, and
placement preparation by setting clear goals and managing my time efficiently. This
approach helps me stay productive without feeling overwhelmed."

7. Do you prefer working alone or in a team? ✅ Tip: Highlight flexibility


(able to work independently but also collaborate well).
Example Answer:​
"I enjoy working in a team because collaboration often leads to better problem-solving and
innovative ideas. For instance, in my ‘Meetify App’ project, teamwork helped us integrate
frontend and backend efficiently. However, I am also comfortable working independently
when needed, ensuring I meet deadlines and deliver quality work."

8. Tell me about a time you took initiative.

✅ Tip: Show that you go beyond expectations to add value.


Example Answer:​
"During my internship, I noticed that our team was manually generating reports, which was
time-consuming. I suggested and implemented an automated Python script to generate
reports, reducing the processing time by 50%. This improved efficiency and was later
adopted by other teams as well. Taking initiative to solve problems proactively is something I
always strive for."

9. Why should we hire you?

✅ Tip: Highlight your skills, attitude, and fit for the role.
Example Answer:​
"You should hire me because I have a strong technical foundation in Python, machine
learning, and data analysis, which align well with Encora’s focus on AI and cloud
technologies. My ability to quickly adapt and learn new concepts, combined with my
problem-solving skills, allows me to contribute effectively to projects. Additionally, my
experience working in teams and handling real-world challenges ensures that I will be a
valuable asset to your organization."

10. Do you have any questions for us?

✅ Tip: Always ask smart, relevant questions.


Example Questions to Ask:

●​ What are the key challenges your team is currently facing?


●​ How does Encora support employees in learning new technologies?
●​ Can you share insights into the career growth opportunities within the company?


Python vs java :

Python is an interpreted, dynamically typed, easy-to-learn language used in AI, data


science, and automation, whereas Java is a compiled, statically typed,

🚀
enterprise-focused language widely used in Android development, large-scale
applications, and banking systems.
Yes! Here are some basic Python programs that are commonly asked in technical
interviews:

1️⃣ Check if a number is Prime

num = int(input("Enter a number: "))

if num > 1:

for i in range(2, int(num ** 0.5) + 1):

if num % i == 0:

print("Not a prime number")

break

else:

print("Prime number")

else:

print("Not a prime number")

2️⃣ Check if a string is Palindrome

s = input("Enter a string: ")

if s == s[::-1]:

print("Palindrome")

else:

print("Not a palindrome")

3️⃣ Remove Duplicates from a List

lst = [1, 2, 3, 2, 4, 5, 1, 6]

unique_lst = list(set(lst))

print(unique_lst)
4️⃣ Find the Factorial of a Number

num = int(input("Enter a number: "))

fact = 1

for i in range(1, num + 1):

fact *= i

print("Factorial:", fact)

5️⃣ Fibonacci Series (First N Terms)

n = int(input("Enter number of terms: "))

a, b = 0, 1

for _ in range(n):

print(a, end=" ")

a, b = b, a + b

6️⃣ Check if a Number is Armstrong

num = int(input("Enter a number: "))

order = len(str(num))

sum_digits = sum(int(digit) ** order for digit in str(num))

if sum_digits == num:

print("Armstrong number")

else:

print("Not an Armstrong number")

7️⃣ Reverse a Number

num = int(input("Enter a number: "))


rev = int(str(num)[::-1])

print("Reversed number:", rev)

8️⃣ Check if a Number is Even or Odd

num = int(input("Enter a number: "))

print("Even" if num % 2 == 0 else "Odd")

9️⃣ Find the Largest Element in a List

lst = [10, 20, 5, 60, 30]

print("Largest element:", max(lst))

🔟 Find Second Largest Element in a List


lst = [10, 20, 5, 60, 30]

unique_lst = list(set(lst)) # Remove duplicates

unique_lst.sort(reverse=True)

print("Second largest element:", unique_lst[1])

PYTHON :

Here are some Python interview questions along with their answers categorized by
difficulty level:

📗 Basic Level
1.​ What are the key features of Python?​

○​ Easy to learn and use


○​ Interpreted language
○​ Dynamically typed
○​ Object-Oriented
○​ Extensive libraries
○​ Platform independent
○​ Supports GUI and web development
2.​ What is the difference between a list and a tuple?​

○​ List → Mutable, can be changed after creation ([])


○​ Tuple → Immutable, cannot be changed after creation (())
3.​ Explain PEP 8 in Python.​

○​ PEP 8 is the style guide for Python code that promotes readability and
consistency, covering naming conventions, indentation (4 spaces), and line
length (max 79 chars).
4.​ What is the difference between is and ==?​

○​ == compares values.
○​ is compares memory addresses (identity).
5.​ What are Python data types?​

○​ Numeric → int, float, complex


○​ Sequence → list, tuple, range
○​ Text → str
○​ Mapping → dict
○​ Set → set, frozenset
○​ Boolean → bool
○​ Binary → bytes, bytearray, memoryview

📘 Intermediate Level
1.​ What are list comprehensions?​

○​ A concise way to create lists using a single line.

squares = [x**2 for x in range(5)]

2.​
3.​ What is the difference between @staticmethod and @classmethod?​

○​ @staticmethod → Doesn’t access class or instance variables.


○​ @classmethod → Takes cls as the first parameter and can modify class
state.
4.​ What is the use of self in Python classes?​

○​ self refers to the current instance of the class, used to access variables and
methods.
5.​ Explain pass, continue, and break.​
○​ pass → Does nothing, acts as a placeholder
○​ continue → Skips the current loop iteration
○​ break → Exits the loop completely
6.​ What is the difference between shallow copy and deep copy?​

○​ Shallow copy → Copies only the outer object (copy.copy())


○​ Deep copy → Copies both outer and inner objects (copy.deepcopy())

📙 Advanced Level
1.​ Explain Generators and Iterators.​

○​ Iterator → Object with __iter__() and __next__() methods


○​ Generator → A function using yield that returns an iterator

def count_up_to(n):

count = 1

while count <= n:

yield count

count += 1

2.​ What is GIL (Global Interpreter Lock) in Python?​

○​ GIL ensures that only one thread executes at a time in CPython, limiting true
multi-threading but simplifying memory management.
3.​ What is the difference between map(), filter(), and reduce()?​

○​ map() → Applies a function to all items


○​ filter() → Filters items based on a condition
○​ reduce() → Reduces the list to a single value

from functools import reduce

numbers = [1, 2, 3, 4]

print(list(map(lambda x: x*2, numbers))) # [2, 4, 6, 8]

print(list(filter(lambda x: x % 2 == 0, numbers))) # [2, 4]

print(reduce(lambda x, y: x + y, numbers)) # 10

4.​ What are lambda functions?​


○​ Anonymous functions defined using lambda keyword.

add = lambda x, y: x + y

print(add(2, 3)) # Output: 5

You might also like