Top 50 computer science viva questions.

Top 50 computer science viva questions.


1. What is a programming language?


Explanation: A programming language is a formalized set of instructions used to communicate with a computer to perform specific tasks.



2. Differentiate between a compiler and an interpreter.


Explanation: A compiler translates the entire source code into machine code before execution, whereas an interpreter translates the code line by line during execution.



3. What is object-oriented programming (OOP)?


Explanation: OOP is a programming paradigm that organizes code into objects, representing real-world entities, with data and behavior encapsulated together.



4. Define recursion in programming.


Explanation: Recursion is a programming technique where a function calls itself to solve a smaller instance of the same problem.



5. Explain the concept of data abstraction.


Explanation: Data abstraction is a process of hiding the implementation details of an object and exposing only the relevant information to the user.



6. What are data structures?


Explanation: Data structures are ways of organizing and storing data in a computer to efficiently access and manipulate it.



7. Differentiate between arrays and linked lists.


Explanation: Arrays store elements in contiguous memory locations, while linked lists use nodes with pointers to connect elements non-contiguously.



8. What is the time complexity of linear search?


Explanation: The time complexity of linear search is O(n), where 'n' is the number of elements in the list.



9. Define the term 'polymorphism.'


Explanation: Polymorphism allows objects of different classes to be treated as objects of a common base class, enabling code flexibility and reusability.



10. Explain the concept of inheritance in OOP.


Explanation: Inheritance is a mechanism in OOP where a class (child) inherits properties and behaviors from another class (parent).



11. What is a stack, and how does it work?


Explanation: A stack is a data structure that follows the Last-In-First-Out (LIFO) principle, where the last item added is the first to be removed.



12. What is a queue, and how does it work?


Explanation: A queue is a data structure that follows the First-In-First-Out (FIFO) principle, where the first item added is the first to be removed.



13. What is the use of the 'this' keyword in Java?


Explanation: The 'this' keyword refers to the current instance of a class and is used to differentiate between instance variables and parameters with the same name.



14. Explain the concept of method overloading.


Explanation: Method overloading allows a class to have multiple methods with the same name but different parameters.



15. What is a binary tree?


Explanation: A binary tree is a hierarchical data structure where each node has at most two children.



16. Differentiate between BFS (Breadth-First Search) and DFS (Depth-First Search).


Explanation: BFS explores neighbor nodes before visiting child nodes, while DFS explores as far as possible along each branch before backtracking.



17. What is a hashing function?


Explanation: A hashing function converts data (keys) into a fixed-size hash code, which is used to index and retrieve data in hash tables efficiently.



18. Explain the concept of dynamic memory allocation.


Explanation: Dynamic memory allocation allows programs to request memory at runtime, enabling the allocation of memory based on actual requirements.



19. What is a pointer in C/C++?


Explanation: A pointer is a variable that stores the memory address of another variable, allowing direct access and manipulation of that variable.



20. Differentiate between the stack and the heap memory.


Explanation: Stack memory is used for storing local variables and function call information, while heap memory is used for dynamic memory allocation.



21. What are SQL databases and NoSQL databases?


Explanation: SQL databases are relational databases using SQL (Structured Query Language), whereas NoSQL databases are non-relational and provide flexible data models.



22. Explain the concept of deadlock in operating systems.


Explanation: Deadlock is a situation where two or more processes are unable to proceed because each is waiting for the other to release a resource.



23. What is a semaphore in concurrency control?


Explanation: A semaphore is a synchronization mechanism used to control access to shared resources between multiple threads or processes.



24. What is the role of an operating system?


Explanation: An operating system manages computer hardware and software, provides user interfaces, and facilitates communication between programs and hardware.



25. Define a database index.


Explanation: A database index is a data structure that improves the speed of data retrieval operations on a database table.



26. What is a virtual machine?


Explanation: A virtual machine is an emulation of a computer system, enabling multiple operating systems or environments to run simultaneously on the same hardware.



27. Explain the concept of Big-O notation.


