C Interview Question Answers

  1. Why We Use C Programming Language? Importance of C Language.
  2. What is the difference between C and C++?
  3. Why array index in C starts with 0?
  4. What is the use of conditional inclusion statements in C?
  5. What are the differences between break and continue statements in C language?
  6. What are the differences between break and exit() in C?
  7. What is the difference between for and while loop?
  8. What are the differences between static and dynamic (shared) library linking?
  9. What is the difference between structure and union in C?
  10. What are the differences and similarities between malloc and calloc in C?
  11. What is the difference between stack and heap memory segments?
  12. What is the difference between actual and formal arguments in C?
  13. What is the difference between call by value and call by reference in C language?
  14. How to compare and typecast function pointers in C?
  15. How to implement your own sizeof operator in C?

C PROGRAMS
  1. Write a C program to check if two integers have opposite or same signs using bitwise operators
  2. Write a C program to check if the underlying architecture is little endian or big endian.
  3. Write a C function to check if a given integer is odd or even using bitwise operators.
  4. Write a C program to count number of set bits in an integer.
  5. Write a C program to check if a positive integer is palindrome or not.
  6. Write a C program to swap two numbers using bitwise XOR operator and without using third temp variable.

Java Interview Question Answers

  1. What are the main differences between Java and C++?
  2. What are the various components of JDK (Java Development Kit) environment?
  3. What are Java source file declaration rules?
  4. What is Java Bytecode (.class file)?
  5. Why is main method public static and void in Java? Will the program compile, if the main method is not static?
  6. Which Java packages are imported by default?
  7. What are Java array literals? How to Use Array Literals in Java?
  8. What are the differences between finalize method, finally block, and final keyword in Java?
  9. What is the use of finally block in exception handling in Java?
  10. What are the uses of final keyword in Java?
  11. String intern() method in Java. Why we use it?
  12. System.out.println() in Java. How does it work?
  13. How to create immutable class in Java? Why immutable class should be marked final? What are the advantages and disadvantages of immutable classes?
  14. What are the differences between abstract class and interface in Java?
  15. How to Override equals() Method in Java?
  16. What is the use of instanceof or type comparison operator in Java?
  17. What is the difference between instanceof operator and isInstance() method in Java?
  18. What is JIT (Just-In-Time) Compiler in Java? Explain JIT Compilation.
  19. What is abstract interface in Java?
  20. Does Java support multi-dimensional arrays?
  21. What are the differences between thread and process in Java?
  22. How to find the size of a primitive data type in Java?
  23. What is the difference between path and classpath in Java?
  24. Is Java platform independent? Why and How?
  25. Difference between public static void main and static public void main in Java?
  26. Which are four access modifiers in Java?
  27. How to Prevent Method Overriding In Java Inheritance?
  28. Explain OOP Concepts With Real Time Examples.
  29. Difference Between Constructor and Method in Java.
  30. Can We Override Static Method in Java?
  31. Can We Override Overloaded Method in Java?
  32. Can We Override Private Method in Java?
  33. Can We Make Constructor Static in Java?
  34. Can We Run Java Program Without Main Method?
  35. Can We Make Constructor Final in Java?
  36. Can You Use Abstract and Final Both With A Method In Java?
  37. Can We Declare an Interface Final in Java?
  38. Difference Between Static and Dynamic Class Loading in Java
  39. Which is the Base Class of all Exceptions in Java?
  40. Can We Declare Main() Method Final in Java?
  41. Why Java Doesn't Support Multiple Inheritance?
  42. What is the execution order of blocks, static blocks, constructors, and methods in Java?
  43. What is marker interface in Java?
  44. How to create user defined or custom exception class in Java?
  45. Can we run abstract class in Java that has main method?
  46. When does finally block not execute in Java?
  47. Difference Between Error and Exception in Java. Error vs Exception
  48. Difference between throw and throws in Java
  49. Difference between Checked and Unchecked Exceptions in Java
  50. What is Exception Propagation in Java? Explain.
  51. Difference between Set and List in Java
  52. What is Unmodifiable Collection in java?
  53. What is UnSupportedOperationException in Java?
  54. Difference between peek poll and remove method of the Queue interface in Java?
  55. Difference between ArrayList and Vector in Java
  56. Difference between HashMap and HashTable in Java
  57. Difference between Iterator And Enumeration in Java
  58. Difference between Iterator and ListIterator in Java
  59. Difference between Fail Fast and Fail Safe iterator in Java
  60. How fail fast iterator comes to know that the internal structure is modified?
  61. Difference between HashSet and TreeSet in Java
  62. Difference between HashMap and ConcurrentHashMap in Java

