Programmer Analyst

400+ Programmer Analyst Interview Questions and Answers

Updated 15 Jul 2025

Asked in Cognizant

1w ago

Q. Given an array, write code to check which numbers are prime.

Ans.

Code to check prime numbers in an array

  • Iterate through each number in the array

  • For each number, check if it is divisible by any number from 2 to the square root of the number

  • If the number is only divisible by 1 and itself, it is a prime number

Asked in Cognizant

2w ago

Q. What are the differences between ViewBag, ViewData, and TempData in ASP.NET MVC?

Ans.

ViewBag, ViewData and TempData are used to pass data between controller and view in ASP.NET MVC.

  • ViewBag is a dynamic object used to pass data from controller to view.

  • ViewData is a dictionary object used to pass data from controller to view.

  • TempData is a dictionary object used to pass data from one controller action to another.

  • ViewBag and ViewData are short-lived and can only be used to pass data from controller to view.

  • TempData is used to pass data between controller actions ...read more

Asked in Cognizant

1w ago

Q. What is difference between procedurea and functions and how they work

Ans.

Procedures and functions are both subroutines in programming, but functions return a value while procedures do not.

  • Procedures are used to perform a specific task and do not return a value.

  • Functions are used to perform a specific task and return a value.

  • Procedures are called using the CALL statement, while functions are called by assigning their return value to a variable.

  • Functions can be used in expressions, while procedures cannot.

  • Functions can have parameters, while procedu...read more

Asked in TO THE NEW

3d ago

Q. Write an SQL query to find the second highest salary from an employee table.

Ans.

SQL query to find second highest salary

  • Use ORDER BY and LIMIT to get the highest salary

  • Use subquery to exclude the highest salary and get the second highest

Are these interview questions helpful?

Q. How do you ensure the quality and security of your code?

Ans.

I ensure code quality and security through best practices, code reviews, testing, and security measures.

  • Implement coding standards and best practices, such as using consistent naming conventions and modular design.

  • Conduct regular code reviews with peers to identify potential issues and improve code quality.

  • Utilize automated testing frameworks (e.g., JUnit for Java) to ensure functionality and catch bugs early.

  • Incorporate static code analysis tools (e.g., SonarQube) to detect ...read more

Asked in Boeing

1w ago

Q. What design patterns have you implemented in your project?

Ans.

I have implemented various design patterns such as Singleton, Factory, and Observer in my projects.

  • Implemented Singleton pattern to ensure only one instance of a class is created.

  • Utilized Factory pattern to create objects without specifying the exact class of object that will be created.

  • Used Observer pattern to define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

Programmer Analyst Jobs

Amazon Development Centre (India) Pvt. Ltd. logo
Manager II, Programmer Analyst • 5-10 years
Amazon Development Centre (India) Pvt. Ltd.
•
4.0
Hyderabad / Secunderabad
Wipro Limited logo
Analyst Programmer • 3-5 years
Wipro Limited
•
3.7
₹ 5 L/yr - ₹ 12 L/yr
(AmbitionBox estimate)
Gurgaon / Gurugram
Qualcomm india pvt ltd. logo
Programmer Analyst • 4-9 years
Qualcomm india pvt ltd.
•
3.8
Hyderabad / Secunderabad

Asked in Cognizant

2w ago

Q. What is the difference between a Primary key and a Unique key in SQL?

Ans.

Primary key uniquely identifies a record in a table, while Unique key ensures uniqueness of a column.

  • Primary key cannot have null values, while Unique key can have one null value.

  • A table can have only one Primary key, but multiple Unique keys.

  • Primary key is automatically indexed, while Unique key is not necessarily indexed.

Asked in Cognizant

2w ago

Q. What is the difference between a temporary table and a table variable in SQL Server?

Ans.

Temptable is a physical table created in tempdb while table variable is a variable created in memory.

  • Temptable is used for large data sets or complex queries

  • Table variable is used for small data sets or simple queries

  • Temptable can be indexed and have constraints while table variable cannot

  • Temptable can be accessed by multiple sessions while table variable is limited to the current session

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
6d ago

Q. Add a field in sale order form and pass the value to invoice and delivery order

Ans.

To add a field in sale order form and pass the value to invoice and delivery order, modify the code for all three forms.

  • Identify the code for sale order form, invoice form, and delivery order form

  • Add the new field in the sale order form code

  • Modify the invoice and delivery order form code to receive and display the new field value

  • Test the changes thoroughly before deploying

