Trainee Programmer

50+ Trainee Programmer Interview Questions and Answers

Updated 2 Jul 2025
search-icon

Asked in Cognizant

1d ago

Q. Networking Questions like What is IP ADDRESS WHAT IS MAC ADDRESS WHAT IS BSOD WHAT IS ACTIVE DIRECTORY WHAT IS NODE WHAT IS LAN WAN MAN WHAT IS SQL WHAT ARE SUBGROUPS OF SQL WHAT IS DML ,DDL TCL DCL? WHAT IS DB...

read more
Ans.

Answers to common networking and database related questions for a Trainee Programmer interview.

  • IP ADDRESS - unique identifier for devices on a network

  • MAC ADDRESS - unique identifier for network interface controllers

  • BSOD - Blue Screen of Death, an error screen displayed on Windows systems

  • ACTIVE DIRECTORY - centralized database for managing network resources

  • NODE - a device or computer on a network

  • LAN WAN MAN - types of networks (Local Area Network, Wide Area Network, Metropolit...read more

Asked in Chain-Sys

6d ago

Q. What is PLSQL? what are the mail components in PLSQL explain their work with example?

Ans.

PLSQL is a procedural extension of SQL used in Oracle databases for writing stored procedures and functions.

  • Main components: variables, control structures, cursors, exceptions

  • Variables: used to store data within PLSQL programs

  • Control structures: used for conditional logic and looping

  • Cursors: used to process individual rows returned by SQL queries

  • Exceptions: used for error handling and custom error messages

Trainee Programmer Interview Questions and Answers for Freshers

illustration image

Asked in Cognizant

6d 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 Chain-Sys

6d ago

Q. What types of clauses are used in SQL, and what are their functions?

Ans.

Types of clauses in SQL include SELECT, WHERE, GROUP BY, HAVING, ORDER BY, JOIN, etc.

  • SELECT: Retrieves data from a database

  • WHERE: Filters records based on specified conditions

  • GROUP BY: Groups rows that have the same values into summary rows

  • HAVING: Filters groups based on specified conditions

  • ORDER BY: Sorts the result set in ascending or descending order

  • JOIN: Combines rows from two or more tables based on a related column

Are these interview questions helpful?
2d ago

Q. What rating would you give your programming knowledge out of 10?

Ans.

I would rate my programming knowledge as 7 out of 10.

  • I have a strong understanding of programming concepts and syntax.

  • I have experience with multiple programming languages such as Java, Python, and C++.

  • I am constantly learning and improving my skills through personal projects and online courses.

2d ago

Q. How would you find the second-largest element in an array if you are not allowed to sort the array or traverse the array more than once?

Ans.

Use two variables to keep track of the largest and second-largest elements while traversing the array once.

  • Initialize two variables to store the largest and second-largest elements.

  • Iterate through the array and update the variables accordingly.

  • Return the second-largest element once the iteration is complete.

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

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

1d ago

Q. What is a deadlock condition in multi-threading, and how can it be prevented?

Ans.

Deadlock in multithreading occurs when two or more threads are waiting for each other to release resources, causing them to be stuck indefinitely.

  • Deadlock can be prevented by using proper synchronization techniques like avoiding nested locks, using timeouts, and implementing a deadlock detection algorithm.

  • One common example of deadlock is the dining philosophers problem, where multiple philosophers are sitting at a table with chopsticks and can only eat if they have both chop...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
2d ago

Q. What are static data members and static member functions in C++?

Ans.

Static data members and member functions are shared by all objects of a class.

  • Static data members are declared with the static keyword and have a single copy shared by all objects of the class.

  • Static member functions are also declared with the static keyword and can be called without an object of the class.

  • Static data members can be used to maintain a common value across all objects of the class.

  • Static member functions can be used to perform operations that do not depend on t...read more

3d ago

Q. Where did you learn about programming languages?

Ans.

I learned about programming languages through various sources.

  • I took computer science courses in high school and college.

  • I read books and online tutorials on programming languages.

  • I practiced coding through personal projects and internships.

  • I attended coding bootcamps and workshops to learn new languages.

  • I learned from experienced programmers through mentorship and collaboration.

Asked in Cognizant

4d 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

2d ago

Q. Given two coordinates of a rectangle, how would you find the other two?

Ans.

To find the other two coordinates of a rectangle, we need to use the formula of opposite sides being equal.

  • Calculate the difference between the given coordinates to find the length and width of the rectangle

  • Add or subtract the length and width from the given coordinates to find the other two coordinates

  • Make sure to check if the rectangle is oriented horizontally or vertically

  • Example: Given coordinates (1,1) and (4,5), the length is 4-1=3 and the width is 5-1=4. The other two ...read more

4d ago

Q. How would you calculate the required speed for a basketball shot to reach the basket?

Ans.

The required speed for a basketball shoot to reach the basket can be calculated using the projectile motion formula.

  • Determine the distance between the shooter and the basket

  • Calculate the angle of release

  • Use the projectile motion formula to calculate the required speed

  • Adjust for air resistance and other factors if necessary

4d ago

Q. How can you make a C++ function blueprint callable in Unreal Engine?

Ans.

C++ function blueprint can be made callable in Unreal by creating a Blueprint Function Library.

  • Create a new Blueprint Function Library in Unreal

  • Add the C++ function to the library as a static function

  • Compile the C++ code and refresh the library in Unreal

  • The function can now be called from any Blueprint in the project

Q. Which programming languages do you know, and how would you rate your proficiency in each on a scale of 1 to 10?

Ans.

I am proficient in Java and Python, rating myself 8 out of 10 in both languages.

  • Proficient in Java and Python

  • Rate myself 8 out of 10 in both languages

  • Have experience in developing applications using Java and Python

Asked in Cognizant

4d ago

Q. Write a C program to find the maximum and minimum of given 3 numbers.

Ans.

Program to find maximum and minimum of 3 numbers in C

  • Use if-else statements to compare the numbers

  • Initialize variables to store maximum and minimum values

  • Consider using arrays to store the numbers for easier comparison

4d ago

Q. Explain the concept of inheritance and write a program demonstrating its use.

Ans.

Inheritance in programming allows a class to inherit properties and methods from another class, promoting code reuse.

  • Inheritance is a fundamental concept in Object-Oriented Programming (OOP).

  • It allows a new class (child) to inherit attributes and methods from an existing class (parent).

  • Example: A 'Dog' class can inherit from an 'Animal' class, gaining its properties like 'species' and methods like 'eat()'.

  • Types of inheritance include single, multiple, and hierarchical inherit...read more

3d ago

Q. What is a database management system?

Ans.

A database management system is a software that manages and organizes data in a database.

  • DBMS is used to create, modify, and delete data in a database.

  • It provides a way to store and retrieve data efficiently.

  • Examples of DBMS include MySQL, Oracle, and Microsoft SQL Server.

1d ago

Q. Explain the coding solutions you provided in the coding round, step by step.

Ans.

The candidate explained their coding solutions step by step, detailing logic and implementation.

  • 1. Understand the problem statement clearly before coding.

  • 2. Break down the problem into smaller, manageable parts.

  • 3. Write pseudocode to outline the logic before actual coding.

  • 4. Implement the solution in the chosen programming language.

  • 5. Test the code with various test cases to ensure accuracy.

  • 6. Optimize the code for performance and readability.

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

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 XimKart

3d ago

Q. What is your current location?

Ans.

Current location refers to the physical position of a person or object at a given moment.

  • Current location can be determined using GPS technology or by manually inputting the address.

  • It is often used in navigation apps, social media check-ins, and emergency services.

  • Examples of current location include '123 Main Street, Anytown, USA' or 'Latitude: 37.7749, Longitude: -122.4194'.

Asked in Cognizant

6d ago

Q. Why is C called a middle-level language?

Ans.

C is called middle level language because it combines features of both high-level and low-level languages.

  • C allows low-level manipulation like memory management and bit manipulation.

  • C also supports high-level features like functions, data structures, and dynamic memory allocation.

  • C is closer to the hardware compared to high-level languages like Java or Python, but not as close as low-level languages like assembly.

  • C provides a good balance between performance and flexibility.

3d ago

Q. What are primary and secondary goals?

Ans.

Primary goals are main objectives to be achieved, while secondary goals are additional objectives that support the primary goals.

  • Primary goals are the main objectives that an individual or organization aims to achieve.

  • Secondary goals are additional objectives that support the primary goals.

  • Primary goals are usually more critical and have higher priority than secondary goals.

  • Examples: Primary goal of a company may be to increase revenue, while a secondary goal may be to improv...read more

5d ago

Q. What are the ways to create a thread?

Ans.

Ways of creating threads include extending the Thread class, implementing the Runnable interface, and using Executor framework.

  • Extending the Thread class: Create a new class that extends the Thread class and override the run() method.

  • Implementing the Runnable interface: Create a class that implements the Runnable interface and implement the run() method.

  • Using Executor framework: Create a thread pool using Executor framework and submit tasks to it for execution.

Asked in Cognizant

5d ago

Q. Write a program to print a 3x3 matrix.

Ans.

Program to print a 3x3 matrix using nested loops.

  • Use nested loops to iterate through rows and columns of the matrix.

  • Initialize a 2D array with 3 rows and 3 columns to store the matrix elements.

  • Print the elements of the matrix using nested loops.

3d ago

Q. How do JDBC drivers work?

Ans.

JDBC (Java Database Connectivity) is a Java API that allows Java programs to interact with databases.

  • JDBC uses a driver manager to load the appropriate driver for the specific database being accessed.

  • It establishes a connection to the database using the DriverManager class.

  • SQL queries are executed using Statement, PreparedStatement, or CallableStatement objects.

  • ResultSets are used to retrieve data from the database.

  • Transactions can be managed using Connection objects.

6d ago

Q. What is oop? And its concepts

Ans.

OOP stands for Object-Oriented Programming, a programming paradigm based on the concept of objects.

  • OOP focuses on creating objects that contain data and methods to manipulate that data.

  • Key concepts include encapsulation, inheritance, and polymorphism.

  • Encapsulation involves bundling data and methods that operate on the data into a single unit.

  • Inheritance allows classes to inherit attributes and methods from other classes.

  • Polymorphism allows objects to be treated as instances o...read more

3d ago

Q. What is the difference between a while loop and a for loop?

Ans.

While loop is used when the number of iterations is not known beforehand, while for loop is used when the number of iterations is known.

  • While loop checks the condition before executing the block of code, while for loop initializes, checks condition, and increments/decrements in one line.

  • For loop is used when the number of iterations is known, while loop is used when the number of iterations is not known.

  • Example: while loop - while(i < 5) { //code } for loop - for(int i=0; i<5...read more

Asked in Cognizant

1d ago

Q. Tell me about functions in C.

Ans.

Functions in C are blocks of code that perform a specific task and can be called multiple times within a program.

  • Functions in C are defined using a return type, function name, parameters, and a body enclosed in curly braces.

  • Functions can be called multiple times within a program to perform the same task without rewriting the code.

  • Functions can return a value using the 'return' statement.

  • Functions can also be void, meaning they do not return a value.

  • Example: int add(int a, int...read more

1
2
Next

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