Program Analyst Trainee
10+ Program Analyst Trainee Interview Questions and Answers

Asked in Cognizant

Q. A frog is stuck in a 100m deep well. Each jump takes it 2m high, but it falls down 1m. How many jumps are required for the frog to escape the well?
The frog will require 98 jumps to get out of the well.
The frog jumps 2m high but falls down 1m, so it covers a net distance of 1m with each jump.
To calculate the number of jumps, we need to subtract the initial jump of 2m from the total depth of the well (100m).
The remaining distance to cover is 100m - 2m = 98m.
Since the frog covers 1m with each jump, it will require 98 jumps to cover the remaining distance and reach the top of the well.

Asked in TCS

Q. What programming languages do you know?
I know several programming languages including Java, Python, and C++.
Proficient in Java, Python, and C++
Familiar with HTML, CSS, and JavaScript
Experience with SQL and database management
Knowledge of object-oriented programming principles
Comfortable with version control systems like Git
Program Analyst Trainee Interview Questions and Answers for Freshers

Asked in Cognizant

Q. Explain the concepts of OOPs and relate them to real-life examples.
OOPs is a programming concept that relates real-life objects to classes and objects in code.
Classes represent real-life objects and their properties and behaviors
Objects are instances of classes and can interact with each other
Inheritance allows for the creation of new classes based on existing ones
Polymorphism allows for the same method to be used for different objects
Encapsulation hides the complexity of the code from the user

Asked in Cognizant

Q. Write a SQL query to find the 3rd highest salary.
SQL query to find 3rd maximum salary.
Use the ORDER BY clause to sort the salaries in descending order.
Use the LIMIT clause to limit the result to the third row.
Use a subquery to exclude the top two salaries and select the third highest salary.

Asked in TCS

Q. Write a program to check if a string is a palindrome.
Program to check if a given string is a palindrome or not.
Remove all non-alphanumeric characters from the string
Convert the string to lowercase
Reverse the string and compare with the original string
If both are equal, then the string is a palindrome

Asked in Infosys

Q. What technologies are you familiar with?
I am proficient in Java, Python, SQL, and have experience with HTML/CSS and JavaScript.
Java
Python
SQL
HTML/CSS
JavaScript

Asked in TCS

Q. What is Polymorphism?
Polymorphism is the ability of an object to take on many forms.
Polymorphism allows objects of different classes to be treated as if they are of the same class.
It is achieved through method overriding and method overloading.
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.

Asked in Cognizant

Q. What are the differences between DBMS and RDBMS? Please provide examples.
DBMS manages data in files while RDBMS manages data in tables with relations.
DBMS stands for Database Management System while RDBMS stands for Relational Database Management System.
DBMS manages data in files while RDBMS manages data in tables with relations.
DBMS does not support client-server architecture while RDBMS supports client-server architecture.
DBMS does not enforce any constraints while RDBMS enforces constraints like primary key, foreign key, etc.
Examples of DBMS ar...read more
Share interview questions and help millions of jobseekers 🌟

Asked in TCS

Q. What is the difference between a class and an interface?
Class is a blueprint for objects while interface defines a contract for classes to implement.
A class can have attributes and methods while an interface only has method signatures.
A class can be instantiated while an interface cannot.
A class can only inherit from one class while it can implement multiple interfaces.
Example: Class - Car, Interface - Drivable
Car can have attributes like color, model, etc. while Drivable only has method signature for drive().

Asked in Cognizant

Q. How does an OS work? Can you provide an example?
OS manages hardware and software resources to provide a user-friendly interface for running applications.
OS communicates with hardware components to manage resources like memory, CPU, and storage.
It provides a user interface for running applications and manages input/output operations.
Examples of OS include Windows, macOS, and Linux.
OS also manages security and permissions for users and applications.

Asked in TCS

Q. What is abstraction?
Abstraction is the process of hiding complex implementation details and showing only the necessary information to the user.
Abstraction is a fundamental concept in object-oriented programming.
It helps in reducing complexity and increasing efficiency.
Abstraction can be achieved through abstract classes and interfaces.
For example, a car dashboard is an abstraction of the car's internal workings.
Another example is a TV remote, which abstracts the complex functions of the TV into ...read more

Asked in Cognizant

Q. What is the difference between StringBuffer and StringBuilder?
String buffer is synchronized and thread-safe, while string builder is not synchronized and faster.
String buffer is synchronized, making it thread-safe for use in multi-threaded environments.
String builder is not synchronized, resulting in faster performance but not thread-safe.
String builder is preferred for single-threaded operations, while string buffer is preferred for multi-threaded operations.

Asked in Birlasoft

Q. What are the different types of Operating Systems?
OS stands for Operating System. There are different types of OS available.
Windows OS - developed by Microsoft
Mac OS - developed by Apple
Linux OS - open-source and free
Unix OS - used in servers and mainframes
Android OS - developed by Google for mobile devices

Asked in Cognizant

Q. What is the difference between an array and a class?
Arrays are a collection of similar data types while classes are a blueprint for creating objects.
Arrays store data in a contiguous memory location while classes store data in separate memory locations.
Arrays can be accessed using an index while classes can be accessed using object references.
Arrays are used for storing and manipulating data while classes are used for creating objects with properties and methods.

Asked in Cognizant

Q. Difference between Array, Class
Arrays are a collection of similar data types while classes are a blueprint for creating objects.
Arrays store data in a contiguous memory location while classes define properties and methods for objects.
Arrays can be accessed using an index while classes can be instantiated to create objects.
Arrays are used for storing and manipulating data while classes are used for creating objects with specific behaviors.
Example of an array: int[] numbers = {1, 2, 3};
Example of a class: pu...read more

Asked in Cognizant

Q. How do you compare strings?
Strings can be compared using built-in functions like strcmp in C or equals() in Java.
Use strcmp function in C to compare two strings
In Java, use equals() method to compare two strings
Consider case sensitivity when comparing strings
Use built-in functions to handle special characters and whitespace

Asked in TCS

Q. Write code to generate the Fibonacci sequence.
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, starting from 0 and 1.
Definition: The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones.
Example: The sequence begins as 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
Recursive Approach: A common method to compute Fibonacci numbers is through recursion, but it can be inefficient for large indices.
Iterative Approach: An iterative meth...read more

Asked in Cognizant

Q. How would you find spaces in a given string?
Identify and count spaces in a given string using programming techniques.
Use a loop to iterate through each character in the string.
Check if the character is a space using a condition like 'char == ' '.
Count the spaces using a counter variable.
Example: For the string 'Hello World', the count of spaces is 1.

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