DSA Interview Question Answers

  1. What is Data Structure? Define Data Structure.
  2. What is an Algorithm in Data Structures?
  3. What is Big O Notation and Asymptotic Analysis of Algorithms?
  4. Write Java and C programs to implement prefixes averages algorithm.
  5. Write a C program to reverse the order of words in a string?
  6. Write a C program to insert an element in linear array
  7. Write a C program to search an element in array using linear search
  8. Write a C program to Find Max in Array Using Recursion
  9. Write a C program to find the duplicate element in an array?
  10. Write a C program to perform binary search on two dimensional (2D) array.
  11. Write C and Java programs to find the largest element in an array using recursion.
  12. Write C and Java programs to implement recursive binary search on a sorted array.

C Programming Tutorials

  1. History of C Programming Language
  2. Compile & Run C Program in Linux Using GCC
  3. Static and Dynamic (Shared) Link Libraries in C
  4. Understanding Little and Big Endian Architecture
  5. Arrays and Pointers in C
  6. Types of Recursion in C
  7. Memory Layout of C Program - Code and Data Segments
  8. Function Pointers in C
  9. Storage Classes in C and Storage Class Specifiers
  10. Structure Member Alignment and Padding in C

Java Programming Tutorials

  1. How to Compile and Run Java Program in Linux
  2. Understanding The Difference Between JDK, JRE, JVM, and JIT
  3. Java Primitive Data Types
  4. Literals in Java
  5. Variables and Fields in Java
  6. Java Operators: Precedence and Associativity
  7. Java Arithmetic Operators
  8. Java Increment Decrement Operators
  9. Java Bitwise Operators
  10. Java Relational Operators
  11. Java Logical Operators
  12. Java Assignment Operators
  13. Java Miscellaneous Operators
  14. Java Control Flow Statements: IF-Else
  15. Java Control Flow Statements: Switch Case Default and Break
  16. Java Iterative Statements: do, while and for Loops
  17. Method Overloading In Java
  18. Types of Comments in Java - Single Line, Multi-line and Javadoc
  19. Java Arrays - Declare, Initialize, and Use
  20. Java Array Cloning, Shallow and Deep Copy
  21. Java Classes and Objects - Declaration, Constructors, Accessors, and Mutators
  22. Java Static Keyword - Static Data Members, Fields, Variables. Static Methods and Blocks
  23. Java Method Parameters - Call by Value and Call by Reference
  24. Java Nested Classes - Use and Types of Nested Classes
  25. Java Static Nested Classes
  26. Java Nested or Inner Interfaces
  27. Java Inner Classes or Non-static Nested Classes
  28. Java Local Inner Classes or Method Local Inner Classes
  29. Java Anonymous Inner Classes
  30. Java Input Output - BufferedReader Class

Advanced Java Tutorials

  1. JDBC Connection to MySQL Database in Java
  2. Creating and Using Custom Java Annotations
  3. Introduction to Java Multi-threading and Concurrency
  4. Introduction to Design Patterns in Java
  5. Factory Method Design Pattern in Java

Data Structures Tutorials

  1. Introduction to Data Structures
  2. Linear Search Implementation in Java
  3. Binary Search Implementation in Java
  4. Bubble Sort Implementation in Java
  5. Selection Sort Implementation in Java
  6. Insertion Sort Implementation in Java
  7. Stack Implementation Using Array of Generics in Java
  8. Stack Implementation Using Linked List in Java
  9. Implement Queue Using Linked List in Java

Explore above IT interview questions and answers and programming tutorials on C, Java and Data Structures. Here you will find most important and frequently asked technical IT interview questions with well described answers. Hope freshers and experienced programmers will find this place a great resource for IT job preparation.


Share this page on WhatsApp

Get Free Tutorials by Email

About the Author

is the founder and main contributor for cs-fundamentals.com. He is a software professional (post graduated from BITS-Pilani) and loves writing technical articles on programming and data structures.