Cognizant
100+ Interview Questions and Answers
Q1. How to decide whether to use "call" or "apply" in javascript?
The choice between 'call' and 'apply' in JavaScript depends on whether you have the arguments as an array or as individual parameters.
Use 'call' when you have the arguments as individual parameters.
Use 'apply' when you have the arguments as an array.
Both 'call' and 'apply' allow you to invoke a function with a specific 'this' value.
Q2. you have a train booking system.what will be the primary feature you will test?
The primary feature to test in a train booking system would be the booking process.
Test the ability to search for available trains and seats
Test the ability to select and reserve seats
Test the payment process
Test the confirmation and ticket generation process
Q3. What is class, encapsulation and other feature of OOP?
Class is a blueprint for creating objects, encapsulation is the process of hiding data and methods within a class.
Class is a template or blueprint that defines the properties and behaviors of an object.
Encapsulation is the process of bundling data and methods together within a class, hiding the internal details from the outside world.
Other features of OOP include inheritance, polymorphism, and abstraction.
Inheritance allows a class to inherit properties and methods from anoth...read more
Q4. Write a program to find the sum of the squares of each term of Fibonacci series
Program to find the sum of squares of each term of Fibonacci series
Generate Fibonacci series using loop or recursion
Calculate square of each term
Add all squares to get the sum
Q5. Which programming language do you know?
I know multiple programming languages including Java, Python, and C++.
Proficient in Java with experience in developing web applications using Spring framework
Familiar with Python for data analysis and machine learning
Experience in C++ for developing high-performance applications
Also familiar with HTML, CSS, and JavaScript for front-end development
Q6. Why can we update internal values of objects defined with const in javascript?
Internal values of const objects can be updated in JavaScript due to the nature of const keyword.
The const keyword only prevents reassignment of the variable identifier, not the object itself.
Internal values of objects can be modified without reassigning the object.
This behavior is different from other programming languages where const objects are completely immutable.
Q7. Informatica Powercenter grid Difference between Joiner and lookup Difference between router and filter What is mapplet and it's limitations Session Partitioning Scenario based questions and Unix and SQL questio...
read moreExplaining differences between Informatica Powercenter grid components and concepts
Joiner combines data from two sources based on a common key, while Lookup retrieves data from a reference table based on a matching key
Router sends data to different targets based on specified conditions, while Filter removes rows from a data set based on specified criteria
Mapplet is a reusable object that contains a set of transformations, but has limitations such as not being able to use dyna...read more
Q8. How to create Threads and what all are the ways to create threads?
Creating threads in programming and the different ways to do so.
Threads can be created by extending the Thread class and overriding the run() method.
Threads can also be created by implementing the Runnable interface and passing it to a Thread object.
Java 8 introduced the concept of creating threads using lambda expressions.
Thread pools can be used to manage a group of threads.
Examples: Thread t1 = new Thread(); t1.start();
Examples: class MyThread extends Thread { public void ...read more
Q9. what is class variable and what is instance variable
Class variables are shared among all instances of a class while instance variables are unique to each instance.
Class variables are defined within the class but outside of any methods.
Instance variables are defined within a class's methods and are unique to each instance.
Class variables are accessed using the class name while instance variables are accessed using the instance name.
Example of class variable: count = 0 (used to keep track of the number of instances created)
Examp...read more
Q10. What are some practical usages of IIFE?
IIFE (Immediately Invoked Function Expression) is used to create a private scope and avoid global namespace pollution.
IIFE can be used to create modules in JavaScript.
It can also be used to avoid naming conflicts in code.
IIFE can be used to create closures and maintain state.
It can be used to execute code immediately without the need for a function call.
IIFE can be used to pass arguments to a function without exposing them to the global scope.
Q11. What Is the probability of it raining today in Chennai?
The probability of rain in Chennai today depends on various factors such as season, weather conditions, and location.
The probability can be estimated by analyzing the current weather patterns and historical data.
Factors such as humidity, temperature, and wind speed can affect the probability of rain.
Local weather forecasts and satellite imagery can also provide insights into the likelihood of rain.
The probability of rain can range from 0% to 100%, with higher probabilities in...read more
Q12. What is executequery, execute scalar, executenon query in SQL
executequery, execute scalar, executenon query are SQL methods for executing queries.
ExecuteQuery is used to execute a SELECT statement and returns a ResultSet object.
ExecuteScalar is used to execute a SELECT statement that returns a single value.
ExecuteNonQuery is used to execute INSERT, UPDATE, DELETE statements and returns the number of rows affected.
Q13. What are various ISO standard which I have implemented
I have implemented ISO 9001, ISO 14001, and ISO 27001 standards.
Implemented ISO 9001 for quality management systems
Implemented ISO 14001 for environmental management systems
Implemented ISO 27001 for information security management systems
Q14. How should we traverse a tree ideally?
Traversing a tree involves visiting each node in a specific order.
Choose a traversal method based on the problem requirements
Depth-first search (DFS) and breadth-first search (BFS) are common methods
DFS can be implemented using recursion or a stack
BFS can be implemented using a queue
Examples: inorder, preorder, postorder, level-order
Consider the time and space complexity of each method
Q15. What are custom directives? What are their types? How to create with general example?
Custom directives are a way to extend HTML with new attributes and functionality.
Types of custom directives are attribute, element, and class directives.
Attribute directives modify the behavior of existing HTML elements.
Element directives create new HTML elements.
Class directives modify the behavior of existing HTML elements based on their class.
To create a custom directive, use the directive() method of the AngularJS module.
Example: creating a custom attribute directive to c...read more
Q16. Explain about types of State management in client and server side
State management in client and server side
Client-side state management: cookies, local storage, session storage, and query parameters
Server-side state management: session state and application state
Cookies are small text files stored on the client's computer
Local storage and session storage are HTML5 web storage APIs
Session state is stored on the server and associated with a user's session
Application state is stored on the server and shared across all users
Q17. Why state management techniques are required ?
State management techniques are required to manage the state of an application and ensure data consistency.
State management helps in maintaining the state of an application and ensures that data is consistent across different components.
It helps in managing complex applications with multiple components and data sources.
State management techniques like Redux, MobX, and Context API provide a centralized store for managing application state.
They also provide tools for debugging ...read more
Q18. What is temporal dead zone in javascript?
Temporal dead zone is a behavior in JavaScript where a variable cannot be accessed before it is declared.
Variables declared with let and const are hoisted but cannot be accessed before their declaration.
This behavior helps in avoiding errors due to accessing variables before they are initialized.
Example: console.log(x); // ReferenceError: x is not defined let x = 10;
Temporal dead zone only applies to block-scoped variables declared with let and const.
Q19. How to solve runtime error where selenium is not able to create an instance of webdriver
To solve a runtime error where Selenium is not able to create an instance of WebDriver, check for correct WebDriver setup and dependencies.
Ensure that the correct WebDriver executable path is set in the system PATH variable
Check if the WebDriver executable is compatible with the browser version being used
Verify that all necessary dependencies for the WebDriver are installed
Consider updating the WebDriver and browser to the latest versions
Check for any conflicting browser exte...read more
Q20. Write a program to print only first 5 prime numbers in a finite series. Why and when do we use Stack/queue
Program to print first 5 prime numbers in a series
Use a loop to iterate through the series
Check if each number is prime
Print the first 5 prime numbers found
Use Sieve of Eratosthenes for better performance
Q21. ApI testing- Challenges faced in API testing, different methods and protocols used in postman, different error codes
API testing challenges, methods and error codes in Postman
Challenges include testing for authentication, authorization, input validation, and error handling
Methods used in Postman include GET, POST, PUT, DELETE, PATCH, and OPTIONS
Protocols used include HTTP, HTTPS, and REST
Error codes include 200 for success, 400 for bad request, 401 for unauthorized, 404 for not found, and 500 for internal server error
Q22. Find the probability that India will win the next Cricket World Cup
It is impossible to accurately predict the probability of India winning the next Cricket World Cup.
Sports events are unpredictable and depend on various factors such as team performance, weather conditions, injuries, etc.
Past performance of the team and individual players can be considered, but it does not guarantee future success.
Other teams participating in the tournament also play a significant role in determining the probability of India winning.
Therefore, it is not possi...read more
Q23. What is 'inproc' in state management?
Inproc is a state management mode where data is stored in the application's memory.
Inproc stands for 'in-process'.
Data is stored in the application's memory, making it fast to access.
This mode is suitable for small applications with low traffic.
If the application is restarted, all data stored in inproc mode is lost.
Examples of inproc state management include ASP.NET's in-process session state and Cache API.
Q24. What is React, how it is different from other frameworks?
React is a JavaScript library for building user interfaces, known for its component-based architecture and virtual DOM.
React is a JavaScript library, not a full-fledged framework like Angular or Vue.
React uses a virtual DOM to improve performance by minimizing actual DOM manipulations.
React follows a component-based architecture, where UI is broken down into reusable components.
React allows for easy state management and data flow through props.
React is maintained by Facebook ...read more
Q25. How do you create a XML publisher report in Oracle EBS
To create a XML publisher report in Oracle EBS, you need to define a data template and a layout template.
Define a data template by creating an RTF template with data definitions and mappings.
Upload the data template to the XML Publisher Administrator responsibility in Oracle EBS.
Define a layout template by creating an RTF template with the desired report layout.
Associate the data template and layout template to create the XML publisher report.
Run the concurrent program to gen...read more
Q26. 1) How we can maintain dependency injection in .net core?
Dependency injection in .NET Core can be maintained through built-in DI container or third-party containers.
Use built-in DI container by registering services in Startup.cs file
Use third-party containers like Autofac, Ninject, etc. for more advanced scenarios
Avoid using static classes or singletons to prevent tight coupling
Use constructor injection to ensure loose coupling and testability
Q27. How to do global error handling in angular?
Global error handling in Angular can be done using ErrorHandler class.
Create a class that implements the ErrorHandler interface
Override the handleError() method to handle errors globally
Provide the ErrorHandler class in the providers array of AppModule
Use the error handling service to log errors or display error messages
Q28. 1. what are the 4 main divisions in COBOL. Explain each 2. Explain VSAM Define? 3. what is the purpose of file status clause in Select statement
COBOL main divisions are Identification Division, Environment Division, Data Division, and Procedure Division. VSAM Define is used to define the structure of a VSAM file. File status clause in Select statement is used to handle file operations.
Identification Division - contains program name and author information
Environment Division - specifies the environment in which the program will run
Data Division - defines the data structures used in the program
Procedure Division - cont...read more
Q29. tell me oops concepts and how can you use these in real life
Object-oriented programming concepts like inheritance, encapsulation, polymorphism, and abstraction can be used in real life to organize and structure code efficiently.
Inheritance allows for code reusability by creating a new class that inherits properties and methods from an existing class.
Encapsulation helps in bundling data and methods that operate on the data into a single unit, protecting data from outside interference.
Polymorphism enables objects to be treated as instan...read more
Q30. ES6 Features, Difference between Arrow Function and Normal function expression This keyword
Arrow functions are concise syntax for writing functions in ES6. They do not have their own 'this' keyword.
Arrow functions do not have their own 'this' keyword, they inherit 'this' from the parent scope.
Normal function expressions have their own 'this' keyword, which is determined by how the function is called.
Arrow functions are more concise and have implicit return, while normal functions require explicit return statement.
Q31. Selenium- Types of exceptions, limitations, Types of waits used in selenium, types of locators
Answering questions related to Selenium
Types of exceptions in Selenium include NoSuchElementException, TimeoutException, and ElementNotVisibleException
Limitations of Selenium include difficulty testing CAPTCHA, inability to test desktop applications, and difficulty testing mobile applications
Types of waits used in Selenium include implicit wait, explicit wait, and fluent wait
Types of locators in Selenium include ID, name, class name, tag name, link text, and partial link text
Q32. Difference between Functional Interface and Normal Interface
Functional Interface has only one abstract method while Normal Interface can have multiple abstract methods.
Functional Interface is used for lambda expressions and method references.
Normal Interface can have default and static methods along with abstract methods.
Example of Functional Interface: java.util.function.Predicate
Example of Normal Interface: java.util.List
Q33. 1) How to use the ORMs in .net application?
ORMs in .NET simplify database operations by mapping objects to database tables.
ORMs like Entity Framework and NHibernate provide a higher level of abstraction for database operations.
They allow developers to work with objects instead of writing SQL queries.
ORMs handle database connections, transactions, and mapping of objects to tables.
Developers can use LINQ to query data from the database.
ORMs also provide caching and lazy loading to improve performance.
Example: Entity Fra...read more
Q34. what is difference between overriding and overloading
Overriding is when a subclass provides a specific implementation for a method that is already provided by its parent class, while overloading is when multiple methods have the same name but different parameters.
Overriding involves changing the method implementation in a subclass, while overloading involves having multiple methods with the same name but different parameters.
Overriding is used for runtime polymorphism, while overloading is used for compile-time polymorphism.
Exa...read more
Q35. Project implementation ,challenges faces and how to overcome challnges
Project implementation challenges and overcoming them
Identifying potential risks and challenges
Creating a detailed project plan
Effective communication and collaboration
Adapting to changes and being flexible
Monitoring progress and making necessary adjustments
Building a strong team and assigning roles
Seeking expert advice and guidance
Learning from past experiences and lessons
Implementing risk mitigation strategies
Regularly reviewing and evaluating the project
Q36. How do you find if table has any duplicates
To find if a table has any duplicates, you can use the GROUP BY clause with the COUNT function.
Use the GROUP BY clause to group the rows by the columns that you want to check for duplicates.
Use the COUNT function to count the number of occurrences of each group.
If the count is greater than 1, it means there are duplicates in the table.
Q38. What do you mean by supporting application's
Supporting applications refers to providing assistance and maintenance for software programs.
Supporting applications involves troubleshooting and resolving issues that users encounter while using the software.
It includes providing technical support, answering user queries, and assisting with software updates and upgrades.
Supporting applications also involves monitoring the performance of the software and ensuring its smooth operation.
Examples of supporting applications includ...read more
Q39. What are the scenario where you used pivot table?
Pivot tables are used to summarize and analyze large datasets in a structured manner.
Used to analyze sales data by product, region, and time period
Helps in identifying trends and patterns in data
Used to compare and contrast data from different perspectives
Enables easy filtering and sorting of data
Assists in creating meaningful reports and visualizations
Q42. Why Parquet words faster on Spark ?
Parquet words faster on Spark due to its columnar storage format and efficient compression techniques.
Parquet is a columnar storage format that organizes data by columns rather than rows.
Columnar storage allows for better compression and efficient data retrieval.
Parquet uses compression techniques like run-length encoding and dictionary encoding.
Spark leverages the columnar storage format of Parquet to perform predicate pushdown and column pruning.
Parquet also supports predic...read more
Q43. Difference between rank and dense_rank, with examples
Rank assigns unique numbers to each row, while dense_rank assigns consecutive numbers to rows with the same values.
Rank function assigns a unique number to each row based on the order specified.
Dense_rank function assigns consecutive numbers to rows with the same values.
Rank and dense_rank are used in SQL queries to rank rows based on certain criteria.
Rank and dense_rank can be used to find top N records or identify duplicates in a dataset.
Q44. What is oops? Explain all characteristics of oops.
Oops stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
Oops is based on the four main principles: Inheritance, Encapsulation, Abstraction, and Polymorphism.
Inheritance allows a class to inherit properties and behavior from another class.
Encapsulation refers to the bundling of data with the methods that operate on that data.
Abstraction focuses on ...read more
Q45. Biggest company in india
Reliance Industries Limited is currently the biggest company in India.
Reliance Industries Limited is a conglomerate with interests in petrochemicals, refining, oil, and gas exploration.
It was founded by Dhirubhai Ambani in 1966 and is currently run by his son Mukesh Ambani.
Reliance Industries Limited is also the second-largest company in Asia by market capitalization.
Other major companies in India include Tata Group, State Bank of India, and Indian Oil Corporation.
Q46. What is difference between traits and fragments
Traits are reusable components that can be mixed into different classes, while fragments are reusable UI components in Android development.
Traits are used in object-oriented programming languages like Scala and PHP to enable multiple inheritance by allowing a class to inherit methods from multiple traits.
Fragments are used in Android development to modularize and reuse UI components across different activities or fragments.
Traits are typically used for code reusability and to...read more
Q47. Find the most repeated number array Armstrong number
The most repeated number in an array is the Armstrong number.
Armstrong number is a number that is equal to the sum of its own digits raised to the power of the number of digits.
To find the most repeated Armstrong number in an array, calculate the sum of digits raised to the power of the number of digits for each number and compare the result with the original number.
Example: 153 is an Armstrong number as 1^3 + 5^3 + 3^3 = 153.
Q48. Analytical functions in PL-SQL. Data dictionary tables in Oracle
Analytical functions in PL-SQL are used to perform calculations across a set of rows. Data dictionary tables in Oracle store metadata about the database.
Analytical functions in PL-SQL allow for calculations to be performed on a set of rows, typically used in reporting and data analysis.
Examples of analytical functions include ROW_NUMBER, RANK, DENSE_RANK, and LAG/LEAD.
Data dictionary tables in Oracle store information about the database, such as tables, columns, indexes, and ...read more
Q49. Types of Join. Difference between view and materialized view.
Types of joins include inner, outer, left, right, and full. Views are virtual tables while materialized views store data physically.
Types of joins: inner, outer, left, right, full
Views are virtual tables that do not store data physically
Materialized views store data physically for faster access
Views are updated dynamically while materialized views need to be refreshed manually
Q50. name a gem you have recently used
I recently used the gem 'devise' for user authentication in a Rails project.
Devise is a popular gem for user authentication in Rails applications.
It provides a lot of built-in functionality such as user registration, login, and password reset.
Devise also allows for customization and configuration to fit specific project needs.
Example: I used Devise to create a secure login system for a social media platform.
Example: Devise also has support for multiple authentication models s...read more
Q51. 1.what is rspec?
RSpec is a testing tool for Ruby programming language.
RSpec is a behavior-driven development (BDD) framework.
It allows developers to write tests that describe the expected behavior of the code.
RSpec provides a domain-specific language (DSL) for writing tests.
It can be used for unit testing, integration testing, and acceptance testing.
RSpec is widely used in the Ruby community and is considered a standard tool for testing Ruby code.
Q52. How you will take care of multiple task
I will prioritize tasks, create a schedule, delegate when necessary, and stay organized.
Prioritize tasks based on urgency and importance
Create a schedule or to-do list to keep track of tasks
Delegate tasks to others when possible
Stay organized by using tools like calendars or project management software
Q53. What is the oops concept??
OOPs (Object-Oriented Programming) is a programming paradigm based on the concept of objects.
OOPs focuses on creating objects that contain both data and functions to manipulate that data.
It emphasizes on encapsulation, inheritance, and polymorphism.
Encapsulation is the process of hiding the implementation details of an object from the outside world.
Inheritance allows a class to inherit properties and methods from another class.
Polymorphism allows objects of different classes ...read more
Q54. Difference between clustered and non clustered index
Clustered index physically reorders the data on disk, while non-clustered index creates a separate structure.
Clustered index determines the physical order of data rows in a table, while non-clustered index does not.
Clustered index is faster for retrieval of large ranges of data, while non-clustered index is faster for retrieval of individual rows.
A table can have only one clustered index, but multiple non-clustered indexes.
Example: Primary key in a table is usually implemente...read more
Q55. What is nodejs and it’s advantage
Node.js is a runtime environment that allows you to run JavaScript on the server side.
Node.js is built on Chrome's V8 JavaScript engine
It uses an event-driven, non-blocking I/O model which makes it lightweight and efficient
Node.js is commonly used for building scalable network applications and real-time web applications
Q56. What are types of operator in python?
Types of operators in Python include arithmetic, comparison, logical, assignment, bitwise, membership, and identity operators.
Arithmetic operators perform mathematical operations (+, -, *, /, %, **, //)
Comparison operators compare values (==, !=, >, <, >=, <=)
Logical operators perform logical operations (and, or, not)
Assignment operators assign values (=, +=, -=, *=, /=, %=, **=, //=)
Bitwise operators perform bitwise operations (&, |, ^, ~, <<, >>)
Membership operators test fo...read more
Q57. What is my expected CTC
My expected CTC is negotiable and depends on the company's offer, my experience, skills, and the market standards.
My expected CTC is based on my experience and skills in the industry.
I am open to negotiation based on the company's offer and market standards.
I have researched the average salary range for this position in the industry.
I am looking for a competitive salary package that reflects my qualifications and contributions.
Q59. Explain the Framework of the project
The project framework is the structure that outlines the project's goals, tasks, and resources.
The framework includes the project's scope, objectives, and deliverables.
It also outlines the project's timeline, budget, and resources needed.
The framework serves as a guide for project management and helps ensure project success.
Examples of project frameworks include Agile, Waterfall, and Scrum methodologies.
Q60. Difference between different versions of selenium
Different versions of Selenium include Selenium IDE, Selenium WebDriver, and Selenium Grid.
Selenium IDE is a record and playback tool for creating automated tests in the browser.
Selenium WebDriver is a tool for writing automated tests in various programming languages.
Selenium Grid allows for running tests on different machines in parallel.
Each version has its own strengths and weaknesses, and the choice of version depends on the specific testing needs.
For example, Selenium ID...read more
Q61. State Management in React- states and props
State management in React involves managing the state and props of components.
State is used to manage data that changes within a component
Props are used to pass data from a parent component to a child component
State can be updated using setState() method
Props are read-only and cannot be modified within a component
State and props are used together to create dynamic and interactive UIs
Q62. Linked list traversal and finding an element.
Traversing a linked list involves iterating through each node to find a specific element.
Start at the head of the linked list
Iterate through each node by following the 'next' pointer
Compare the value of each node with the target element
Stop when the target element is found or reach the end of the list
Q63. Alternative join strategy for full outer join
An alternative join strategy for full outer join is to use a combination of left and right outer joins.
Perform a left outer join to include all rows from the left table and matching rows from the right table
Perform a right outer join to include all rows from the right table and matching rows from the left table
Combine the results of the left and right outer joins to get the full outer join
Q64. What will you do if cpu usage is high?
I would investigate the root cause of the high CPU usage and take appropriate actions to optimize performance.
Check for any resource-intensive processes running on the system
Monitor system performance metrics to identify any patterns or trends
Consider scaling up resources or optimizing code to improve efficiency
Q65. What is JVM?
JVM stands for Java Virtual Machine. It is an abstract machine that enables a computer to run Java programs.
JVM is responsible for interpreting the compiled Java code and executing it on the computer.
It provides a platform-independent environment for Java programs to run on different operating systems.
JVM has various components like class loader, bytecode verifier, and execution engine.
Examples of JVM-based languages include Kotlin, Scala, and Groovy.
Q66. Why are you switching current org
Seeking new challenges and growth opportunities in a different environment.
Looking for new challenges and opportunities for growth
Interested in exploring different work environments and cultures
Seeking to expand skill set and knowledge in a different organization
Q67. Hash map working and concurrent hash map working and difference
Hash map and concurrent hash map are data structures used for storing key-value pairs, with the main difference being concurrency support in the latter.
Hash map is a basic data structure that stores key-value pairs and allows for efficient retrieval of values based on keys.
Concurrent hash map is a thread-safe version of hash map, designed for use in concurrent environments where multiple threads may access and modify the map simultaneously.
The main difference between hash map...read more
Q68. Disadvantages of viewstate technique ?
Viewstate technique can lead to performance issues and security vulnerabilities.
Viewstate increases the size of the page, leading to slower load times.
Viewstate can be tampered with, leading to security vulnerabilities.
Viewstate is stored on the client side, leading to potential data privacy issues.
Viewstate can cause issues with scalability in web applications.
Alternative techniques like session state or caching can be used instead.
Q69. How to deliver projects on time
To deliver projects on time, it is important to set clear timelines, prioritize tasks, communicate effectively, and regularly monitor progress.
Set clear project timelines and deadlines
Prioritize tasks based on importance and urgency
Communicate effectively with team members and stakeholders
Regularly monitor progress and make adjustments as needed
Q70. What is default method in java 8
Default method in Java 8 allows interfaces to have method implementations.
Introduced in Java 8 to provide backward compatibility for interfaces
Allows interfaces to have method implementations without affecting implementing classes
Used to add new methods to interfaces without breaking existing code
Default methods are marked with the 'default' keyword
Example: default void myMethod() { // method implementation }
Q71. What is redux and explain the workflow
Redux is a predictable state container for JavaScript apps. It helps manage the state of an application in a single immutable state tree.
Redux is commonly used with React to manage the state of components.
It follows a unidirectional data flow, where actions are dispatched to update the state.
Reducers are pure functions that specify how the state changes in response to actions.
The state is stored in a single immutable state tree, making it easier to track changes and debug.
Red...read more
Q72. difference between module and class
A module is a file containing Python definitions and statements. A class is a blueprint for creating objects.
A module can have multiple classes and functions.
A class can have multiple methods and attributes.
Modules are used for organizing code and avoiding naming conflicts.
Classes are used for creating objects with similar properties and behaviors.
Modules are imported using the import statement.
Classes are instantiated using the class name followed by parentheses.
Q73. How does angular application works?
Angular applications work by utilizing components, services, modules, and dependency injection to create dynamic web applications.
Angular applications are built using components, which are reusable building blocks for the UI.
Services in Angular are used for encapsulating reusable logic that can be shared across components.
Modules in Angular help organize the application into cohesive blocks of functionality.
Dependency injection in Angular allows for the injection of dependenc...read more
Q74. What is Byte code?
Byte code is a compiled code that can be executed on any platform with the help of a virtual machine.
Byte code is an intermediate code that is generated by a compiler.
It is platform-independent and can be executed on any platform with the help of a virtual machine.
Examples of virtual machines include Java Virtual Machine (JVM) and .NET Common Language Runtime (CLR).
Q75. Tell me about recent technologies
Recent technologies include artificial intelligence, blockchain, Internet of Things, and virtual reality.
Artificial intelligence (AI) is being used in various industries for automation and decision-making processes.
Blockchain technology is revolutionizing secure transactions and data storage.
Internet of Things (IoT) connects devices to the internet for remote monitoring and control.
Virtual reality (VR) is creating immersive experiences in gaming, training, and entertainment.
Q76. what are CTE in sql ?
CTE stands for Common Table Expressions in SQL, which are temporary result sets that can be referenced within a SELECT, INSERT, UPDATE, or DELETE statement.
CTEs are defined using the WITH keyword followed by a name for the CTE and a SELECT statement that defines the result set.
They can be used to simplify complex queries, improve readability, and avoid repeating the same subquery multiple times.
CTEs are particularly useful for recursive queries where a query references itself...read more
Q77. Difference between StringBuffer and StringBuilder
StringBuffer is synchronized while StringBuilder is not.
StringBuffer is thread-safe while StringBuilder is not.
StringBuffer is slower than StringBuilder due to synchronization.
StringBuilder is preferred for single-threaded environments.
Both classes are used for manipulating strings.
Example: StringBuffer sb = new StringBuffer("Hello");
Example: StringBuilder sb = new StringBuilder("Hello");
Q78. What are pipes in angular?
Pipes are a feature in Angular that allow for data transformation before displaying it in the view.
Pipes are used to format data in the view
They can be used to filter, sort, and transform data
Examples include the date pipe, currency pipe, and uppercase pipe
Q79. Write a .small C code
A C code that prints out the elements of an array of strings.
Declare an array of strings
Use a loop to iterate through the array
Print out each element
Q80. Difference between abstraction and encapsulation
Abstraction focuses on hiding the implementation details while encapsulation focuses on bundling the data and methods that operate on the data into a single unit.
Abstraction is the concept of hiding the complex implementation details and showing only the necessary features of an object. For example, a car can be abstracted as a vehicle with properties like speed and color, without showing the internal working of the engine.
Encapsulation is the bundling of data and methods tha...read more
Q81. A brief explanation of Ajax ?
Ajax is a technique for creating fast and dynamic web pages without reloading the entire page.
Ajax stands for Asynchronous JavaScript and XML
It allows for asynchronous communication between the client and server
It can update parts of a web page without requiring a full page reload
Examples of Ajax include auto-suggest search bars and real-time chat applications
Q82. Write a code for reversing a word.
Code for reversing a word
Create an empty string variable
Loop through the characters of the word in reverse order
Add each character to the empty string variable
Return the reversed word
Q83. write pattern program in C language
Pattern program in C language using loops and conditional statements.
Use nested loops to print the desired pattern
Utilize conditional statements to control the pattern output
Experiment with different loop structures to create various patterns
Q84. Joining strategy of table A - table B
The joining strategy of table A and table B is the method used to combine the data from both tables based on a common column.
The joining strategy can be specified using different types such as inner join, left join, right join, and full outer join.
Inner join returns only the matching rows from both tables based on the common column.
Left join returns all the rows from the left table and the matching rows from the right table.
Right join returns all the rows from the right table...read more
Q85. All Java 8 new features
Java 8 introduced several new features including lambda expressions, functional interfaces, streams, and default methods.
Lambda expressions allow you to pass functionality as an argument to a method.
Functional interfaces have a single abstract method and can be used with lambda expressions.
Streams provide a way to work with sequences of elements efficiently.
Default methods allow interfaces to have method implementations.
Some other features include the new Date and Time API, N...read more
Q86. Why string is immutable
String is immutable because it cannot be changed once created.
Immutable objects are safer to use in multi-threaded environments
String pool in Java is possible because of immutability
StringBuffer and StringBuilder classes are used for mutable strings
Q87. How to take screenshot?
To take a screenshot, use the appropriate keyboard shortcuts or built-in tools on your device.
On Windows, press 'PrtScn' key to capture entire screen or 'Alt + PrtScn' for active window.
On Mac, press 'Command + Shift + 3' to capture entire screen or 'Command + Shift + 4' for selected area.
On smartphones, press 'Power + Volume Down' buttons simultaneously to take a screenshot.
Use built-in screenshot tools on devices like Snipping Tool on Windows or Grab on Mac.
Q88. Inline attribute in html ?
Inline attribute is used to apply styles to a single element in HTML.
Inline attribute is defined within the opening tag of an element
It is used to apply styles to a single element
It has lower specificity than internal or external stylesheets
Example:
This text is red
Q89. Difference between HashMap and HashSet
HashMap is a key-value pair collection while HashSet is a set of unique elements.
HashMap allows duplicate values but not duplicate keys
HashSet does not allow duplicate elements
HashMap uses key to retrieve values while HashSet uses contains() method to check if an element exists
Example: HashMap - {1=apple, 2=banana, 3=apple}, HashSet - {apple, banana}
HashMap implements Map interface while HashSet implements Set interface
Q90. Difference between abstract class and interface
Abstract class is a class that can have both abstract and non-abstract methods while interface only has abstract methods.
Abstract class can have constructors while interface cannot
A class can implement multiple interfaces but can only inherit from one abstract class
Abstract class can have instance variables while interface cannot
Abstract class is used when we want to provide a common behavior for all the subclasses while interface is used when we want to provide a common beha...read more
Q91. Tell me about agile methodology
Agile methodology is a project management approach that emphasizes flexibility, collaboration, and iterative development.
Agile focuses on delivering value to customers through continuous planning, feedback, and adaptation.
It involves breaking down projects into smaller, manageable tasks called sprints.
Teams work closely together and with stakeholders to prioritize tasks and make quick decisions.
Common agile frameworks include Scrum, Kanban, and Extreme Programming (XP).
Q92. What is your Expected CTC?
My expected CTC is based on my experience, skills, and industry standards.
My expected CTC is in line with the market rate for the position
I have taken into consideration my years of experience and expertise in the field
I am open to negotiation based on the overall compensation package offered
Q93. How to group and add data
Grouping and adding data involves organizing data into categories and performing mathematical operations to calculate totals.
Group data based on a common attribute or criteria
Use aggregation functions like SUM, COUNT, or AVERAGE to add data within each group
Examples: Grouping sales data by region and calculating total sales for each region
Examples: Grouping student data by grade level and calculating average test scores for each grade
Q94. what is mean 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
Used to define a common interface for subclasses
Q95. What is OOPs in programming.
OOPs stands for Object-Oriented Programming, a programming paradigm based on the concept of objects.
OOPs focuses on creating objects that contain data and methods to manipulate that data.
Encapsulation, inheritance, and polymorphism are key principles of OOPs.
Examples of OOP languages include Java, C++, and Python.
Q96. 1. What are microservices
Microservices are small, independent, and modular services that work together to form a larger application.
Microservices are designed to be loosely coupled and independently deployable.
Each microservice performs a specific task and communicates with other microservices through APIs.
Microservices allow for greater flexibility, scalability, and resilience in software development.
Examples of companies that use microservices include Netflix, Amazon, and Uber.
Q97. Find duplicate word from list of string
Find duplicate word from list of string
Split the string into words
Use a hash table to keep track of word occurrences
Return the duplicate word(s)
Q98. What are functions and class
Functions and classes are fundamental concepts in object-oriented programming.
Functions are blocks of code that perform a specific task and can be called multiple times.
Classes are blueprints for creating objects, which are instances of a class.
Classes can have attributes (variables) and methods (functions) associated with them.
Example: Function to calculate the area of a circle, Class 'Circle' with attributes 'radius' and methods 'calculate_area'.
Q99. What is nodejs modules
Node.js modules are reusable blocks of code that encapsulate related functionality and can be easily imported into a Node.js application.
Node.js modules help organize code into separate files for better maintainability
Modules can be imported using the 'require' function
Modules can export functions, objects, or variables for use in other parts of the application
Q100. iframes logic in selenium
iframes logic in Selenium involves switching between frames to interact with elements inside them.
Use driver.switchTo().frame() method to switch to a frame by index, name, or WebElement
Use driver.switchTo().defaultContent() to switch back to the main content
Elements inside iframes can be located using regular Selenium locators
More about working at Cognizant
Top HR Questions asked in null
Interview Process at null
Top Associate Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month