Programmer
10+ Programmer Interview Questions and Answers for Freshers
Q1. What is opps ?, Difference between java and python?
OOPs is Object Oriented Programming. Java and Python are both OOPs languages, but differ in syntax and usage.
Java is statically typed, while Python is dynamically typed
Java requires more verbose syntax, while Python is more concise
Java is better suited for large-scale enterprise applications, while Python is better for scripting and data analysis
Java has a stronger emphasis on performance, while Python prioritizes ease of use and readability
Both languages support inheritance,...read more
Q2. What is the Role of Database in Backend Development
Database is crucial for storing and managing data in backend development.
Database stores and organizes data for efficient retrieval and manipulation.
It allows for easy querying and filtering of data.
It enables data consistency and integrity through constraints and validations.
It facilitates data migration and backup.
Examples include MySQL, MongoDB, and PostgreSQL.
Q3. Is Java a compile time language or Interpreted language
Java is a compiled language that also uses interpretation at runtime.
Java code is compiled into bytecode which is then interpreted by the Java Virtual Machine (JVM) at runtime.
This allows Java to be platform-independent as the bytecode can be executed on any system with a JVM.
However, some modern JVMs also use just-in-time (JIT) compilation to improve performance.
JIT compilation compiles bytecode into native machine code at runtime, allowing for faster execution.
Overall, Java...read more
Q4. Programming - find the frequency of given character in a sorted string.
Use binary search to find the first and last occurrence of the character, then calculate the frequency.
Use binary search to find the first occurrence of the character in the string.
Use binary search to find the last occurrence of the character in the string.
Calculate the frequency by subtracting the indices of the last and first occurrences and adding 1.
Q5. What is meant by implements keyword in java
The 'implements' keyword is used to indicate that a class is implementing an interface.
The 'implements' keyword is followed by the name of the interface that the class is implementing.
A class can implement multiple interfaces by separating them with commas.
All methods declared in an interface must be implemented by the class that implements it.
Example: 'public class MyClass implements MyInterface { ... }'
Q6. OOPs concepts, and their pillars. Design a Vehicle class, by understanding the requirements
OOPs concepts and pillars. Design a Vehicle class based on requirements.
OOPs concepts: Abstraction, Encapsulation, Inheritance, Polymorphism
Vehicle class requirements: attributes like make, model, year, methods like start, stop, accelerate
Share interview questions and help millions of jobseekers 🌟
Q7. What is difference between truncated and delete command
Truncate removes all data from a table while delete removes specific rows.
Truncate is faster than delete as it doesn't log individual row deletions
Truncate cannot be rolled back while delete can be
Truncate resets the identity of the table while delete doesn't
Truncate doesn't fire triggers while delete does
Truncate is a DDL command while delete is a DML command
Q8. What is the Friend function in C++?
Friend function in C++ is a non-member function that has access to the private and protected members of a class.
Declared inside the class but defined outside the class scope
Can access private and protected members of the class
Can be used to overload operators
Example: friend void display(A obj) { cout << obj.num; }
Example: class A { friend void display(A obj); };
Programmer Jobs
Q9. What is the basic of java
Java is a high-level programming language known for its platform independence and object-oriented approach.
Java is platform-independent, meaning it can run on any operating system
It is an object-oriented language, focusing on creating reusable code through classes and objects
Java uses a virtual machine (JVM) to execute code, providing portability and security
It has a rich set of libraries and frameworks for various purposes, such as JavaFX for GUI development
Java supports mul...read more
Q10. opps concepts , explain in detail
Object-oriented programming concepts focus on classes, objects, inheritance, encapsulation, and polymorphism.
Classes: Blueprint for creating objects with attributes and methods.
Objects: Instances of classes that contain data and behavior.
Inheritance: Ability for a class to inherit attributes and methods from another class.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Polymorphism: Ability for objects of different classes to respond to th...read more
Q11. what is list and dictionary
List and dictionary are data structures in programming.
List is an ordered collection of elements, accessed by index. Example: [1, 2, 3]
Dictionary is an unordered collection of key-value pairs. Example: {'name': 'John', 'age': 30}
Lists use square brackets [] while dictionaries use curly braces {}
Lists can contain duplicate values while dictionaries cannot have duplicate keys
Q12. What is the polymorphism
Polymorphism is the ability of an object to take on many forms.
It allows objects of different classes to be treated as if they were objects of the same class.
It is achieved through method overloading and method overriding.
Example: A shape class can have different subclasses like circle, square, and triangle, each with their own implementation of the draw method.
Polymorphism makes code more flexible and reusable.
Q13. 1 Oops concepts 3 What is interface
An interface is a blueprint of a class that defines a set of methods without implementation.
An interface can be implemented by multiple classes.
All methods in an interface are public and abstract by default.
Interfaces can also contain constants and default methods.
Example: interface Shape { void draw(); }
Example: interface Animal { void eat(); void sleep(); }
Q14. What is Continue?
Continue is a keyword in programming that is used to skip the current iteration of a loop and continue with the next iteration.
Continue is used in loops like for, while, and do-while to skip the current iteration and move to the next one.
It is often used to skip certain elements in an array or to avoid executing specific code under certain conditions.
Example: for(int i=0; i<5; i++) { if(i==2) { continue; } System.out.println(i); } This will print 0, 1, 3, 4.
Q15. array vs list in java
Arrays have fixed size, while lists can dynamically grow. Arrays are faster for random access, while lists are better for insertion/deletion.
Arrays have a fixed size, while lists can dynamically grow.
Arrays are faster for random access, while lists are better for insertion/deletion.
Example: String[] array = new String[5]; List
list = new ArrayList<>();
Q16. map vs hashset in java
Map is an interface that maps keys to values, while HashSet is a class that implements the Set interface using a hash table.
Map allows key-value pairs, while HashSet only allows unique elements
Map can have duplicate values but keys must be unique, HashSet does not allow duplicates
Map provides key-based access to elements, HashSet does not have a key-value pair structure
Interview Questions of Similar Designations
Top Interview Questions for Programmer Related Skills
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month