Trainee Programmer
Trainee Programmer Interview Questions and Answers for Freshers
Q1. what is polymorphism in Object-Oriented Programming?
Polymorphism is the ability of an object to take on many forms.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
It enables methods to be defined in the superclass and overridden in the subclasses.
Polymorphism helps in achieving code reusability and flexibility in object-oriented programming.
Example: A superclass 'Animal' with subclasses 'Dog' and 'Cat'. Both 'Dog' and 'Cat' can be treated as 'Animal'.
Q2. Rate yourself in 5 different programming languages on a 1-10 scale, 10 being the best.
I rate myself differently in different languages based on my experience and proficiency.
Java - 8: I have worked on multiple projects using Java and have a good understanding of its concepts.
Python - 7: I have used Python for scripting and automation tasks and have a decent understanding of its libraries.
C++ - 6: I have basic knowledge of C++ and have implemented some algorithms using it.
JavaScript - 8: I have worked on web development projects using JavaScript and its framewo...read more
Q3. Write a program using any language of your choice (It was a palindrome-based program.)
A program to check if a given string is a palindrome or not.
Take input string from user
Reverse the string
Compare the reversed string with the original string
If both are same, then the string is a palindrome
Else, the string is not a palindrome
Q4. What is API?
API stands for Application Programming Interface. It is a set of protocols, routines, and tools for building software applications.
API allows different software applications to communicate with each other
It defines how software components should interact
APIs can be public or private
Examples of APIs include Google Maps API, Twitter API, and Facebook API
Q5. What is encapsulation?
Encapsulation is the process of hiding implementation details and restricting access to an object's properties and methods.
Encapsulation helps in achieving data abstraction and information hiding.
It prevents unauthorized access to an object's internal state.
It allows for better control over the object's behavior.
Example: A bank account class with private variables for balance and account number.
Example: A car class with private variables for speed and engine temperature.
Q6. What is pointer What is inheritance?
A pointer is a variable that stores the memory address of another variable. Inheritance is a mechanism in object-oriented programming where a new class inherits properties and behaviors from an existing class.
Pointer is used to store memory address of a variable
Pointer can be dereferenced to access the value stored at that memory address
Example: int *ptr; ptr = # *ptr = 10; // num now has value 10
Inheritance allows a new class to inherit properties and behaviors from an exist...read more
Share interview questions and help millions of jobseekers 🌟
Q7. Any programming language Data types
Programming languages have various data types such as integers, floats, strings, and booleans.
Data types define the type of data that can be stored in a variable.
Common data types include integers, floats, strings, and booleans.
Some programming languages also have more complex data types like arrays, structures, and classes.
Data types can affect the performance and memory usage of a program.
Examples of data types in different programming languages: int in C++, float in Python...read more
Q8. Create table syntax in DBMS
Creating a table in a DBMS
Use CREATE TABLE statement
Specify table name and column names with data types
Add constraints like primary key, foreign key, etc.
Example: CREATE TABLE employees (id INT PRIMARY KEY, name VARCHAR(50), age INT)
Execute the statement to create the table
Trainee Programmer Jobs
Q9. Java is fully oops concept?
Java is a fully object-oriented programming language.
Java supports all four pillars of OOP: encapsulation, inheritance, polymorphism, and abstraction.
Classes and objects are fundamental concepts in Java.
Java allows for the creation of user-defined classes and objects.
Inheritance enables code reusability in Java.
Polymorphism allows objects to be treated as instances of their parent class.
Abstraction allows for hiding implementation details and showing only necessary features t...read more
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