Computer Science

Computer Science

Top Interview Questions

About Computer Science

 

Understanding Computer Science

Computer Science (CS) is the systematic study of computation, algorithms, data structures, and the design of hardware and software systems. It encompasses both the theoretical foundations of information and computation, and the practical techniques for implementing and applying these foundations in technology.

Computer Science is not just about programming—it’s a broad field that includes problem-solving, data management, artificial intelligence, networking, cybersecurity, human-computer interaction, and much more. In today’s digital era, computer science drives innovation across industries, from healthcare and finance to entertainment and space exploration.


Definition of Computer Science

Computer Science can be defined as:

“The study of algorithms, computational systems, and the principles behind designing, developing, and analyzing software and hardware to solve complex problems.”

Key elements of Computer Science include:

  1. Algorithms: Step-by-step procedures for solving computational problems.

  2. Programming: Writing instructions for computers to perform tasks.

  3. Data Structures: Organizing and storing data efficiently.

  4. Software Development: Designing, coding, testing, and maintaining applications.

  5. Computer Architecture: Understanding how computers process and store information.

  6. Theoretical Foundations: Computation theory, logic, and automata.


History of Computer Science

Computer Science as a formal discipline emerged in the mid-20th century, though its roots can be traced back centuries. Key milestones include:

  • 17th-19th Century: Mathematicians like Charles Babbage and Ada Lovelace conceptualized programmable machines.

  • 1930s-1940s: Alan Turing and others developed theoretical models of computation (Turing machines) and early electronic computers.

  • 1950s: Introduction of high-level programming languages like FORTRAN and LISP.

  • 1960s-70s: Development of operating systems, compilers, and the first computer science departments in universities.

  • 1980s-90s: Rise of personal computers, object-oriented programming, and networking.

  • 2000s-Present: Growth of AI, big data, cloud computing, mobile computing, and cybersecurity.


Branches of Computer Science

Computer Science is a multi-disciplinary field with numerous specialized areas:

1. Theoretical Computer Science

Focuses on mathematical foundations, logic, and algorithms:

  • Algorithm Analysis: Studying efficiency and performance of algorithms.

  • Computational Theory: Understanding what can be computed and the limits of computation.

  • Automata Theory: Models of computation using finite state machines, Turing machines, and formal languages.

2. Software Engineering

Covers design, development, and maintenance of software:

  • Programming methodologies

  • Software testing and debugging

  • Project management and agile development

  • Version control and deployment

3. Artificial Intelligence (AI) & Machine Learning

Enables computers to simulate human intelligence:

  • Natural Language Processing (NLP)

  • Computer Vision

  • Robotics

  • Predictive analytics and recommendation systems

4. Data Science & Big Data

Involves analyzing and interpreting large datasets:

  • Data mining and visualization

  • Statistical analysis and predictive modeling

  • Cloud-based data management

  • Database systems (SQL, NoSQL)

5. Computer Graphics & Multimedia

Focuses on visual computing and animation:

  • Game development and simulations

  • 3D modeling and rendering

  • Virtual reality (VR) and augmented reality (AR)

6. Cybersecurity & Networking

Ensures secure and efficient communication:

  • Cryptography and encryption

  • Network protocols and security

  • Ethical hacking and penetration testing

  • Firewalls, IDS, and cybersecurity frameworks

7. Human-Computer Interaction (HCI)

Studies user experience and interface design:

  • GUI and web interface development

  • User experience (UX) research

  • Accessibility and usability testing

8. Embedded Systems & IoT

Involves hardware-software integration:

  • Microcontrollers and sensors

  • Industrial automation

  • Smart home devices and IoT networks


Core Concepts in Computer Science

1. Algorithms and Problem Solving

Algorithms are the heart of computer science. They provide systematic solutions to problems. Examples include:

  • Sorting algorithms: QuickSort, MergeSort

  • Search algorithms: Binary Search, Depth-First Search

  • Graph algorithms: Dijkstra’s shortest path

2. Programming Languages

Computer Science uses programming languages to translate algorithms into executable instructions:

  • Low-level: Assembly, C

  • High-level: Python, Java, C++

  • Scripting: JavaScript, PHP, Bash

  • Functional: Haskell, Lisp

3. Data Structures

Efficient storage and retrieval of data is crucial. Common data structures include:

  • Arrays, Linked Lists

  • Stacks, Queues

  • Trees, Graphs, Hash Tables