Q. 1. What is serialization? 2. What is a Singleton class? 3. Difference b/w interface and abstract class. And a few more basic java 8 questions.

Ans.

Serialization is the process of converting an object into a stream of bytes to store or transmit data.

  • Serialization is used to save the state of an object and recreate it when needed.

  • In Java, serialization is achieved by implementing the Serializable interface.

  • Example: ObjectOutputStream and ObjectInputStream classes are used for serialization in Java.

Asked in Cognizant

1w ago

Q. How do you implement arrays within a structure?

Ans.

Arrays in structures allow grouping of related data, enhancing organization and access in programming.

  • A structure can contain an array of strings to hold multiple values. Example: `struct Student { char names[10][50]; };`

  • You can access individual strings using the structure variable. Example: `strcpy(student.names[0], "Alice");`

  • Arrays in structures are useful for managing collections of data, like names, addresses, etc.

  • You can also define an array of structures. Example: `str...read more

Asked in Cognizant

3d ago

Q. Tell me some technologies that were used in IT industry

Ans.

Technologies used in IT industry include cloud computing, artificial intelligence, blockchain, and internet of things.

  • Cloud computing: AWS, Azure, Google Cloud

  • Artificial intelligence: Machine learning, natural language processing

  • Blockchain: Bitcoin, Ethereum

  • Internet of things: Smart homes, wearables

Q. Write a program to determine whether a number is a palindrome.

Ans.

Program to check if a number is a palindrome or not.

  • Convert the number to a string to easily check for palindrome

  • Reverse the string and compare it with the original string

  • If they are the same, the number is a palindrome

1w ago

Q. what are the oops concepts and how we use them?

Ans.

OOPs concepts are fundamental principles in object-oriented programming that help in organizing and designing code.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit (class). Example: Class Car with properties like make, model, and methods like start(), stop().

  • Inheritance: Ability of a class to inherit properties and behavior from another class. Example: Class SUV inheriting from Class Car.

  • Polymorphism: Ability to present the same interface f...read more

4d ago

Q. What is the difference between a motor and a generator?

Ans.

A motor converts electrical energy into mechanical energy, while a generator converts mechanical energy into electrical energy.

  • Motors use electrical energy to create motion, while generators use motion to create electrical energy.

  • Motors have a rotor and a stator, while generators have a stator and a rotor.

  • Examples of motors include electric fans, washing machines, and power tools, while examples of generators include wind turbines and hydroelectric dams.

Asked in ZettaLogix

1w ago

Q. How do you handle debugging a program that isn’t working?

Ans.

I systematically identify and resolve issues in code through structured debugging techniques.

  • Reproduce the issue: Ensure the problem can be consistently replicated.

  • Check error messages: Analyze any error messages or logs for clues.

  • Use debugging tools: Utilize tools like breakpoints and step-through debugging to inspect code execution.

  • Isolate the problem: Comment out sections of code to narrow down where the issue lies.

  • Review recent changes: Look at the most recent code change...read more

Asked in Cognizant

5d ago

Q. Libraries used in pythons and how do use it.

Ans.

Python has a vast collection of libraries for various purposes. Some popular ones are NumPy, Pandas, Matplotlib, and Scikit-learn.

  • NumPy is used for numerical computing and data analysis.

  • Pandas is used for data manipulation and analysis.

  • Matplotlib is used for data visualization.

  • Scikit-learn is used for machine learning and data mining.

  • To use a library, it must be imported at the beginning of the code using the 'import' statement.

  • For example, to use NumPy, we can write 'import ...read more

Asked in Cognizant

1w ago

Q. 1. If this a (showed an obj) and this is b, write a code to add both and get results

Ans.

Code to add two objects and get results

  • Use the + operator to add the values of the objects

  • Ensure that the objects have compatible data types for addition

  • Handle any potential errors or exceptions that may occur during the addition

Asked in Cognizant

2w ago

Q. What is the difference between SQL and SQL Server?

Ans.

SQL is a language used to manage databases, while SQL Server is a Microsoft product that includes a database management system.

  • SQL is a language used to interact with databases, while SQL Server is a Microsoft product that includes a database management system.

  • SQL can be used with various database management systems like MySQL, Oracle, etc., while SQL Server is specific to Microsoft.

  • SQL is a standard language for querying and managing databases, while SQL Server provides addi...read more

Asked in Cognizant

1w ago

Q. Explain how recursion works with an example.

Ans.

Recursion is a programming technique where a function calls itself to solve a problem.

  • Recursion involves breaking down a problem into smaller subproblems and calling the function recursively to solve them.

  • Each recursive call works on a smaller input until a base case is reached to stop the recursion.

  • Example: Factorial calculation, Fibonacci sequence, tree traversal.

Q. What are the ways of reading external data?

Ans.

There are several ways to read external data, such as using file input/output operations, database queries, web scraping, and API calls.

  • File input/output operations: Reading data from files stored on the local system or network.

  • Database queries: Retrieving data from databases using SQL or other query languages.

  • Web scraping: Extracting data from websites by parsing HTML or using web scraping libraries.

  • API calls: Fetching data from external systems or services through API endpo...read more

Asked in Cognizant

1d ago

Q. Write a simple program to find prime numbers in a series of numbers.

Ans.

To find prime numbers in a series, iterate through each number and check if it's divisible by any number other than 1 and itself.

  • Start iterating through the series of numbers

  • For each number, check if it's divisible by any number other than 1 and itself

  • If it's not divisible by any other number, it's a prime number

  • Keep track of all the prime numbers found

1w ago

Q. How do you handle interview and technical questions?

Ans.

Prepare thoroughly, practice responses, and stay calm to effectively handle interview and technical questions.

  • Research the company and role to tailor your answers. For example, know their projects and values.

  • Practice common interview questions and technical problems. Use platforms like LeetCode for coding questions.

  • Use the STAR method (Situation, Task, Action, Result) to structure your responses to behavioral questions.

  • Stay calm and take a moment to think before answering tec...read more

Asked in Cognizant

1w ago

Q. What is the output of the given recursive code?

Ans.

Output of a given recursive code

  • Understand the logic of the recursive function

  • Trace the function calls and their return values

  • Identify the base case and recursive case

  • Check for any errors or infinite loops

Asked in Amazon

1w ago

Q. Given an array of integers, find the indices of a pair that sums to a target value K.

Ans.

Given an array of integers, find the indices of a pair which sum results in K.

  • Iterate through the array and for each element, check if K minus the element exists in the array using a hash table.

  • If it exists, return the indices of both elements.

  • If it doesn't exist, add the current element to the hash table.

Asked in Amazon

1w ago

Q. Write code to find the minimum difference between any two elements in an array.

Ans.

Find the minimum difference between any two elements in an array of integers.

  • Sort the array first to make it easier to find minimum differences.

  • Iterate through the sorted array and calculate differences between consecutive elements.

  • Keep track of the minimum difference found during the iteration.

  • Example: For array [3, 8, 15, 17], after sorting: [3, 8, 15, 17], differences are 5, 7, 2. Minimum is 2.

Asked in Cognizant

3d ago

Q. Explain the Quicksort algorithm, including the steps.

Ans.

Quicksort is a divide-and-conquer algorithm that sorts an array by partitioning it into two sub-arrays, then recursively sorting the sub-arrays.

  • Choose a pivot element from the array.

  • Partition the array into two sub-arrays, with elements less than the pivot in one sub-array and elements greater than the pivot in the other sub-array.

  • Recursively apply the quicksort algorithm to each sub-array.

  • Combine the sorted sub-arrays to obtain the final sorted array.

2w ago

Q. Write a program to check if a number is a palindrome.

Ans.

A program to check if a number is Palindrome or not.

  • Convert the number to a string

  • Reverse the string

  • Compare the original string with the reversed string

  • If they are equal, the number is a palindrome

  • If not, the number is not a palindrome

Asked in Cognizant

2w ago

Q. 1) what is capture action and record action in AA?

Ans.

Capture action is used to extract data from an application while record action is used to automate user actions.

  • Capture action is used to capture data from an application's UI elements such as text boxes, drop-downs, etc.

  • Record action is used to record user actions such as mouse clicks, keyboard inputs, etc. to automate them later.

  • Capture action is used in conjunction with data scraping to extract data from web pages or desktop applications.

  • Record action is used to create aut...read more

Asked in Cognizant

2w ago

Q. Write pseudocode for printing a 5-row triangle using asterisks.

Ans.

Pseducode for printing a 5 rows triangle with star elements.

  • Use nested loop to print the triangle

  • The outer loop will iterate for 5 rows

  • The inner loop will print the stars for each row

  • The number of stars to print will increase with each row

Previous
1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
Capgemini Logo
3.7
 • 5.1k Interviews
Xceedance Logo
3.6
 • 115 Interviews
View all
Interview Tips & Stories
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Programmer Analyst 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