Python,DSA,AIML,Security
Python,DSA,AIML,Security
DSA
1. Q: What is a data structure?
A: A data structure is a way to store and organize data efficiently for access and
modification.
2. Q: What is the difference between an array and a linked list?
A: Arrays have fixed size and allow random access; linked lists are dynamic and
support efficient insertions/deletions.
3. Q: What is a stack?
A: A linear data structure that follows the LIFO (Last In First Out) principle.
4. Q: What is a queue?
A: A linear data structure that follows the FIFO (First In First Out) principle.
5. Q: What is the time complexity of searching in a binary search tree (BST)?
A: Average case: O(log n), Worst case: O(n).
6. Q: What is a circular queue?
A: A queue where the last position is connected back to the first, forming a circle.
7. Q: What is a hash table?
A: A data structure that maps keys to values using a hash function.
8. Q: What is the difference between BFS and DFS?
A: BFS explores neighbors level-wise; DFS explores as far as possible along each
branch before backtracking.
9. Q: What is the time complexity of linear search?
A: O(n)
10. Q: What is the time complexity of binary search?
A: O(log n)
11. Q: What is a priority queue?
A: A queue where elements are dequeued based on priority, not order of insertion.
12. Q: What is recursion?
A: A function calling itself to solve a problem in smaller instances.
13. Q: What is dynamic programming?
A: A method for solving complex problems by breaking them into subproblems and
storing results.
14. Q: What is a greedy algorithm?
A: An approach that makes the locally optimal choice at each step hoping to find the
global optimum.
15. Q: What is a graph?
A: A non-linear data structure consisting of nodes (vertices) and edges.
16. Q: What is the difference between a tree and a graph?
A: A tree is a hierarchical structure with no cycles; a graph can have cycles and
complex relationships.
17. Q: What is a heap?
A: A special tree-based structure that satisfies the heap property (max-heap or min-
heap).
18. Q: What is the use of a Trie data structure?
A: Efficient for searching and storing strings, like dictionaries or autocomplete.
19. Q: What is the time complexity of bubble sort?
A: O(n²)
20. Q: What is the best-case time complexity of insertion sort?
A: O(n)
21. Q: What is a binary tree?
A: A tree in which each node has at most two children.
22. Q: What is a balanced binary tree?
A: A tree where the height difference between left and right subtrees is at most one.
23. Q: What is a spanning tree?
A: A subgraph of a graph that includes all the vertices with minimum possible edges
and no cycles.
24. Q: What is topological sorting?
A: Linear ordering of vertices of a DAG (Directed Acyclic Graph) such that for every
directed edge u → v, u comes before v.
25. Q: What is backtracking?
A: A technique to solve problems incrementally and abandon solutions that fail to
satisfy constraints.
AIML
1. Q: What is cybersecurity?
A: Cybersecurity is the practice of protecting systems, networks, and data
from digital attacks.
2. Q: What is the CIA triad?
A: Confidentiality, Integrity, and Availability — the core principles of
information security.
3. Q: What is a firewall?
A: A firewall is a security device that monitors and controls incoming and
outgoing network traffic.
4. Q: What is encryption?
A: Encryption is the process of converting plain text into unreadable form to
prevent unauthorized access.
5. Q: What is the difference between symmetric and asymmetric
encryption?
A: Symmetric uses the same key for encryption and decryption; asymmetric
uses a public and a private key.
6. Q: What is a vulnerability?
A: A weakness in a system that can be exploited to compromise security.
7. Q: What is malware?
A: Malicious software designed to harm, exploit, or disrupt systems and
networks.
8. Q: What is phishing?
A: A social engineering attack where attackers trick users into revealing
personal or sensitive information.
9. Q: What is two-factor authentication (2FA)?
A: A security method requiring two different forms of identification to access
an account.
10. Q: What is an intrusion detection system (IDS)?
A: A system that monitors network traffic for suspicious activity and possible
threats.
11. Q: What is hashing?
A: A process that converts data into a fixed-size hash value, typically used for
verifying data integrity.
12. Q: What is the role of antivirus software?
A: It detects, prevents, and removes malware from computers and networks.
13. Q: What is a digital certificate?
A: A digital file that verifies the ownership of a public key, issued by a
Certificate Authority (CA).
14. Q: What is a DDoS attack?
A: Distributed Denial of Service — an attack that overwhelms a server or
network with traffic to make it unavailable.
15. Q: What is authentication?
A: The process of verifying the identity of a user or system.
16. Q: What is authorization?
A: The process of giving access rights to authenticated users based on roles or
policies.
17. Q: What is a man-in-the-middle (MITM) attack?
A: An attack where the attacker secretly intercepts and possibly alters
communication between two parties.
18. Q: What is social engineering?
A: A manipulation technique to trick users into giving confidential
information.
19. Q: What is a security policy?
A: A documented set of rules and procedures for maintaining and enforcing
security in an organization.
20. Q: What is penetration testing?
A: A simulated cyberattack to test the security of systems and identify
vulnerabilities.
21. Q: What is a zero-day vulnerability?
A: A security flaw that is unknown to the vendor and has no patch available.
22. Q: What is public key infrastructure (PKI)?
A: A framework for managing digital certificates and public-key encryption.
23. Q: What is access control?
A: A security method that restricts access to systems or data to authorized
users only.
24. Q: What is a brute-force attack?
A: An attack that tries every possible password combination to gain
unauthorized access.
25. Q: What is multi-factor authentication (MFA)?
A: A security process that uses more than one method of authentication from
independent categories.