4. Databases

Databases store and organize information:

  • Relational (SQL-based) databases

  • Non-relational (NoSQL) databases

  • Data integrity, normalization, and indexing

5. Operating Systems

Operating systems manage hardware, memory, and processes:

  • Examples: Linux, Windows, macOS

  • Concepts: multitasking, concurrency, file systems, process scheduling

6. Networking

Networking enables data exchange across systems:

  • TCP/IP protocols

  • LAN, WAN, and internet architecture

  • Cloud computing infrastructure


Applications of Computer Science

Computer Science has a far-reaching impact across industries:

  1. Healthcare: Medical imaging, patient record management, AI diagnostics.

  2. Finance: Automated trading, fraud detection, banking software.

  3. Education: E-learning platforms, virtual classrooms, adaptive learning.

  4. Entertainment: Video games, CGI movies, streaming services.

  5. Transportation: Autonomous vehicles, traffic management, logistics optimization.

  6. Government & Defense: Cybersecurity, data analytics, surveillance.

  7. Research & Development: Simulations, scientific modeling, AI research.


Importance of Computer Science

  1. Innovation Driver: Powers AI, robotics, cloud computing, and IoT.

  2. Problem Solving: Enables systematic solutions for real-world challenges.

  3. Automation: Reduces manual work and improves efficiency.

  4. Economic Impact: Software and IT industries are major contributors to global GDP.

  5. Interdisciplinary Applications: Enhances research in biology, physics, social sciences, and engineering.

  6. Digital Transformation: Enables smart cities, e-commerce, fintech, and telemedicine.


Skills Required for Computer Science

  1. Programming and coding skills

  2. Mathematical and logical reasoning

  3. Problem-solving and analytical thinking

  4. Database and data management skills

  5. Knowledge of AI, ML, and data science

  6. Networking and cybersecurity fundamentals

  7. Teamwork and software development lifecycle understanding


Future of Computer Science

Computer Science continues to evolve rapidly, driven by technological advancements:

  • Artificial Intelligence and Machine Learning: Smarter algorithms and automation.

  • Quantum Computing: Faster computation for complex problems.

  • Edge and Cloud Computing: Distributed computing with low latency.

  • Cybersecurity Advances: Protecting digital infrastructure in an interconnected world.

  • Human-Centric Computing: Enhanced user interfaces, augmented reality, and wearable technology.

  • Sustainable Computing: Energy-efficient computing systems for environmental impact.


Conclusion

Computer Science is the foundation of the digital era, encompassing both theory and practical applications. It is not limited to programming but includes algorithms, data structures, AI, networking, cybersecurity, and human-computer interaction.

The field drives innovation, economic growth, and societal transformation, impacting every industry and aspect of daily life. For students and professionals, mastering computer science opens doors to cutting-edge technologies, high-demand careers, and opportunities to solve complex global challenges.

Computer Science is, in essence, the study of problem-solving using computational systems, and its significance continues to grow as the world becomes increasingly digital and interconnected.

Fresher Interview Questions

 

1. Basics of Computer Science

Q1. What is Computer Science?
Answer:
"Computer Science is the study of computers, computational systems, and algorithms. It involves designing software, understanding hardware, analyzing data, and solving problems using computing principles."


Q2. Difference between Computer Science, IT, and Software Engineering

Field Focus
Computer Science Algorithms, theory, programming
IT Managing networks, servers, and IT infrastructure
Software Engineering Software development lifecycle, coding, testing

Q3. What is an algorithm?
"An algorithm is a step-by-step procedure to solve a problem or perform a computation. Efficiency and correctness are key attributes."


Q4. What is the difference between algorithm and program?

Feature Algorithm Program
Definition Logical steps to solve a problem Implementation of algorithm in a programming language
Execution Not executable Executable
Medium Language-independent Language-specific

Q5. What is a data structure?
"A data structure is a way to organize and store data for efficient access and modification. Examples: array, linked list, stack, queue, tree, graph."


2. Programming Concepts

Q6. Difference between compiled and interpreted languages

Feature Compiled Language Interpreted Language
Execution Translated to machine code Executed line by line
Example C, C++ Python, JavaScript
Performance Faster Slower

Q7. What is Object-Oriented Programming (OOP)?
"OOP is a programming paradigm based on objects that contain data (attributes) and behavior (methods). It emphasizes encapsulation, inheritance, polymorphism, and abstraction."


