Trainee Programmer

Trainee Programmer Interview Questions and Answers for Freshers

Updated 6 Jul 2025

Asked in Cognizant

3d ago

Q. What is polymorphism in Object-Oriented Programming?

Ans.

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'.

Asked in Cognizant

2d ago

Q. Rate your proficiency in 5 different programming languages on a scale of 1 to 10, with 10 being the highest.

Ans.

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

Asked in Cognizant

5d ago

Q. Write a program to check if a given string is a palindrome using the programming language of your choice.

Ans.

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

Asked in TCS

5d ago

Q. What is an API?

Ans.

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

Are these interview questions helpful?

Asked in TCS

4d ago

Q. What is encapsulation?

Ans.

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.

Asked in Cognizant

6d ago

Q. What is pointer What is inheritance?

Ans.

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

Trainee Programmer Jobs

Rifluxyss Softwares Private Limited logo
Trainee programmers 0-1 years
Rifluxyss Softwares Private Limited
3.4
Chennai
Wildgrube Software Private Limited logo
Trainee Programmer Web 0-1 years
Wildgrube Software Private Limited
3.9
Hyderabad / Secunderabad
Wildgrube Software Private Limited logo
Trainee Programmer Delphi 0-2 years
Wildgrube Software Private Limited
3.9
Hyderabad / Secunderabad

Asked in Cognizant

4d ago

Q. Any programming language Data types

Ans.

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

Asked in Cognizant

1d ago

Q. What is the syntax for creating a table in DBMS?

Ans.

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

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Cognizant

5d ago

Q. Is Java a fully object-oriented programming language?

Ans.

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

TCS Logo
3.6
 • 11.1k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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

Trainee Programmer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits