Cognizant
50+ Merck Interview Questions and Answers
Q1. 1 Tell me about your self 2 What is c# 3 What is oops concept 4 What is Delegate 5 Difference between polymorphism and what are its type 6 What is out and ref keyword 7 What is call by ref and call by value 8 W...
read moreInterview questions for Programmer Analyst position
C# is a programming language used for developing Windows applications
OOPS concepts include inheritance, encapsulation, abstraction, and polymorphism
Delegate is a type that represents references to methods with a specific parameter list and return type
Polymorphism is the ability of an object to take on many forms. Types include compile-time and runtime polymorphism
Out and ref keywords are used for passing arguments by referenc...read more
Q2. Q1. Write a program to check whether the given String is pallindrome or not using two pointers approach in 3 mins?
Program to check if a given string is palindrome or not using two pointers approach.
Initialize two pointers, one at the start and one at the end of the string.
Compare the characters at both pointers and move them towards each other until they meet.
If all characters match, the string is a palindrome.
If any character doesn't match, the string is not a palindrome.
Q3. Explain me about OOPS Concepts. Write a program in C++ to calculate Fibonacci Series. Write a program in C ++ to calculate Factorial. What is Call by value, Call by reference? Explain abstraction, encapsulation...
read moreOOPS Concepts, Fibonacci Series, Factorial, Call by value/reference, Abstraction, Encapsulation, Polymorphism, Switch, Router, Hub, OSI Model
OOPS Concepts include inheritance, polymorphism, encapsulation, and abstraction
Example of Fibonacci Series program: int fib(int n) { return (n <= 1) ? n : fib(n-1) + fib(n-2); }
Example of Factorial program: int fact(int n) { return (n == 1 || n == 0) ? 1 : n * fact(n-1); }
Call by value passes a copy of the variable, while call by referen...read more
Q4. What if a wheel of a car suddenly screws off while driving will u apply break suddenly ?
No, I would not apply the brake suddenly.
I would try to maintain control of the car by steering it to the side of the road or a safe area.
Applying the brake suddenly could cause the car to skid or lose control.
I would also turn on the hazard lights to alert other drivers of the situation.
Once the car is safely stopped, I would assess the damage and call for assistance if necessary.
Q5. What is NoSQL and how is it different from RDBMS.
NoSQL is a non-relational database that stores and retrieves data in a flexible and scalable manner.
NoSQL databases are schema-less and do not require a fixed table structure like RDBMS.
NoSQL databases are horizontally scalable, meaning they can handle large amounts of data and traffic.
Examples of NoSQL databases include MongoDB, Cassandra, and Redis.
RDBMS databases are vertically scalable, meaning they can handle more traffic by adding more resources to a single server.
Examp...read more
Q6. Write a program in java to find the middle element in a list.
Java program to find the middle element in a list.
Create a list and add elements to it.
Find the size of the list using size() method.
Calculate the middle index using size()/2.
Retrieve the middle element using get() method.
Handle cases where the list has even number of elements.
Q7. Q2. Difference between supervised learning and unsupervised learning.
Supervised learning uses labeled data to train a model, while unsupervised learning uses unlabeled data to find patterns.
Supervised learning requires a target variable to be predicted, while unsupervised learning does not.
Supervised learning algorithms include linear regression, logistic regression, and decision trees.
Unsupervised learning algorithms include clustering, principal component analysis, and anomaly detection.
Supervised learning is used in applications such as ima...read more
Q8. Q3. Implement a min stack program in 5 mins.
A min stack program is implemented to find the minimum element in a stack in constant time.
Create two stacks, one for storing the elements and the other for storing the minimum values.
Push the elements onto the stack and also push the minimum value onto the minimum stack if it is smaller than the current minimum.
When popping an element from the stack, also pop the top element from the minimum stack if it is the same as the popped element.
The minimum value can be obtained by p...read more
Q9. Q4. Find the output of the given recursive code
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
Q10. Explain the Quicksort algorithm. Steps only.
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.
Q11. Explain how recursion works with example?
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.
Q12. Write a pseducode for printing a 5 rows triangle having element as star .
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
Q13. 1) what is capture action and record action in AA?
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
Q14. What is the difference between a linked list and Graph
Linked list is a linear data structure where elements are linked using pointers, while a graph is a non-linear data structure consisting of nodes and edges.
Linked list is a collection of nodes where each node contains data and a reference to the next node.
Graph is a collection of nodes (vertices) and edges that connect these nodes.
Linked list is used for implementing data structures like stacks, queues, and hash tables.
Graph is used to represent relationships between differen...read more
Q15. What is the program to find the Fibonacci series?
The Fibonacci series is a sequence where each number is the sum of the two preceding ones, starting from 0 and 1.
The Fibonacci series starts with 0 and 1.
The next number is found by adding up the two numbers before it.
Example: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
A simple implementation can be done using recursion or iteration.
In Python, you can use a loop or a recursive function to generate the series.
Q16. Write a program to calculate the sum of the digits of a number.
This program calculates the sum of the digits of a given integer number.
Convert the number to a string to iterate through each digit.
Initialize a sum variable to zero.
For each character in the string, convert it back to an integer and add it to the sum.
Return or print the final sum.
Q17. What is cia triad, cybersecurity, cryptography
The CIA Triad is a foundational concept in cybersecurity that consists of three core principles: confidentiality, integrity, and availability.
Confidentiality ensures that data is only accessible to authorized individuals or systems.
Integrity ensures that data is accurate and has not been tampered with.
Availability ensures that data and systems are accessible when needed.
Cryptography is the practice of secure communication in the presence of third parties.
Examples of cryptogra...read more
Q18. What is Object-Oriented Programming (OOP)?
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and methods.
Encapsulation: Bundling data and methods that operate on the data within one unit (e.g., a class).
Inheritance: Mechanism to create a new class using properties and methods of an existing class (e.g., a 'Dog' class inheriting from an 'Animal' class).
Polymorphism: Ability to present the same interface for different underlying data types (e.g., a functi...read more
Q19. What is introduced in java 8
Java 8 introduced lambda expressions, functional interfaces, streams, and default methods.
Lambda expressions allow functional programming in Java.
Functional interfaces are interfaces with a single abstract method.
Streams provide a way to process collections of data in a functional way.
Default methods allow interfaces to have method implementations.
Date and Time API improvements.
Nashorn JavaScript engine.
Type annotations.
Parallel array sorting.
Base64 encoding and decoding.
Opti...read more
Q20. Latest technologies and mainly their usage
Latest technologies and their usage
Artificial Intelligence and Machine Learning for automation and predictive analysis
Blockchain for secure and transparent transactions
Internet of Things for connected devices and data collection
Virtual and Augmented Reality for immersive experiences
5G for faster and more reliable communication
Cloud Computing for scalable and cost-effective solutions
Q21. Explain joins in detail and their types.
Joins are used to combine data from two or more tables based on a related column.
Types of joins include inner join, left join, right join, and full outer join.
Inner join returns only the matching rows from both tables.
Left join returns all rows from the left table and matching rows from the right table.
Right join returns all rows from the right table and matching rows from the left table.
Full outer join returns all rows from both tables, with NULL values for non-matching rows...read more
Q22. 3) Why you use AA over Uipath?
AA has better OCR capabilities and is more user-friendly than UiPath.
AA has a more intuitive interface, making it easier for non-technical users to create automation workflows.
AA has better OCR capabilities, allowing it to read and interpret text from images more accurately than UiPath.
AA has a larger library of pre-built automation components, making it easier to create complex workflows quickly.
UiPath is better suited for developers who prefer more control over the automati...read more
Q23. Difference between array and link list.
Arrays are fixed in size and store data in contiguous memory locations, while linked lists are dynamic and store data in nodes with pointers to the next node.
Arrays have constant time access to elements, while linked lists require traversal to access elements.
Insertion and deletion are faster in linked lists as they only require updating pointers, while arrays may require shifting elements.
Arrays are better for random access and have better cache locality, while linked lists ...read more
Q24. What do you know about java
Java is a popular programming language known for its platform independence and object-oriented approach.
Java is an object-oriented programming language
It is known for its platform independence, meaning code can run on any device with a Java Virtual Machine
Java is used for developing a wide range of applications, from mobile apps to enterprise systems
Q25. an array definition, real time programming usage
An array is a collection of similar data types. Real-time programming uses arrays to store and manipulate data in real-time.
Arrays can be defined using square brackets [] and can hold any data type.
Real-time programming uses arrays to store and manipulate data in real-time, such as sensor data.
Arrays can be accessed using index numbers, starting from 0.
Arrays can be multidimensional, allowing for more complex data structures.
Arrays can be passed as arguments to functions, all...read more
Q26. What is Data Warehouse?
A data warehouse is a large, centralized repository of integrated data from various sources, used for reporting and analysis.
Data warehouse stores structured, historical data for decision-making purposes.
It consolidates data from multiple sources, such as databases, spreadsheets, and external systems.
Data is transformed, cleaned, and organized to support reporting and analysis.
It provides a single source of truth for business intelligence and reporting.
Examples include sales ...read more
Q27. Difference between switch and a router.
Switch operates at data link layer and forwards data based on MAC addresses, while router operates at network layer and forwards data based on IP addresses.
Switch operates at layer 2 of OSI model, while router operates at layer 3.
Switch forwards data within the same network, while router forwards data between different networks.
Switch uses MAC addresses to make forwarding decisions, while router uses IP addresses.
Switch is typically used in LANs, while router is used to conne...read more
Q28. OOPs concepts with real life examples.
OOPs concepts are fundamental principles in object-oriented programming that help in organizing and managing code efficiently.
Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: A car object with properties like color and methods like start() and stop().
Inheritance: Creating new classes based on existing classes, inheriting their attributes and methods. Example: Animal class with Dog and Cat subclasses.
Polymorphism: Objects of differ...read more
Q29. What are OOPS concepts?
OOPS concepts refer to Object-Oriented Programming concepts which include inheritance, encapsulation, polymorphism, and abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features.
Q30. Make it simple and quantifiable
To improve website performance, reduce page load time by 20% within 3 months.
Analyze current website performance metrics
Identify areas of improvement such as image optimization, code minification, and caching
Implement changes and monitor performance regularly
Use tools like Google PageSpeed Insights and GTmetrix to track progress
Q31. Asp.net MVC with filter and wep api?
Asp.net MVC with filter and web api is a combination of technologies used for building web applications.
Asp.net MVC is a framework for building web applications using Model-View-Controller architecture.
Filters are used to add additional functionality to MVC actions.
Web API is a framework for building HTTP services that can be consumed by a variety of clients.
Asp.net MVC with filter and web api can be used to build RESTful web services.
Example: Building a web application that ...read more
Q32. code logic for a specific function
Code logic for a specific function
Identify the input parameters required for the function
Define the steps needed to achieve the desired output
Consider edge cases and error handling
Test the function with different inputs to ensure correctness
Q33. What is normalisation.
Normalisation is the process of organizing data in a database to reduce redundancy and improve data integrity.
Organizes data into tables to minimize redundancy
Ensures data dependencies make sense
Reduces data anomalies
Example: Splitting customer information into separate tables for name, address, and contact details
Q34. Wt is SE16N? APP, HOUSE BANKS
SE16N is a transaction code used in SAP to display table contents and perform data analysis.
SE16N is used to view and analyze table contents in SAP.
It allows users to filter, sort, and export data.
APP and HOUSE BANKS are examples of tables that can be accessed using SE16N.
Q35. What is abstract class
Abstract class is a class that cannot be instantiated and may contain abstract methods.
Cannot be instantiated directly
May contain abstract methods that must be implemented by subclasses
Can have both abstract and non-abstract methods
Used for creating a template for other classes to inherit from
Q36. What exception handling
Exception handling is a programming concept that deals with errors and unexpected events in a program.
Exception handling allows programmers to gracefully handle errors and prevent program crashes.
It involves using try, catch, and finally blocks to handle exceptions.
Examples of exceptions include divide by zero, file not found, and out of memory errors.
Q37. Sql query to find the employer with highest salary
Q38. Write a program to reverse an array.
This program reverses an array of strings by swapping elements from both ends towards the center.
Define a function that takes an array of strings as input.
Use a loop to swap elements from the start and end of the array.
Continue swapping until the middle of the array is reached.
Example: Input: ['apple', 'banana', 'cherry'], Output: ['cherry', 'banana', 'apple'].
Q39. What is selenium and java
Selenium is a tool used for automating web browsers and Java is a programming language used for developing applications.
Selenium is used for testing web applications by automating browser actions
Java is an object-oriented programming language used for developing desktop and web applications
Selenium can be used with Java to write automated tests for web applications
Java can be used to write code for Selenium test scripts
Q40. Which framework you used
I have experience working with multiple frameworks including Angular, React, and Vue.js.
I have used Angular for building complex web applications with a lot of data manipulation and real-time updates.
React is my go-to framework for building single-page applications with a lot of interactivity and dynamic content.
Vue.js is a great choice for smaller projects or when I need to quickly prototype a new feature.
I am also familiar with other frameworks like Ember.js and Backbone.js...read more
Q41. Difference between list and array
Arrays are fixed in size and store elements of the same data type, while lists can dynamically resize and store elements of different data types.
Arrays have a fixed size, while lists can dynamically resize.
Arrays store elements of the same data type, while lists can store elements of different data types.
Arrays use contiguous memory allocation, while lists use linked data structures.
Arrays are accessed by index, while lists are accessed by iterators or pointers.
Q42. Class and object in c++
Class and object are fundamental concepts in C++ programming language.
A class is a blueprint for creating objects that have similar attributes and methods.
An object is an instance of a class that has its own set of values for the attributes defined in the class.
Classes can have access modifiers like public, private, and protected to control the visibility of attributes and methods.
Objects can interact with each other by calling methods defined in their respective classes.
Q43. Inheritance in detail
Inheritance is a mechanism in object-oriented programming where a new class is derived from an existing class.
Inheritance allows the new class to inherit the properties and methods of the existing class.
The existing class is called the superclass or parent class, while the new class is called the subclass or child class.
The subclass can add new properties and methods or override the existing ones.
Inheritance promotes code reuse and makes the code more modular and maintainable...read more
Q44. To represent a class object
To represent a class object, we need to define a class with its properties and methods.
Define a class with the 'class' keyword in the programming language
Add properties and methods to the class
Instantiate the class to create an object
Access the object's properties and methods using dot notation
Example: class Person { name; age; sayHello() { console.log('Hello!'); } }
Example: const john = new Person(); john.name = 'John'; john.age = 30; john.sayHello();
Q45. Sql query to find second max salary
Q46. Explain Abstraction in java?
Abstraction in Java is the concept of hiding the implementation details and showing only the necessary features of an object.
Abstraction allows programmers to focus on what an object does instead of how it does it.
It helps in reducing complexity and improving the efficiency of the code.
In Java, abstraction is achieved through abstract classes and interfaces.
Example: Animal is an abstract class with abstract method 'eat', and Dog and Cat are concrete classes extending Animal.
Q47. Different between List and tuple
List and tuple are both data structures in Python, but they have some key differences.
List is mutable, meaning its elements can be changed, added, or removed.
Tuple is immutable, meaning its elements cannot be changed once defined.
List uses square brackets [], while tuple uses parentheses ().
List is typically used for collections of similar items, while tuple is used for heterogeneous data.
List has more built-in methods for manipulation, while tuple has fewer methods.
Q48. Explain your Framework.
Our framework is a robust and flexible tool that streamlines development processes and enhances code reusability.
Modular architecture allows for easy customization and scalability
Built-in libraries and utilities simplify common tasks
Support for various programming languages and platforms
Example: Using MVC architecture for organizing code and separating concerns
Q49. Explain projects
Projects are specific tasks or assignments that require planning, execution, and completion within a specified timeframe.
Projects involve a defined scope, objectives, and deliverables.
They require resources such as time, budget, and team members.
Project management methodologies like Agile or Waterfall are often used to organize and track progress.
Examples: Developing a new software application, implementing a system upgrade, conducting a research study.
Q50. Willing to move
Yes, willing to relocate for the right opportunity.
I am open to relocating for a position that aligns with my career goals and offers growth opportunities.
I have moved for previous job opportunities and have found it to be a positive experience.
I am willing to consider relocation assistance or remote work options if available.
More about working at Cognizant
Top HR Questions asked in Merck
Interview Process at Merck
Top Programmer Analyst Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month