Q8. Difference between procedural and object-oriented programming

Feature Procedural Object-Oriented
Approach Function-based Object-based
Reusability Low High
Examples C, Pascal C++, Java, Python

Q9. What is the difference between stack and heap memory?

  • Stack: Stores local variables and function calls, memory managed automatically, faster

  • Heap: Stores objects, memory managed manually or via GC, larger space


Q10. What are functions/methods in programming?
"A function is a block of code that performs a specific task and can be reused. It may take input parameters and return output."


Q11. What is recursion?
"Recursion occurs when a function calls itself directly or indirectly to solve a problem. Must have a base case to avoid infinite recursion."

Example: Factorial function


Q12. What is the difference between iteration and recursion?

Feature Iteration Recursion
Control Loops (for, while) Function calls
Memory usage Low Higher (stack frames)
Use case Simple loops Tree/graph traversal

3. Data Structures

Q13. Difference between array and linked list

Feature Array Linked List
Memory Contiguous Non-contiguous
Access O(1) (index) O(n)
Size Fixed Dynamic

Q14. What is a stack?
"A stack is a linear data structure following LIFO (Last In, First Out). Operations: push, pop, peek."


Q15. What is a queue?
"A queue is a linear data structure following FIFO (First In, First Out). Operations: enqueue, dequeue."


Q16. What is a binary tree?
"A binary tree is a hierarchical data structure where each node has at most two children: left and right."


Q17. Difference between binary tree and binary search tree (BST)

Feature Binary Tree Binary Search Tree
Ordering No specific order Left < Root < Right
Searching O(n) O(log n) (average)

Q18. What is a graph?
"A graph is a set of nodes (vertices) connected by edges. Types: directed, undirected, weighted, unweighted."


Q19. What is hashing?
"Hashing is converting data into a fixed-size value (hash code) for fast retrieval in hash tables."


Q20. Difference between linear search and binary search

Feature Linear Search Binary Search
Data Unsorted Sorted
Time complexity O(n) O(log n)
Approach Sequential Divide and conquer

4. Database Concepts (DBMS)

Q21. What is a database?
"A database is an organized collection of data that can be stored, managed, and retrieved efficiently."


Q22. What is DBMS?
"DBMS (Database Management System) is software to manage databases, perform CRUD operations, enforce constraints, and ensure data security."


Q23. Difference between DBMS and RDBMS

Feature DBMS RDBMS
Data structure File-oriented Table-oriented (relations)
Keys No concept of primary/foreign Primary/foreign keys supported
Examples dBase, FoxPro MySQL, Oracle, SQL Server

Q24. What is normalization?
"Normalization is organizing data to reduce redundancy and improve integrity. Forms: 1NF, 2NF, 3NF, BCNF."


Q25. Difference between primary key and foreign key

Feature Primary Key Foreign Key
Purpose Unique row identifier Links to primary key of another table
Uniqueness Must be unique Can be duplicate

Q26. What is SQL?
"SQL (Structured Query Language) is used to create, manipulate, and retrieve data from relational databases."


Q27. Difference between DDL and DML

Feature DDL (Data Definition Language) DML (Data Manipulation Language)
Purpose Defines schema/objects Manipulates data
Commands CREATE, ALTER, DROP SELECT, INSERT, UPDATE, DELETE

Q28. Difference between INNER JOIN and LEFT JOIN

  • INNER JOIN: Returns matching rows from both tables

  • LEFT JOIN: Returns all rows from left table, matching rows from right table


5. Operating System Concepts

Q29. What is an operating system?
"An OS manages hardware, memory, processes, files, and provides an interface for users and applications."


Q30. Difference between process and thread

Feature Process Thread
Definition Program in execution Smallest unit of process
Memory Own memory space Shares process memory
Overhead High Low

Q31. What is deadlock?
"Deadlock occurs when two or more processes wait indefinitely for resources held by each other."


Q32. What is virtual memory?
"Virtual memory allows OS to use disk storage as temporary memory to extend physical RAM."


Q33. What is paging and segmentation?

  • Paging: Memory divided into fixed-size pages

  • Segmentation: Memory divided based on logical segments (code, data, stack)


6. Networking Basics

Q34. What is a network?
"A network is a set of computers connected to share data and resources."