Explanation: Big-O notation is used to describe the upper bound or worst-case performance of an algorithm in terms of the input size.



28. Differentiate between HTTP and HTTPS.


Explanation: HTTP (Hypertext Transfer Protocol) is not secure, while HTTPS (Hypertext Transfer Protocol Secure) encrypts data to ensure secure communication.



29. What is the purpose of an IP address?


Explanation: An IP address is a numerical label assigned to each device on a computer network, enabling identification and communication within the network.



30. Define the term 'denormalization' in the context of databases.


Explanation: Denormalization is the process of intentionally adding redundancy to a database to improve read performance at the cost of update performance.



31. What is the role of a compiler in the context of high-level programming languages?


Explanation: A compiler translates high-level programming code into machine code or an intermediate code that can be executed directly by the computer's CPU.



32. Explain the concept of virtual memory.


Explanation: Virtual memory is a memory management technique that allows a computer to use a combination of RAM and disk space to run programs efficiently.



33. Differentiate between TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).


Explanation: TCP provides reliable, connection-oriented communication, while UDP offers unreliable, connectionless communication.



34. What are cookies in web browsers?


Explanation: Cookies are small pieces of data stored on a user's computer by a web browser, used to track and maintain information about the user's browsing activities.



35. Explain the concept of cache memory.


Explanation: Cache memory is a small, high-speed memory located close to the CPU, used to store frequently accessed data to reduce memory access time.



36. What is a firewall?


Explanation: A firewall is a network security device that monitors and controls incoming and outgoing network traffic based on predefined security rules.


37. Differentiate between machine language and assembly language.


Explanation: Machine language consists of binary code directly executable by a computer's CPU, while assembly language uses mnemonics to represent machine instructions.


38. What is the role of an operating system scheduler?


Explanation: The operating system scheduler determines which processes get access to the CPU and for how long, ensuring efficient CPU utilization.


39. Explain the concept of a thread in multithreading.


Explanation: A thread is the smallest unit of execution within a process, allowing multiple tasks to be performed simultaneously within the same program.


40. Differentiate between static linking and dynamic linking.


Explanation: Static linking links all necessary libraries at compile time, while dynamic linking links libraries at runtime, reducing executable file size and enabling code sharing.


41. What is the purpose of a primary key in a database table?


Explanation: A primary key uniquely identifies each record in a database table and ensures data integrity by preventing duplicate entries.



42. Define the term 'stack overflow.'


Explanation: A stack overflow occurs when the call stack exceeds its limit, usually due to excessive recursion or lack of stack space, resulting in a program crash.



43. Explain the concept of pipelining in computer architecture.


Explanation: Pipelining breaks down the execution of instructions into multiple stages, allowing simultaneous execution of different stages to improve processor efficiency.



44. Differentiate between static and dynamic typing in programming languages.


Explanation: Static typing requires variable types to be declared explicitly during compilation, while dynamic typing infers variable types during runtime.



45. What is an API (Application Programming Interface)?


Explanation: An API is a set of rules and protocols that allows different software applications to communicate and interact with each other.



46. Define the term 'kernel' in the context of operating systems.


Explanation: The kernel is the core component of an operating system, responsible for managing system resources, providing essential services, and serving as a bridge between hardware and software.



47. What is a DDoS (Distributed Denial of Service) attack?


Explanation: A DDoS attack floods a target system with an overwhelming amount of traffic from multiple sources, causing the system to become unavailable.



48. Explain the concept of Moore's Law.


Explanation: Moore's Law states that the number of transistors on a microchip doubles approximately every two years, leading to significant improvements in computing power over time.



49. Differentiate between synchronous and asynchronous communication.


Explanation: Synchronous communication requires both parties to be present and active at the same time, while asynchronous communication allows messages to be sent and received at different times.



50. What is the purpose of the 'finally' block in exception handling?


Explanation: The 'finally' block in exception handling ensures that a section of code is always executed, regardless of whether an exception occurs or not.


No comments

Powered by Blogger.