Programmer Analyst Trainee

200+ Programmer Analyst Trainee Interview Questions and Answers

Updated 12 Jul 2025

Asked in Cognizant

2w ago

Q. What are some features of Java?

Ans.

Java is a popular programming language known for its platform independence and object-oriented features.

  • Java is platform independent, meaning it can run on any platform with a Java Virtual Machine (JVM)

  • Java is object-oriented, allowing for encapsulation, inheritance, and polymorphism

  • Java has automatic memory management through garbage collection

  • Java has a rich set of APIs and libraries for various tasks, such as networking and GUI development

  • Java supports multithreading, allo...read more

Asked in Cognizant

5d ago

Q. Write a query to select a row from any given table.

Ans.

Query to select a row from any table

  • Use SELECT statement with WHERE clause to specify the row to be selected

  • Specify the table name and column names in the SELECT statement

  • Use appropriate conditions in the WHERE clause to filter the rows

  • Example: SELECT * FROM table_name WHERE column_name = value;

Asked in Cognizant

2w ago

Q. Can you write code in C language?

Ans.

Here is a simple example of a C program that prints 'Hello, World!'

  • Declare a main function

  • Use the printf function to print 'Hello, World!'

  • Return 0 to indicate successful execution

Asked in Cognizant

1w ago

Q. What is an object?can you explain with an example?

Ans.

An object is an instance of a class that encapsulates data and behavior.

  • Objects have attributes (data) and methods (behavior).

  • Objects can interact with each other through method calls.

  • Example: A car object has attributes like color, make, and model, and methods like start and stop.

  • Objects promote code reusability and modularity.

Are these interview questions helpful?

Asked in Cognizant

1w ago

Q. Is the given SQL query true or false? (The query was based on the difference between primary key and foreign key)

Ans.

Primary keys uniquely identify records, while foreign keys establish relationships between tables.

  • A primary key cannot contain NULL values, ensuring each record is unique.

  • A foreign key can contain NULL values and refers to a primary key in another table.

  • Example: In a 'Students' table, 'StudentID' can be a primary key. In a 'Courses' table, 'StudentID' can be a foreign key.

Asked in Cognizant

4d ago

Q. What is a latch-up in communications?

Ans.

Latch-up is a phenomenon in which a circuit becomes stuck in a high-current state.

  • It occurs when a parasitic thyristor is inadvertently created within a circuit

  • It can cause permanent damage to the circuit

  • It can be prevented by using proper design techniques and layout

  • Example: A latch-up can occur in a microcontroller when a voltage spike causes the input to exceed the maximum rating

Asked in TCS

2d ago

Q. What is encapsulation?

Ans.

Encapsulation is the process of hiding implementation details and providing a public interface for accessing the functionality.

  • Encapsulation helps in achieving data abstraction and information hiding

  • It prevents unauthorized access to the internal details of an object

  • It allows for better control over the data and its behavior

  • Example: A bank account class may have private variables for account number and balance, but provide public methods for deposit and withdrawal

  • Example: A c...read more

Asked in Cognizant

1w ago

Q. Explain how you have applied Object-Oriented Programming (OOP) principles in real-world scenarios, providing detailed explanations and Java code examples.

Ans.