Q35. Difference between LAN, MAN, and WAN

Type Coverage
LAN Local Area Network (office/home)
MAN Metropolitan Area Network (city)
WAN Wide Area Network (country/world)

Q36. What is TCP/IP?
"TCP/IP is a protocol suite for communication over networks, ensuring reliable data transfer."


Q37. Difference between TCP and UDP

Feature TCP UDP
Reliability Reliable, connection-oriented Unreliable, connectionless
Speed Slower Faster
Use case File transfer, email Video streaming, VoIP

Q38. What is HTTP and HTTPS?

  • HTTP: Hypertext Transfer Protocol, unencrypted

  • HTTPS: Secure HTTP with SSL/TLS encryption


Q39. What is DNS?
"DNS (Domain Name System) converts human-readable domain names to IP addresses."


Q40. What is IP address?
"IP address is a unique identifier assigned to a device on a network. Types: IPv4 (32-bit), IPv6 (128-bit)."


7. OOP and Miscellaneous

Q41. Explain encapsulation
"Encapsulation is wrapping data and methods together and controlling access using access modifiers (private, public, protected)."


Q42. Explain inheritance
"Inheritance allows a class to acquire properties and methods of another class. Promotes code reuse."


Q43. Explain polymorphism
"Polymorphism allows objects to behave differently based on context. Types: compile-time (overloading), runtime (overriding)."


Q44. Explain abstraction
"Abstraction hides implementation details and exposes only necessary functionality to users."


Q45. Difference between abstract class and interface

Feature Abstract Class Interface
Implementation Can have implemented methods Only method signatures (default allowed in Java 8+)
Inheritance Single inheritance Multiple inheritance allowed

Q46. Difference between == and equals() in Java

  • == compares references

  • equals() compares content


Q47. What is software development life cycle (SDLC)?
"SDLC is a process to design, develop, test, and maintain software. Models: Waterfall, Agile, Spiral, V-Model."


Q48. What is version control?
"Version control systems like Git manage code changes, track history, and allow collaboration among developers."


Q49. Difference between compile-time error and runtime error

Feature Compile-time Error Runtime Error
Detection At compilation During execution
Example Syntax error Division by zero

Q50. What is debugging?
"Debugging is identifying, analyzing, and fixing errors or bugs in a program to ensure correct execution."

Experienced Interview Questions

 

Core Computer Science Concepts

1. What is the difference between a process and a thread?

Answer:

  • Process: An independent program in execution with its own memory space.

  • Thread: A lightweight unit within a process sharing memory.

  • Threads are used for concurrent execution while processes provide isolation.


2. Explain the concept of Object-Oriented Programming.

Answer:
OOP is a programming paradigm based on objects and classes. Key principles:

  • Encapsulation: Hiding internal state via accessors.

  • Abstraction: Exposing only relevant behavior.

  • Inheritance: Reusing code via class hierarchies.

  • Polymorphism: Ability of objects to take multiple forms.


3. What is the difference between stack and heap memory?

Answer:

Feature Stack Heap
Memory allocation Static Dynamic
Access speed Fast Slower
Lifespan Function scope Program scope
Used for Local variables Objects, dynamic memory

4. Explain big O notation.

Answer:

  • Big O expresses algorithmic complexity in terms of input size.

  • Examples:

    • O(1) – Constant time

    • O(n) – Linear time

    • O(n^2) – Quadratic time

  • Helps analyze scalability and performance.


5. Difference between compile-time and run-time errors.

Answer:

  • Compile-time: Syntax or type errors detected by the compiler.

  • Run-time: Occur during execution, like null references, divide by zero.


6. Explain the difference between deadlock and livelock.

Answer:

  • Deadlock: Two or more threads waiting indefinitely for each other’s resources.

  • Livelock: Threads are active but cannot make progress because of continuous state changes.


7. What is virtual memory?

Answer:

  • Memory management technique using disk storage to extend RAM.

  • Each process gets an isolated address space.

  • Supports process isolation and memory protection.


8. Difference between process scheduling algorithms.

Answer:

  • FCFS: First-Come-First-Serve, simple, can cause long waiting time.

  • SJF: Shortest Job First, optimal average waiting time, may cause starvation.

  • Round Robin: Time-sliced, fair among processes.

  • Priority Scheduling: Processes with higher priority run first.


9. What is multithreading, and why is it used?

