0% found this document useful (0 votes)
37 views4 pages

C, Java & Python Interview Questions

Uploaded by

MAKKA MADHAVA
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views4 pages

C, Java & Python Interview Questions

Uploaded by

MAKKA MADHAVA
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd

IMPORTANT QUESTIONS FOR INTERVIEWS IN C, JAVA & PYTHON

Here are some frequently asked C language questions for freshers:

1. Difference between declaration & definition of function

2. Features of C language

3. Different storage class specifiers in C

4. Difference between local variable & global variable

5. What are variables in C

6. Use of static variable

7. Uses of pointers

8. What is recursion

9. Local static variables? What is their use?

10. Array? Explain Array

11. Differences b/w array & pointer?

12. Define the OOPS concept.

13. malloc() vs calloc()

14. Define pointer on pointer

15. Define NULL pointer

16. Define structure

17. Difference between far and near pointer

18. Operator in C

19. Bitwise operator

20. Difference between class and object

The tip here: If the interviewer wants to conduct an interview through VIVA format, he mostly asks you
about differences. For example differences between array and pointer, differences between C and JAVA,
Different variables in C, etc.,
Must read concepts: (Never Miss these)

21. Pointers

22. Arrays and Strings

23. Structures

24. Data Structures

25. Functions, Operators

Most Predicted Programs to be answered:

26. Fibonacci Series

27. Prime numbers

28. Palindrome

29. Factorials

30. Armstrong

31. Sum of the digits

32. Swap two numbers

33. Matrix multiplication

34. Alphabet triangle

35. Write an example program for Pointers

36. Example program for Arrays

37. Example program for structures

38. Bubble sort

39. Convert an array into a zig-zag

Most asked JAVA interview questions for freshers:


40. What do you mean by Object & Class?

41. Explain OOPS concepts

42. What are the OOPS concepts

43. Explain Inheritance

44. Explain Normalization

45. Explain Encapsulation

46. Explain Polymorphism

47. Explain Static Method and Static variable

48. Explain Method overloading and Method overriding

49. Explain Data Encapsulation

50. What are collection frameworks?

51. Explain the FINAL keyword

52. Explain Multi threading

53. Explain Array, String

Most asked PYTHON interview questions for freshers:

54. What is a List

55. What is a Tuple

56. What is a dictionary

57. Explain Modules and Packages in Python

58. What is OOPS concept

59. Explain various OOPS concepts

60. Explain Inheritance

61. Explain Normalization

62. Explain Encapsulation


63. Explain Polymorphism

64. How many keywords are there in Python

65. Common built-in Data Types in Python

66. Difference between PYTHON/JAVA

67. Which is faster JAVA or Python

68. What is break, continue and Pass in Python

69. What is slicing in Python

70. Explain about decorators in python

Common questions

Powered by AI

Multi-threading in Java allows simultaneous execution of two or more segments of a program, improving performance and resource utilization. It enables more efficient CPU use by running parallel tasks, reducing CPU idle time. In UI applications, it provides a smoother user experience by handling background tasks concurrently. Threads also allow the program to continue executing even when part is blocked, maintaining responsiveness .

Polymorphism in Java allows objects to be treated as instances of their parent class, enabling multiple forms of a single interface. This enhances flexibility by allowing code to be more generic and reusable, as methods can act on superclass types and process any object of a subclass. It aids maintainability by centralizing method implementation and reducing redundancy, making code easier to manage and extend .

Method overloading in Java refers to having multiple methods with the same name but different parameter lists (type, number, or both) within the same class, providing multiple ways to perform similar tasks. Method overriding, however, involves redefining a method in a subclass that was already defined in its superclass, allowing the subclass to provide a specific implementation for the method. Overloading is resolved at compile time, whereas overriding is determined at runtime .

Object-oriented programming (OOP) in Java is strictly class-based, requiring all functions to be part of classes, while Python supports OOP in a more flexible and informal way, mixing procedural and object-oriented styles. Java uses explicit data types and has strict syntax rules, which offer more control over data flow. Python, in contrast, is dynamic and dynamically typed, which can increase productivity with quicker prototyping but might lead to runtime errors if not handled cautiously .

Arrays in C are collections of elements stored at contiguous memory locations, while pointers are variables that store the address of other variables. Arrays provide index-based access and have a fixed size determined at compile time. Pointers, however, can dynamically point to different data types or memory locations and allow more flexible data handling and dynamic memory allocation. Additionally, pointers can be incremented or decremented to traverse memory, while arrays cannot .

Recursion allows a function to call itself, solving complex problems by breaking them down into simpler sub-problems. It simplifies code for problems like tree traversal, factorials, and the Fibonacci sequence, often leading to more elegant and intuitive solutions than iterative approaches. However, recursion may involve higher memory consumption due to stack usage and sometimes is replaced with an iterative solution when performance is crucial .

The declaration of a function in C specifies the function's name, return type, and parameters, serving as a contract or a promise about what can be expected. It's typically found in header files. The definition of a function, on the other hand, includes the actual body of the function, describing what the function does, and is found in the source file .

Static variables in C retain their value across function calls, unlike local variables which get reinitialized. This persistence allows static variables to maintain state information between functions calls, making them useful for counters or accumulators. They help optimize memory by allocating a single memory space, reducing overhead involved by multiple reassignments .

Encapsulation in Java restricts access to certain components of an object, thereby protecting its internal state from unauthorized access and modification. By using private fields and providing public getter and setter methods, encapsulation ensures that data can only be modified in controlled ways, thus securing sensitive data and reducing the possibility of unintended interference from other parts of the program .

Normalization in database management involves organizing data to reduce redundancy and improve data integrity. By structuring tables using normal forms, redundant data storage is minimized, leading to reduced data anomalies and more efficient updates. It enhances data consistency and integrity, ensuring that dependencies make logical sense and improving scalability and maintainability of the database system .

You might also like