Gayatri Institute of Computer & Management,Hinjilicut
#gayatricollegehinjilicut

Recognised by Govt. of Odisha, Affiliated to Berhampur University, AICTE Approved


Grow Your Technical Skill
Welcome visitors to your site with a short, engaging introduction.
Double click to edit and add your own text.
Our Placement Trainer
This is your Team section. It's a great place to introduce your team and talk about what makes it special, such as your culture and work philosophy. Don't be afraid to illustrate personality and character to help users connect with your team.
Java questions for campus 1. What is Java? Answer: Java is a high-level, object-oriented, platform-independent programming language developed by Sun Microsystems (now owned by Oracle Corporation). Java programs are compiled into bytecode, which runs on the JVM. 2. What is the difference between JDK, JRE, and JVM? Answer: TermMeaning JVMJava Virtual Machine, executes bytecode JREJVM + libraries required to run Java programs JDKJRE + development tools (javac, debugger, etc.) 3. Why is Java platform-independent? Answer: Java code is compiled into bytecode. The bytecode can run on any operating system that has a JVM. Statement: Write Once, Run Anywhere (WORA). 4. What are the four pillars of OOP? Answer: 1.Encapsulation 2.Inheritance 3.Polymorphism 4.Abstraction 5. What is Encapsulation? Answer: Encapsulation means wrapping data and methods into a single unit (class) and restricting direct access using access modifiers. 6. What is Inheritance? Answer: Inheritance allows one class to acquire properties and methods of another class. 7. What is Polymorphism? Answer: Polymorphism means one action can have multiple forms. Types: •Compile-time polymorphism (Method Overloading) Runtime polymorphism (Method Overriding) 8. What is an Abstract Class? Answer: An abstract class cannot be instantiated and may contain abstract and non-abstract methods. 9.Difference between Method Overloading and Overriding? OverloadingOverriding Same method name, different parametersSame method signature in child class Compile-timeRuntime Same classParent-child classes 10. Difference between Abstract Class and Interface? Abstract ClassInterface Can have normal methodsMostly abstract methods Uses extendsUses implements Supports constructorsNo constructors Single inheritanceMultiple inheritance 11. Why are Strings Immutable? Answer: Strings are immutable for: •Security •Thread safety •Better performance through String Pool 12. Difference between == and equals()? Answer: String a = new String("Java"); String b = new String("Java"); •a == b → false (compares references) •a equals(b) → true (compares values) 13. Difference between String, String Builder, and String Buffer? FeatureStringString BuilderString Buffer MutableNoYesYes Thread SafeYesNoYes FastSlowFastestModerate 14. What is a Collection Framework? Answer: A framework that provides classes and interfaces to store and manipulate groups of objects. Examples: •ArrayList •LinkedList •HashSet •HashMap 15. Difference between ArrayList and LinkedList? ArrayListLinkedList Dynamic ArrayDoubly Linked List Faster searchFaster insertion/deletion More memory efficientMore memory usage 16. What is HashMap? Answer: HashMap stores data as key-value pairs and uses hashing for fast retrieval. Key Features: •Allows one null key •Not synchronized •No guaranteed order 17. Difference between HashMap and Hashtable? HashMapHashtable Not synchronizedSynchronized FasterSlower Allows null keyNo null key 18. What is Exception Handling? Answer: Exception handling allows a program to handle runtime errors without crashing. 19. Difference between Checked and Unchecked Exceptions? CheckedUnchecked Checked at compile timeChecked at runtime Must be handledOptional IO ExceptionNull Pointer Exception 20. How do you create a Thread in Java? Method 1: Extend Thread class MyThread extends Thread { public void run() { System.out.println("Running"); } } Method 2: Implement Runnable class MyRunnable implements Runnable { public void run() { System.out.println("Running"); } } Preferred: Implement Runnable because Java supports single inheritance. Frequently Asked Rapid-Fire Questions 1.Can constructors be inherited? A. No 2.Can constructors be overridden? A. No 3.Can static methods be overridden? A. No, They can be hidden. 4.Can private methods be overridden? A. No 5.Can an interface have a constructor? A. No 6.Is Java 100% object-oriented? A. No, because it supports primitive data types such as int, char, float, etc. 7.What is the default value of int? A. 0 8.What is the default value of boolean? A. false 9.What is the size of int? A. 4 bytes (32 bits) 10.What is the entry point of a Java program? A. public static void main(String[] args)
PYTHON QUESTIONS 1. What is Python? Python is a high-level, interpreted, object-oriented programming language known for its simple syntax and readability 2. What are the key features of Python? •Easy to learn and use •Interpreted language •Object-oriented •Dynamically typed •Large standard library •Cross-platform compatibility 3. What is the difference between a list and a tuple? List Tuple MutableImmutable Uses []Uses () SlowerFaster Can be modifiedCannot be modified after creation 4. What is the difference between == and is? •== checks whether values are equal. •is checks whether two variables refer to the same object in memory. Example: a = [1, 2] b = [1, 2] print(a == b) # True print(a is b) # False 5. What are Python data types? •int •float •str •bool •list •tuple •set •dict 6. What is a dictionary in Python? A dictionary stores data as key-value pairs. Example: student = { "name": "Smita", "age": 20 } print(student["name"]) Output: Smita 7. What is list comprehension? A concise way to create lists. Example: squares = [x*x for x in range(5)] print(squares) Output: [0, 1, 4, 9, 16] 8. What is the difference between append() and extend()? Answer: a = [1, 2] a.append([3, 4]) # [1, 2, [3, 4]] b = [1, 2] b.extend([3, 4]) # [1, 2, 3, 4] 9. What is a function? A function is a reusable block of code that performs a specific task. Example: def greet(name): return f"Hello {name}" print(greet("Alice")) 10. What is recursion? Recursion is when a function calls itself. Example: def factorial(n): if n == 1: return 1 return n * factorial(n - 1) print(factorial(5)) Output: 120 11. What is OOP in Python? Object-Oriented Programming organizes code using classes and objects. Main concepts: •Encapsulation •Inheritance •Polymorphism •Abstraction 12. What is the difference between a class and an object? •Class: Blueprint for creating objects. •Object: Instance of a class. Example: class Student: pass s1 = Student() 13. What is inheritance? Inheritance allows one class to acquire properties and methods of another class. Example: class Animal: def speak(self): print("Animal sound") class Dog(Animal): pass d = Dog() d.speak() 14. What are *args and **kwargs? •*args accepts multiple positional arguments. •**kwargs accepts multiple keyword arguments. Example: def demo(*args, **kwargs): print(args) print(kwargs) demo(1, 2, name="John") 15. Write a Python program to check if a number is prime. num = 17 is_prime = True for i in range(2, int(num**0.5) + 1): if num % i == 0: is_prime = False break print("Prime" if is_prime and num > 1 else "Not Prime") 16. Write a Python program to reverse a string. s = "Python" print(s[::-1]) Output: nohtyP 17. What is the difference between shallow copy and deep copy? •Shallow copy copies references of nested objects. •Deep copy creates completely independent copies. Example: import copy a = [[1, 2], [3, 4]] b = copy.deepcopy(a) 18. What is exception handling? Exception handling prevents program crashes due to runtime errors. Example: try: x = 10 / 0 except ZeroDivisionError: print("Cannot divide by zero") 19. What is a lambda function? A lambda is an anonymous one-line function. Example: square = lambda x: x*x print(square(5)) Output: 25 20. What is the difference between Python 2 and Python 3? •Python 3 has better Unicode support. •print is a function in Python 3. •Python 2 is no longer supported. •Python 3 has improved libraries and performance. Frequently Asked Coding Questions in Campus Placements 1.Reverse a string 2.Check palindrome 3.Find factorial 4.Fibonacci series 5.Prime number check 6.Count vowels in a string 7.Find largest element in a list 8.Remove duplicates from a list 9.Sort a list without using sort() 10.Find frequency of characters in a string 1. What is PEP 8? Answer: Python coding style guide that improves code readability. 2. What is an interpreter? A program that executes code line by line without compilation. 3. What is dynamic typing? Variable type is decided at runtime. x = 10 x = "Hello" 4. What is a module? A Python file containing functions, variables, and classes. 5. What is a package? A collection of Python modules. 6. What is __name__ == "__main__"? Checks whether the file is executed directly or imported. 7. What are local variables? Variables declared inside a function. 8. What are global variables? Variables declared outside functions. 9. What is a set? Unordered collection of unique elements. s = {1, 2, 3} 10. Difference between list and set? •List allows duplicates. •Set removes duplicates automatically. 11. What is slicing? Extracting a portion of a sequence. s = "Python" print(s[1:4]) 12. What is indexing? Accessing elements using position numbers. 13. What is a mutable object? Object that can be changed after creation. Example: List, Dictionary. 14. What is an immutable object? Cannot be changed after creation. Example: String, Tuple. 15. What is len()? Returns the number of elements. 16. What is range()? Generates a sequence of numbers. 17. Difference between remove() and pop()? •remove() deletes a value. •pop() deletes by index. 18. What is unpacking? a, b = 10, 20 19. What is type casting? x = int("5") 20. What is a docstring? Documentation string inside functions/classes. 21. What is pass? Placeholder statement. 22. What is break? Terminates a loop. 23. What is continue? Skips current iteration. 24. What is enumerate()? Returns index and value together. 25. What is zip()? Combines multiple iterables. 26. What is a generator? Produces values one at a time using yield. 27. What is yield? Returns value without ending function execution. 28. Difference between generator and list? •Generator uses less memory. •List stores all values. 29. What is a decorator? Function that modifies another function's behavior. 30. What is an iterator? Object that can be iterated using next(). 31. What is map()? Applies a function to each item. list(map(lambda x:x*2,[1,2,3])) 32. What is filter()? Filters elements based on condition. 33. What is reduce()? Reduces iterable to a single value. 34. What is a lambda function? Anonymous one-line function. 35. What is method overriding? Child class provides its own implementation. 36. What is method overloading? Same method name with different arguments (simulated in Python). 37. What is polymorphism? Same interface, different implementations. 38. What is encapsulation? Wrapping data and methods together. 39. What is abstraction? Hiding implementation details. 40. What is multiple inheritance? class A: pass class B: pass class C(A,B): pass 41. What is MRO? Method Resolution Order. 42. What is self? Refers to current object instance. 43. What is a constructor? def __init__(self): pass 44. What is file handling? Reading and writing files. 45. Modes in file handling? r, w, a, rb, wb. 46. How to read a file? with open("file.txt","r") as f: print(f.read()) 47. Why use with statement? Automatically closes file. 48. What is exception? Runtime error during execution. 49. What is finally block? Executes whether exception occurs or not. 50. Difference between deepcopy() and copy()? •copy() → shallow copy. •deepcopy() → complete independent copy. Top 10 Coding Questions Asked in Campus Placements 1.Reverse a string 2.Check palindrome 3.Fibonacci series 4.Prime number 5.Factorial 6.Armstrong number 7.Find duplicates in list 8.Count vowels in string 9.Sort list without sort() 10.Find second largest element Top 10 Advanced Python Questions 1.GIL (Global Interpreter Lock) 2.Multithreading vs Multiprocessing 3.Garbage Collection 4.Memory Management 5.Monkey Patching 6.Duck Typing 7.Context Managers 8.Metaclasses 9.Asyncio 10.Python Virtual Environment
C++ Important Questions & Answers 1. What is C++? Answer: C++ is a general-purpose, object-oriented programming language developed by Bjarne Stroustrup. 2. What are the features of C++? Answer: Object-Oriented Programming, Platform Independence, Dynamic Memory Management, Templates, Exception Handling, and STL(standard template library). 3. What is OOP? Answer: OOP (Object-Oriented Programming) is a programming paradigm based on objects and classes. 4. What are the four pillars of OOP? Answer: Encapsulation, Inheritance, Polymorphism, and Abstraction. 5. What is a class? Answer: A class is a blueprint for creating objects. 6. What is an object? Answer: An object is an instance of a class. 7. What is a constructor? Answer: A constructor is a special member function that initializes an object. 8. What is a destructor? Answer: A destructor is a special member function that is called when an object is destroyed. 9. What is constructor overloading? Answer: Defining multiple constructors with different parameter lists. 10. What is function overloading? Answer: Having multiple functions with the same name but different parameters. 11. What is operator overloading? Answer: Redefining the behavior of operators for user-defined types. 12. What is inheritance? Answer: A mechanism through which one class acquires the properties of another class. 13. What are the types of inheritance? Answer: Single, Multiple, Multilevel, Hierarchical, and Hybrid inheritance. 14. What is polymorphism? Answer: The ability of a function or object to take many forms. 15. What is compile-time polymorphism? Answer: Polymorphism achieved through function overloading and operator overloading. 16. What is runtime polymorphism? Answer: Polymorphism achieved through function overriding and virtual functions. 17. What is a virtual function? Answer: A function declared with the virtual keyword that allows runtime polymorphism. 18. What is a pure virtual function? Answer: A virtual function assigned with = 0. virtual void display() = 0; 19. What is an abstract class? Answer: A class containing at least one pure virtual function. 20. What is encapsulation? Answer: Wrapping data and functions together into a single unit. 21. What is abstraction? Answer: Hiding implementation details and showing only essential information. 22. What are access specifiers? Answer: Public, Private, and Protected. 23. What is a private member? Answer: A member accessible only within the same class. 24. What is a protected member? Answer: A member accessible within the class and its derived classes. 25. What is a public member? Answer: A member accessible from anywhere in the program. 26. What is a friend function? Answer: A function that can access private and protected members of a class. 27. What is a namespace? Answer: A feature used to avoid naming conflicts. 28. What is the std namespace? Answer: It contains all standard C++ library components. 29. What is a pointer? Answer: A variable that stores the memory address of another variable. 30. What is a reference variable? Answer: An alias for an existing variable. 31. What is a null pointer? Answer: A pointer that does not point to any valid memory location. 32. What is a dangling pointer? Answer: A pointer that points to memory that has already been freed. 33. What is dynamic memory allocation? Answer: Allocating memory during program execution using new. 34. What is the new operator? Answer: It allocates memory dynamically. 35. What is the delete operator? Answer: It releases dynamically allocated memory. 36. Difference between new and malloc()? Answer: new calls constructors; malloc() does not. 37. Difference between delete and free()? Answer: delete calls destructors; free() does not. 38. What is a template? Answer: A feature that allows generic programming. 39. What is a function template? Answer: A template used to create generic functions. 40. What is a class template? Answer: A template used to create generic classes. 41. What is exception handling? Answer: A mechanism for handling runtime errors. 42. What are the exception handling keywords? Answer: try, catch, and throw. 43. What is STL? Answer: STL stands for Standard Template Library. 44. What are the components of STL? Answer: Containers, Iterators, and Algorithms. 45. What is a vector? Answer: A dynamic array provided by STL. 46. What is a list? Answer: A doubly linked list container in STL. 47. What is a map? Answer: A key-value pair associative container. 48. What is a set? Answer: A container that stores unique elements. 49. What is an iterator? Answer: An object used to traverse STL containers. 50. What is file handling in C++? Answer: Reading from and writing to files using file streams. 51. What are the file stream classes? Answer: ifstream, ofstream, and fstream. 52. What is an inline function? Answer: A function expanded at compile time to reduce function call overhead. 53. What is recursion? Answer: A process where a function calls itself. 54. What is a copy constructor? Answer: A constructor used to initialize an object using another object. 55. What is shallow copy? Answer: Copying object data by copying memory addresses. 56. What is deep copy? Answer: Copying actual data into new memory locations. 57. What is a static variable? Answer: A variable that retains its value throughout the program's execution. 58. What is a static member function? Answer: A function that can access only static members of a class. 59. What is the this pointer? Answer: A pointer that refers to the current object. 60. What is call by value? Answer: Passing a copy of a variable to a function. 61. What is call by reference? Answer: Passing the actual variable reference to a function. 62. What is the difference between C and C++? Answer: C is procedural, while C++ supports object-oriented programming. 63. Why is C++ called a middle-level language? Answer: Because it supports both low-level and high-level programming features. 64. What is a header file? Answer: A file containing declarations and definitions used by programs. 65. What is the purpose of the main() function? Answer: It is the entry point of every C++ program. Most Frequently Asked Campus Interview Questions 1.What is the difference between class and object? 2.What is inheritance and its types? 3.What is polymorphism? 4.Difference between compile-time and runtime polymorphism? 5.What is a virtual function? 6.What is a constructor and destructor? 7.What is a pointer? 8.Difference between shallow copy and deep copy? 9.What is STL? 10.Difference between C and C++?
C Programming Questions and Answers 1. What is C? C is a general-purpose, procedural programming language developed by Dennis Ritchie in 1972. 2. Who developed C? Dennis Ritchie. 3. What is the extension of a C source file? .c 4. What is the entry point of a C program? Answer: main() function. 5. What is a variable? A named memory location used to store data. 6. What are the basic data types in C? int, char, float, double. 7. What is a constant? A value that cannot be changed during program execution. 8. What is a keyword? Reserved words with predefined meanings (e.g., int, if, while). 9. What is the size of int? Typically 4 bytes (depends on compiler/system). 10. What is the size of char? 1 byte. 11. What is an operator? A symbol used to perform operations on operands. 12. What are arithmetic operators? +, -, *, /, % 13. What is the modulus operator? % returns the remainder after division. 14. What is increment operator? ++ increases value by 1. 15. What is decrement operator? -- decreases value by 1. 16. Difference between = and ==? = assigns value, == compares values. 17. What is a relational operator? Operators like , =, ==, !=. 18. What is a logical operator? &&, ||, ! 19. What is operator precedence? Answer: The order in which operators are evaluated. 20. What is a ternary operator? condition ? value1 : value2 21. What is an if statement? Used for decision making. 22. Syntax of if statement? if(condition) { statement; } 23. What is if-else? Executes one block if condition is true and another if false. 24. What is nested if? An if statement inside another if statement. 25. What is switch statement? Used for multiple-choice selection. 26. What is break statement? Terminates loop or switch. 27. What is continue statement? Skips current iteration and continues loop. 28. What is goto statement? Transfers control to a labeled statement. 29. What is a loop? nswer: Repeats a block of code. 30. Types of loops in C? for, while, do-while. 31. What is a for loop? for(i=0;i



_edited.jpg)