Answer:

  • Multithreading: Multiple threads execute concurrently within a process.

  • Used for parallelism, I/O waiting, better CPU utilization, and responsive UI.


10. Difference between synchronous and asynchronous execution.

Answer:

  • Synchronous: Tasks run sequentially; next waits for current to complete.

  • Asynchronous: Tasks run independently; allows parallel execution and non-blocking behavior.


Data Structures & Algorithms

11. What is the difference between an array and a linked list?

Answer:

Feature Array Linked List
Size Fixed Dynamic
Memory Contiguous Non-contiguous
Access O(1) O(n)
Insertion/Deletion Expensive Efficient (O(1) if node known)

12. Explain stack and queue.

Answer:

  • Stack: LIFO, operations: push, pop, peek.

  • Queue: FIFO, operations: enqueue, dequeue, peek.

  • Variants: Deque, Priority Queue, Circular Queue.


13. Difference between binary tree and binary search tree.

Answer:

  • Binary tree: Each node has max 2 children, no ordering.

  • BST: Binary tree with left child < node < right child, used for efficient search.


14. What is a hash table, and how does it handle collisions?

Answer:

  • Hash table: Key-value storage with fast O(1) access using a hash function.

  • Collision handling:

    • Chaining: Linked list for colliding keys.

    • Open addressing: Probing for next available slot.


15. Explain graph representations.

Answer:

  • Adjacency matrix: 2D array, O(V^2) space, fast edge check.

  • Adjacency list: List of neighbors, O(V+E) space, efficient for sparse graphs.


16. Difference between BFS and DFS.

Answer:

  • BFS: Level-order traversal, uses queue, finds shortest path in unweighted graphs.

  • DFS: Depth-first traversal, uses stack/recursion, useful for cycle detection.


17. What is dynamic programming?

Answer:

  • Technique for solving problems by breaking them into overlapping subproblems.

  • Uses memoization or tabulation to optimize recursive solutions.

  • Example: Fibonacci sequence, knapsack problem.


18. Explain complexity of sorting algorithms.

Answer:

Algorithm Best Average Worst Notes
Bubble Sort O(n) O(n^2) O(n^2) Simple, inefficient
Quick Sort O(n log n) O(n log n) O(n^2) Pivot selection critical
Merge Sort O(n log n) O(n log n) O(n log n) Stable, uses extra space
Heap Sort O(n log n) O(n log n) O(n log n) In-place, not stable

19. Difference between stack and heap memory in data structures context.

Answer:

  • Stack: Stores function call frames, local variables. Fast allocation, limited size.

  • Heap: Stores dynamically allocated structures like linked lists, trees, graphs. Larger, managed manually or via GC.


20. What is a priority queue, and where is it used?

Answer:

  • Queue where each element has a priority. Highest priority dequeued first.

  • Used in Dijkstra’s algorithm, OS scheduling, task management.


Databases

21. Difference between SQL and NoSQL.

Answer:

Feature SQL NoSQL
Schema Fixed Flexible
Storage Relational tables Key-value, document, graph, columnar
Transactions ACID Eventual consistency often
Examples MySQL, PostgreSQL MongoDB, Cassandra

22. What is normalization?

Answer:

  • Process to eliminate redundancy and improve data integrity.

  • Normal forms: 1NF, 2NF, 3NF, BCNF.


23. Explain ACID properties.

Answer:

  • Atomicity: All or nothing.

  • Consistency: DB remains in a valid state.

  • Isolation: Transactions don’t interfere.

  • Durability: Committed changes are permanent.


24. What is indexing, and why is it used?

Answer:

  • Data structure for fast lookup.

  • Speeds up SELECT queries but may slow down INSERT/UPDATE/DELETE.


25. Difference between clustered and non-clustered index.

Answer:

  • Clustered: Determines physical order of table data. Only one per table.

  • Non-clustered: Separate structure pointing to table rows. Multiple allowed.


26. Difference between primary key and unique key.

Answer:

  • Primary key: Unique + Not NULL, only one per table.

  • Unique key: Unique constraint, can allow NULL, multiple per table.


27. Difference between inner join, left join, right join, full outer join.

Answer:

Join Result
Inner Only matching rows
Left All left rows, NULL for unmatched right
Right All right rows, NULL for unmatched left
Full All rows, NULL for unmatched sides

28. Explain transactions and savepoints.