OOP concepts can be seen in real life through objects, classes, inheritance, and polymorphism, enhancing code organization and reusability.

  • 1. Classes and Objects: A class is like a blueprint (e.g., Car class) and an object is an instance (e.g., myCar).

  • 2. Inheritance: A subclass (e.g., ElectricCar) inherits properties from a superclass (e.g., Car), promoting code reuse.

  • 3. Polymorphism: A method can perform different tasks based on the object (e.g., start() method in Car and El...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Cognizant

1w ago

Q. Explain the code for calculating the sum of digits using recursion, including the expected output for the input 101 (output: 2).

Ans.

This code recursively calculates the sum of digits in a given integer input.

  • Recursion is a method where the function calls itself to solve smaller instances of the problem.

  • Base case: If the number is 0, return 0.

  • Recursive case: Add the last digit (n % 10) to the sum of the digits of the remaining number (n / 10).

  • Example: For input 101, the function computes 1 + 0 + 1 = 2.

Asked in Cognizant

3d ago

Q. What are OOPS concepts, and can you explain them with a real-time example?

Ans.

OOPs stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects.

  • OOPs is based on the concept of classes and objects.

  • It focuses on encapsulation, inheritance, and polymorphism.

  • Real-time examples of OOPs include a car, a bank account, and a smartphone.

  • In a car, the engine, wheels, and other components are objects, and the car itself is a class.

  • In a bank account, the account holder's name, account number, and balance are objects, and the...read more

Asked in Cognizant

3d ago

Q. Which OOP language would you choose to solve coding questions?

Ans.

I would choose Java as it is a widely used OOP language with a vast community and resources.

  • Java has a strong OOP concept with features like inheritance, polymorphism, and encapsulation.

  • It has a vast collection of libraries and frameworks that make coding easier and faster.

  • Java is platform-independent, making it easy to run on any system.

  • It has a large community and resources available for support and learning.

  • Other popular OOP languages include Python, C++, and C#.

Asked in Cognizant

2w ago

Q. What are the differences between public, private, and hybrid cloud computing?

Ans.

Public, private, and hybrid clouds differ in ownership, accessibility, and deployment models, catering to various business needs.

  • Public Cloud: Services offered over the internet, accessible to anyone (e.g., AWS, Google Cloud).

  • Private Cloud: Exclusive cloud infrastructure for a single organization, enhancing security and control (e.g., VMware, OpenStack).

  • Hybrid Cloud: Combines public and private clouds, allowing data and applications to be shared between them (e.g., Azure Stac...read more

Asked in Transsion

2w ago

Q. What is a circular linked list?

Ans.

A circular linked list is a linked list where the last node points to the first node, forming a loop.

  • Each node has a pointer to the next node and the last node points to the first node

  • Traversal can start from any node and continue until the starting node is reached again

  • Used in applications where data needs to be accessed in a circular manner, such as a playlist

Asked in Cognizant

2w ago

Q. What is Inheritance? Can you provide some sample code demonstrating it?

Ans.

Inheritance is a mechanism in OOP where a new class is derived from an existing class.

  • It allows the new class to inherit the properties and methods of the existing class.

  • The existing class is called the parent class or superclass, and the new class is called the child class or subclass.

  • The child class can add new properties and methods or override the existing ones.

  • Example: class Car extends Vehicle { ... }

  • Example: class SportsCar extends Car { ... }

Asked in Cognizant

1w ago

Q. Give some examples where mechanical engineering and IT can work together.

Ans.

Mechanical engineering and IT can work together in various fields.

  • Designing and simulating mechanical systems using computer-aided design (CAD) software

  • Developing and implementing control systems for mechanical devices using programming languages

  • Using sensors and data analysis to optimize mechanical systems

  • Creating virtual reality simulations for training and testing mechanical systems

  • Developing software for 3D printing and additive manufacturing

  • Integrating IT systems with ma...read more

Asked in Cognizant

2w ago

Q. What are the main features of object-oriented programming?

Ans.

Object oriented programming features include encapsulation, inheritance, and polymorphism.

  • Encapsulation: bundling of data and methods that operate on that data within a single unit

  • Inheritance: ability of a class to inherit properties and methods from a parent class

  • Polymorphism: ability of objects to take on multiple forms or behaviors depending on the context

  • Example: Java, C++, Python

Asked in Cognizant

1w ago

Q. What is the difference between primary and secondary winding?

Ans.

Primary winding is the input coil while secondary winding is the output coil in a transformer.

  • Primary winding is connected to the input voltage source

  • Secondary winding is connected to the load

  • Primary winding has fewer turns than secondary winding

  • Secondary winding has higher voltage than primary winding

Asked in Cognizant

1d ago

Q. Explain the logic behind push and pop operations in a stack data structure.

Ans.

Push adds an element to the top of the stack and pop removes the top element from the stack.

  • Push increases the stack size by 1 and places the new element at the top.

  • Pop removes the top element and decreases the stack size by 1.

  • Stack follows LIFO (Last In First Out) principle.

Asked in Cognizant

6d ago

Q. What are the key differences between Java and C++?

Ans.

Java is a high-level, object-oriented programming language, while C++ is a low-level, general-purpose programming language.

  • Java is platform-independent, while C++ is platform-dependent.

  • Java has automatic memory management (garbage collection), while C++ requires manual memory management.

  • Java supports multithreading and exception handling by default, while C++ requires explicit implementation.

  • Java has a simpler syntax and is easier to learn, while C++ offers more control and p...read more

Asked in Cognizant

2w ago

Q. What is a Repeater in Communications?

Ans.

A repeater is a device that receives a signal and retransmits it at a higher power or to an extended range.

  • Repeater is used to extend the range of a signal in communication.

  • It receives a signal and amplifies it before retransmitting it.

  • It can be used in radio, television, and telephone communication.

  • Example: Wi-Fi range extenders act as repeaters to boost the signal strength and extend the coverage area.

Asked in Cognizant

2w ago

Q. What are OOPs concepts, and can you briefly explain them?

Ans.

Object-oriented programming concepts including encapsulation, inheritance, polymorphism, and abstraction.

  • Encapsulation: bundling data and methods that operate on the data into a single unit (class)

  • Inheritance: ability of a class to inherit properties and behavior from another class

  • Polymorphism: ability to present the same interface for different data types

  • Abstraction: hiding the complex implementation details and showing only the necessary features

Asked in Qedtek

2w ago

Q. What is HTML and how does it differ from a programming language?

Ans.

HTML is a markup language used for creating web pages, while programming languages are used for creating software applications.

  • HTML stands for HyperText Markup Language

  • HTML is used to create the structure and content of a web page

  • Programming languages like Java, Python, and C++ are used to create software applications

  • HTML uses tags to define elements on a web page, while programming languages use syntax to write code

Asked in Cognizant

1w ago

Q. Are you willing to work in Testing, even though you have a strong coding background?

Ans.

Yes, I am open to working in Testing despite having a strong coding background.

  • I believe that having experience in testing will make me a more well-rounded programmer.

  • Working in testing will help me understand the software development process from a different perspective.

  • I am open to learning new skills and gaining experience in different areas of software development.

Asked in Cognizant

1d ago

Q. What is normalisation in SQL, write a SQL query to select contents from a table.

Ans.

Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.

  • Normalization involves breaking down a table into smaller tables and defining relationships between them.

  • There are different levels of normalization, with each level having specific rules to follow.

  • A SQL query to select contents from a table would be: SELECT * FROM table_name;

  • Normalization helps to prevent data inconsistencies and anomalies.

  • Normalization can improve d...read more

Asked in Cognizant

2w ago

Q. Explain the 'Hello, World!' program in detail, including the purpose and importance of 'public static'.

Ans.

public static is used in Java to define a method that can be called without creating an instance of the class.

  • public static is used in Java to define a method that belongs to the class itself, rather than to any specific instance of the class.

  • public static methods can be called directly using the class name, without needing to create an object of the class.

  • In the 'Hello World' program, public static is used to define the main method, which is the entry point of the program.

  • Us...read more

Asked in Cognizant

2w ago

Q. What do you mean by TCP/IP?

Ans.

TCP/IP stands for Transmission Control Protocol/Internet Protocol. It is a set of protocols that allows computers to communicate over the internet.

  • TCP/IP is a suite of communication protocols used for transmitting data over networks.

  • It provides reliable, connection-oriented communication between devices.

  • TCP is responsible for breaking data into packets, ensuring they are delivered in order and error-free.

  • IP handles the addressing and routing of packets across the internet.

  • Exa...read more

Asked in Cognizant

6d ago

Q. What is bst? What is different typr of binary tree?

Ans.

BST stands for Binary Search Tree. It is a type of binary tree used for searching and sorting operations.

  • BST is a binary tree where each node has at most two children.

  • In a BST, the left subtree of a node contains only nodes with keys lesser than the node's key, and the right subtree contains only nodes with keys greater than the node's key.

  • Some examples of BST are AVL tree, Red-Black tree, and Splay tree.

Asked in TCS

2w ago

Q. Write code to print the following pattern: **** *** ** *

Ans.

Code block to print decreasing number of stars line by line

  • Use a loop to iterate from 4 to 1

  • Inside the loop, print the number of stars based on the current iteration

  • Use string concatenation to print the stars on the same line

Asked in Excellanto

6d ago

Q. What is OOPS in C# and can you explain its principles in detail?

Ans.

Object-oriented programming in C# involves concepts like classes, objects, inheritance, encapsulation, and polymorphism.

  • Classes: Blueprint for creating objects, containing data members and methods.

  • Objects: Instances of classes, representing real-world entities.

  • Inheritance: Ability to create new classes based on existing ones, inheriting their attributes and behaviors.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit.

  • Polymorphism: Ability to ...read more

Asked in Infosys

1w ago

Q. What is artificial intelligence?

Ans.

Artificial intelligence is the simulation of human intelligence processes by machines, especially computer systems.

  • AI involves machines learning from data, recognizing patterns, and making decisions.

  • Examples include virtual assistants like Siri, self-driving cars, and recommendation systems like Netflix.

  • AI can be categorized into narrow AI (specific tasks) and general AI (human-like intelligence).

Previous
1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Wipro Logo
3.7
 • 6.1k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
HCLTech Logo
3.5
 • 4.1k Interviews
View all

Top Interview Questions for Programmer Analyst Trainee Related Skills

interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Programmer Analyst Trainee 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