Answer:

  • Transaction: Group of SQL operations treated as one.

  • Savepoint: Allows partial rollback within a transaction.


29. What is database deadlock, and how is it resolved?

Answer:

  • Deadlock: Two transactions wait for each other’s resources.

  • Resolved by deadlock detection and rollback of one transaction.


30. Difference between stored procedure and function.

Answer:

  • Stored procedure: Executes a series of statements; may return multiple result sets; can perform DML.

  • Function: Returns a value, can be used in queries, cannot modify data directly.


Operating Systems & Networking

31. Difference between OS kernel modes.

Answer:

  • User mode: Limited privileges; apps run here.

  • Kernel mode: Full privileges; OS executes core tasks.


32. Explain paging and segmentation.

Answer:

  • Paging: Fixed-size memory blocks; solves fragmentation.

  • Segmentation: Variable-size logical units; easier to manage logically.


33. Explain TCP vs UDP.

Answer:

Feature TCP UDP
Connection Connection-oriented Connectionless
Reliability Reliable Unreliable
Use case HTTP, FTP Video streaming, DNS

34. Difference between socket and port.

Answer:

  • Socket: Combination of IP address + port number for communication.

  • Port: Endpoint identifier on host machine.


35. What is a deadlock in OS?

Answer:

  • Occurs when two or more processes wait indefinitely for each other’s resources.

  • Can be handled via prevention, avoidance, detection, and recovery.


36. Explain semaphores and mutexes.

Answer:

  • Semaphore: Signaling mechanism to manage multiple resources.

  • Mutex: Mutual exclusion for a single resource.


37. What is caching, and why is it used?

Answer:

  • Temporary storage for frequently accessed data.

  • Improves performance and reduces load on DB/CPU.


38. Explain thread synchronization techniques.

Answer:

  • Locks / mutex / semaphore

  • Monitors (C# lock, Java synchronized)

  • Atomic operations (CAS, Interlocked)


39. Explain memory leak and how to prevent it.

Answer:

  • Memory allocated but never released, leading to performance degradation.

  • Prevented via GC, proper resource disposal, avoiding circular references.


40. How would you optimize a slow algorithm?

Answer:

  • Analyze complexity

  • Replace nested loops with efficient data structures

  • Use hashing, caching, dynamic programming

  • Parallelize using threads if possible


41. What is a REST API and how does it relate to CS concepts?

Answer:

  • REST API allows stateless communication using HTTP methods (GET, POST, PUT, DELETE).

  • Concepts like client-server, statelessness, serialization, and caching apply here.


42. How would you debug a performance issue in a multi-threaded application?

Answer:

  • Use profilers to detect CPU/memory hotspots

  • Check for deadlocks, contention, and thread starvation

  • Optimize synchronization and reduce locking overhead


43. Explain garbage collection in managed languages.

Answer:

  • Automatic memory management

  • Frees unused objects, tracks references

  • Types: Mark-and-Sweep, Generational GC, Reference Counting


44. Difference between compile-time polymorphism and runtime polymorphism.

Answer:

  • Compile-time: Method overloading, operator overloading

  • Runtime: Method overriding using virtual methods


45. Explain BFS and DFS applications in real-world CS problems.

Answer:

  • BFS: Shortest path in maps, peer-to-peer networks

  • DFS: Cycle detection, backtracking (puzzles, AI pathfinding)


46. How does hashing work in CS, and where is it used?

Answer:

  • Maps input to a fixed-size output using a hash function

  • Used in hash tables, cryptography, caching, checksums


47. Explain complexity classes P, NP, NP-complete, NP-hard.

Answer:

  • P: Problems solvable in polynomial time

  • NP: Solutions verifiable in polynomial time

  • NP-complete: Hardest NP problems; if one solved in P, all NP in P

  • NP-hard: At least as hard as NP-complete, may not be in NP


48. What is a priority inversion problem?

Answer:

  • Low-priority thread holds a resource needed by high-priority thread

  • Solved using priority inheritance


49. What is the difference between compile-time binding and runtime binding?

Answer:

  • Compile-time: Method calls resolved at compile time (static binding)

  • Runtime: Resolved dynamically at runtime (polymorphism)


50. How do you handle large data processing in-memory vs disk?

Answer:

  • In-memory: Fast, use caching, MapReduce, streaming frameworks

  • Disk-based: Batch processing, partitioning, external sorting