TCS
50+ Axis Max Life Insurance Interview Questions and Answers
Q1. Palindromic Numbers Finder
Given an integer 'N', your task is to identify all palindromic numbers from 1 to 'N'. These are numbers that read the same way forwards and backwards.
Input:
The first line provides a...read more
Implement a function to find all palindromic numbers from 1 to N.
Iterate from 1 to N and check if each number is a palindrome
Use string manipulation to check for palindromes
Consider edge cases like single-digit numbers and 11
Q2. Strings of Numbers Problem Statement
You are given two integers 'N' and 'K'. Consider a set 'X' of all possible strings of 'N' number of digits where all strings only contain digits ranging from 0 to 'K' inclus...read more
The task is to find a string of minimal length that includes every possible string of N digits with digits ranging from 0 to K as substrings.
Generate all possible strings of N digits with digits from 0 to K
Concatenate these strings in a way that all are substrings of the final string
Return 1 if the final string contains all possible strings, else return 0
Q3. Maximum Vehicle Registrations Problem
Bob, the mayor of a state, seeks to determine the maximum number of vehicles that can be uniquely registered. Each vehicle's registration number is structured as follows: S...read more
Calculate the maximum number of unique vehicle registrations based on given constraints.
Parse input for number of test cases, district count, letter ranges, and digit ranges.
Calculate the total number of unique registrations based on the given constraints.
Output the maximum number of unique vehicle registrations for each test case.
Q4. Diagonal Sum of Binary Tree
You are given a binary tree with 'N' nodes. Your task is to find and return a list containing the sums of all the diagonals of the binary tree, computed from right to left.
Input:
Th...read more
Find and return the sums of all diagonals of a binary tree from right to left.
Traverse the binary tree level by level and keep track of the diagonal sums using a hashmap.
Use a queue to perform level order traversal of the binary tree.
For each node, update the diagonal sum based on its level and position in the diagonal.
Return the diagonal sums in reverse order from rightmost to leftmost diagonal.
Longest Switching Subarray Problem Statement
You are provided with an array 'ARR' consisting of 'N' positive integers. Your task is to determine the length of the longest contiguous subarray that is switching.
Find the length of the longest contiguous subarray where elements at even indices are equal and elements at odd indices are equal.
Iterate through the array and keep track of the length of the current switching subarray.
Update the length when the switching condition is broken.
Return the maximum length found for each test case.
Q6. Jar of Candies Problem Statement
You are given a jar containing candies with a maximum capacity of 'N'. The jar cannot have less than 1 candy at any point. Given 'K', the number of candies a customer wants, det...read more
Given a jar of candies with a maximum capacity, determine the number of candies left after providing the desired count to a customer.
Check if the number of candies requested is valid (less than or equal to the total number of candies in the jar)
Subtract the number of candies requested from the total number of candies in the jar to get the remaining candies
Return the remaining candies or -1 if the request is invalid
Q7. Shuffle Two Strings
You are provided with three strings: A
, B
, and C
. Your task is to determine if C
is formed by interleaving A
and B
. A string C
is considered an interleaving of A
and B
if:
- The length of
C
i...read more
Determine if a string C is formed by interleaving two strings A and B.
Check if the length of C is equal to the sum of lengths of A and B.
Ensure all characters of A and B are present in C.
Verify that the order of characters in C matches the order in A and B.
Q8. Add Two Numbers Represented as Linked Lists
Given two linked lists representing two non-negative integers, where the digits are stored in reverse order (i.e., starting from the least significant digit to the mo...read more
Add two numbers represented as linked lists in reverse order and return the sum as a linked list.
Traverse both linked lists simultaneously, adding corresponding digits and carrying over if necessary.
Handle cases where one list is longer than the other by considering carry over.
Create a new linked list to store the sum digits in reverse order.
Return the head of the new linked list as the result.
Q9. Factorial Calculation Problem
Given an integer N
, determine the factorial value of N
. The factorial of a number N
is the product of all positive integers from 1 to N
.
Input:
First line of input: An integer 'T',...read more
Calculate the factorial of a given integer N.
Iterate from 1 to N and multiply each number to get the factorial value.
Handle edge cases like N=0 or N=1 separately.
Use recursion or iteration to calculate the factorial value.
Q10. Distance Greater Than K Problem Statement
You are provided an undirected graph, a source vertex, and an integer k
. Determine if there is any simple path (without any cycle) from the source vertex to any other v...read more
Check if there is a path from source vertex to any other vertex with distance greater than k in an undirected graph.
Use Depth First Search (DFS) to traverse the graph and keep track of the distance from the source vertex.
If at any point the distance exceeds k, return true.
If DFS traversal completes without finding a path with distance greater than k, return false.
Q11. Middle of a Linked List
You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.
If there is an odd number of elements, return the middle ...read more
Return the middle element of a singly linked list, or the one farther from the head node in case of even number of elements.
Traverse the linked list using two pointers, one moving at twice the speed of the other.
When the faster pointer reaches the end, the slower pointer will be at the middle.
Return the element pointed to by the slower pointer.
Q12. Smallest Number with Given Digit Product
Given a positive integer 'N', find and return the smallest number 'M', such that the product of all the digits in 'M' is equal to 'N'. If such an 'M' is not possible or ...read more
Find the smallest number with given digit product equal to a positive integer N.
Iterate from 2 to 9 and find the smallest digit that divides N, then add it to the result.
Repeat the process until N is reduced to 1 or a prime number.
If N cannot be reduced to 1 or a prime number, return 0.
Q13. Prime Time Again Problem Statement
You are given two integers DAY_HOURS
and PARTS
. Consider a day with DAY_HOURS
hours, which can be divided into PARTS
equal parts. Your task is to determine the total instances...read more
Given DAY_HOURS and PARTS, find total instances of equivalent prime groups in a day divided into equal parts.
Divide the day into equal parts and check for prime groups at the same position in different parts.
Each prime group consists of prime numbers occurring at the same position in different parts.
Return the total number of equivalent prime groups found.
Ensure DAY_HOURS is divisible by PARTS and each hour in a prime group is in a different part.
Q14. Find Duplicates in an Array
Given an array ARR
of size 'N', where each integer is in the range from 0 to N - 1, identify all elements that appear more than once.
Return the duplicate elements in any order. If n...read more
Find duplicates in an array of integers within a specified range.
Iterate through the array and keep track of the count of each element using a hashmap.
Return elements with count greater than 1 as duplicates.
Time complexity can be optimized to O(N) using a set to store duplicates.
Example: For input [0, 3, 1, 2, 3], output should be [3].
Q15. Reverse Array Elements
Given an array containing 'N' elements, the task is to reverse the order of all array elements and display the reversed array.
Explanation:
The elements of the given array need to be rear...read more
Reverse the order of elements in an array and display the reversed array.
Iterate through the array from both ends and swap the elements until the middle is reached.
Use a temporary variable to store the element being swapped.
Print the reversed array after all elements have been swapped.
Q16. Cycle Detection in a Singly Linked List
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the list. T...read more
Detect if a singly linked list forms a cycle by checking if a node's next points back to a previous node.
Use Floyd's Cycle Detection Algorithm to determine if there is a cycle in the linked list.
Maintain two pointers, one moving at twice the speed of the other, if they meet at some point, there is a cycle.
If one of the pointers reaches the end of the list (null), there is no cycle.
Cut the cake horizontally into two equal halves, then cut one of the halves vertically in the middle.
First, cut the cake horizontally into two equal halves.
Next, cut one of the halves vertically in the middle.
You will now have three equal pieces of cake.
Example: Cut the cake horizontally into two halves, then cut one half vertically in the middle.
An operating system is a software that manages computer hardware and provides services for computer programs.
An operating system is the most important software that runs on a computer.
It manages the computer hardware and provides common services for computer programs.
Examples of operating systems include Windows, macOS, Linux, and Unix.
A process table is a data structure used by the operating system to manage information about all running processes.
It typically includes detai...read more
SQL query to output data of students whose names start with 'A'.
Use SELECT statement to retrieve data from the table.
Use WHERE clause with LIKE operator to filter names starting with 'A'.
Example: SELECT * FROM students WHERE name LIKE 'A%';
Q20. how is multithreading implemented in JAVA
Multithreading in Java allows concurrent execution of multiple threads.
Java provides built-in support for multithreading through the java.lang.Thread class.
Threads can be created by extending the Thread class or implementing the Runnable interface.
The start() method is used to start a new thread, which calls the run() method.
Synchronization mechanisms like synchronized blocks and locks can be used to control access to shared resources.
Java also provides high-level concurrency...read more
Q21. how wil you dispaly data of two tables? explain?
Display data of two tables by joining them using a common column.
Use SQL JOIN statement to combine data from two tables based on a common column.
Choose the appropriate type of JOIN based on the relationship between the tables.
Specify the columns to be displayed in the SELECT statement.
Use aliases to differentiate between columns with the same name in both tables.
Apply any necessary filters or sorting to the result set.
Q22. what is the difference between method and block.
Method is a named block of code that can be called multiple times, while a block is a group of statements enclosed in curly braces.
A method has a name and can accept parameters, while a block does not.
A method can return a value, while a block cannot.
A method can be called from anywhere in the program, while a block is only accessible within the scope it was defined.
Example of a method: public int add(int a, int b) { return a + b; }
Example of a block: if (condition) { int x =...read more
Q23. what is variable and types of variable.
A variable is a container that holds a value. There are different types of variables in programming.
Variables are used to store data in a program
They can be assigned different values during runtime
Types of variables include integers, floats, strings, booleans, and more
Variables can be declared with a specific data type or left untyped
Examples: int age = 25, float price = 9.99, string name = 'John Doe'
Q24. What is the use of circular linked list
Circular linked list is a linked list where the last node points back to the first node, forming a circle.
Allows for efficient traversal from the end of the list to the beginning
Useful for applications where data needs to be accessed in a circular manner, such as round-robin scheduling
Can be used to implement a circular buffer in data structures
Q25. Multithreading and servlets in Java
Multithreading and servlets are important concepts in Java for concurrent programming and web development.
Multithreading allows multiple threads to run concurrently, improving performance and responsiveness of applications.
Servlets are Java classes that handle HTTP requests and generate responses, used for web development.
Multithreading can be used in servlets to handle multiple requests simultaneously.
However, care must be taken to ensure thread safety and avoid race conditi...read more
Q26. From Java what is friend function
Friend function is not a concept in Java.
Friend function is a concept in C++ where a non-member function can access private and protected members of a class.
Java does not have the concept of friend function.
In Java, access to private and protected members of a class is restricted to the class itself and its subclasses.
Q27. What are the 4 basic principles of OOPS?
The 4 basic principles of OOPS are Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction: Hiding complex implementation details and showing only necessary information.
Encapsulation: Binding data and functions together and restricting access to them.
Inheritance: Creating new classes from existing ones, inheriting properties and methods.
Polymorphism: Ability of objects to take on multiple forms or behaviors.
Q28. What's class and object?
A class is a blueprint for creating objects in object-oriented programming. An object is an instance of a class.
A class defines the properties and behaviors of objects.
An object is a specific instance of a class.
Classes can be thought of as templates, while objects are the actual instances created from those templates.
Example: Class 'Car' may have properties like 'color' and 'model', while an object of class 'Car' could be 'red Ferrari'.
Q29. Difference between power pivot and powet query
Power Pivot is used for data modeling and analysis while Power Query is used for data transformation and cleaning.
Power Pivot is an Excel add-in used for creating data models and performing complex analysis.
Power Query is also an Excel add-in used for data transformation and cleaning before analysis.
Power Pivot can handle large amounts of data and create relationships between tables.
Power Query can extract data from various sources and transform it into a usable format.
Both t...read more
Q30. What is Event Emitter ?
Event Emitter is a class in Node.js that allows objects to subscribe to events and be notified when those events occur.
Event Emitter is a core module in Node.js
It allows multiple objects to listen for and respond to events
Objects can emit events using the 'emit' method
Listeners can be added using the 'on' method
Example: const EventEmitter = require('events');
Q31. Tell me about event loop?
Event loop is a mechanism that allows for asynchronous programming by handling events and callbacks.
Event loop is a single-threaded mechanism used in programming languages like JavaScript to handle asynchronous operations.
It continuously checks the call stack for any functions that need to be executed, and processes them in a non-blocking manner.
Event loop allows for efficient handling of I/O operations, timers, and callbacks without blocking the main thread.
Example: In Node....read more
Q32. How to get the latest version
To get the latest version, check the official website or app store for updates.
Check the official website or app store for updates
Look for release notes or changelogs to see what's new
Consider subscribing to the software's newsletter or social media for announcements
Q33. What is components in angular?
Components in Angular are reusable building blocks that encapsulate HTML, CSS, and TypeScript code.
Components are the basic building blocks of an Angular application
Each component consists of a TypeScript class, an HTML template, and a CSS file
Components help in organizing the application into smaller, reusable pieces
Components can communicate with each other using @Input and @Output decorators
Example: AppComponent is the root component in an Angular application
Q34. Explain the technical
Technical explanation of what?
Please provide more context or specify the topic
Without more information, it's difficult to give a meaningful answer
Q35. Explain the functionality of linked list
Linked list is a data structure that stores elements in a linear order and allows dynamic memory allocation.
Consists of nodes that contain data and a pointer to the next node
Can be singly or doubly linked
Insertion and deletion can be done efficiently
Traversal is slower compared to arrays
Examples: stack, queue, hash table
Q36. What's enum class?
Enum class is a strongly-typed class that defines a set of named constants.
Enum class is introduced in C++11 to provide type-safe enums.
It allows defining a set of named constants that can be used as values.
Each constant in an enum class is treated as a separate type, preventing type mismatches.
Example: enum class Color { RED, GREEN, BLUE };
Example: Color c = Color::RED;
Q37. what are joins in sql
Joins in SQL are used to combine rows from two or more tables based on a related column between them.
Joins are used to retrieve data from multiple tables based on a related column
Common types of joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column
Q38. Tell about dbms .
DBMS stands for Database Management System. It is a software system that allows users to define, create, maintain and control access to databases.
DBMS is used to manage large amounts of data efficiently.
It provides a way to store, retrieve and manipulate data in a structured manner.
It ensures data integrity and security by providing access control and backup and recovery mechanisms.
Examples of DBMS include MySQL, Oracle, SQL Server, and MongoDB.
Q39. How node.js works?
Node.js is a runtime environment that allows you to run JavaScript on the server side.
Node.js uses an event-driven, non-blocking I/O model, making it lightweight and efficient.
It is built on the V8 JavaScript engine from Google Chrome.
Node.js allows you to easily build scalable network applications.
Example: Creating a simple HTTP server in Node.js - const http = require('http'); http.createServer((req, res) => { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hel...read more
Q40. Difference b/w sorting Algorithm
Sorting algorithms arrange data in a specific order.
Bubble Sort: repeatedly swap adjacent elements if they are in the wrong order
Selection Sort: find the smallest element and swap it with the first element, repeat for remaining elements
Insertion Sort: insert each element into its proper place in a sorted subarray
Merge Sort: divide the array into two halves, sort each half, and merge them together
Quick Sort: choose a pivot element, partition the array around the pivot, and rec...read more
Q41. what is oops concept?
OOPs is a programming paradigm based on the concept of objects, which can contain data and code.
OOPs stands for Object-Oriented Programming.
It focuses on creating objects that interact with each other to solve a problem.
It includes concepts like inheritance, encapsulation, polymorphism, and abstraction.
Inheritance allows a class to inherit properties and methods from another class.
Encapsulation is the practice of hiding data and methods within a class.
Polymorphism allows obje...read more
Q42. What is Dax and types
DAX stands for Data Analysis Expressions and is a formula language used in Power BI, Excel, and SQL Server Analysis Services.
DAX is used to create custom calculations and aggregations in data models.
It includes functions for filtering, grouping, and manipulating data.
There are two types of DAX expressions: calculated columns and measures.
Calculated columns are computed during data model creation and are stored in the model.
Measures are computed on the fly during query executi...read more
Q43. Why use javascript
JavaScript is a versatile programming language used for web development, allowing for dynamic and interactive website functionality.
JavaScript is the only programming language that can be executed directly in a web browser, making it essential for front-end web development.
It enables the creation of interactive elements like forms, animations, and dynamic content on websites.
JavaScript can be used for both client-side and server-side development, making it a versatile languag...read more
Q44. Why use java script
JavaScript is a versatile programming language used for creating interactive web pages and web applications.
JavaScript allows for dynamic and interactive web content.
It can be used for client-side and server-side development.
JavaScript has a large and active community, with extensive libraries and frameworks available.
It is supported by all major web browsers.
JavaScript can be used for creating games, mobile apps, and desktop applications.
Q45. What is future goal
My future goal is to become a senior software developer and eventually a tech lead, leading a team of developers to create innovative solutions.
Continue learning and improving my technical skills through courses and certifications
Gain experience in different areas of software development such as front-end, back-end, and mobile development
Work on challenging projects that push my limits and allow me to grow as a developer
Q46. What is build in jcl
Build in JCL is a job control language statement used to compile and link programs in mainframe environments.
Build statement is used to compile and link programs in JCL.
It specifies the program to be compiled and linked, as well as any necessary parameters.
Example: //BUILD EXEC PGM=IEBGENER,PARM='INPUT=SYSUT1,OUTPUT=SYSUT2'
Q47. What is build
A build is a version of a software program that is compiled and ready for testing or release.
A build is created by compiling the source code of a software program.
It includes all necessary files and dependencies for the program to run.
Builds can be categorized as debug builds for testing and release builds for distribution.
Examples: Debug build of an app with logging enabled, Release build of a website ready for deployment.
Q48. Swap numbers without temp
Swapping numbers without using a temporary variable.
Use addition and subtraction to swap values
Use XOR operator to swap values
Use multiplication and division to swap values
Q49. Types of dbs etc
There are various types of databases such as relational, NoSQL, graph, and document-oriented databases.
Relational databases store data in tables with predefined relationships between them.
NoSQL databases are non-relational and can handle unstructured data.
Graph databases store data in nodes and edges, and are useful for complex relationships.
Document-oriented databases store data in documents, similar to JSON objects.
Examples include MySQL, MongoDB, Neo4j, and Cassandra.
Q50. Q. explain threads ?
Threads are lightweight processes that enable multitasking within a single process.
Threads share the same memory space as the parent process.
Threads can communicate with each other through shared memory.
Threads can be created and managed using threading libraries in programming languages.
Examples of threading libraries include pthreads in C/C++, and threading module in Python.
Q51. Strengths and goals of mine
My strengths include problem-solving, attention to detail, and teamwork. My goal is to continuously improve my skills and contribute to the success of the company.
Strong problem-solving skills, able to analyze complex issues and find effective solutions
Attention to detail, ensuring accuracy and quality in all work
Collaborative team player, able to communicate effectively and work towards common goals
Goal-oriented mindset, always seeking to improve skills and contribute to com...read more
Q52. C vs c++ difference
C is a procedural programming language while C++ is an object-oriented programming language.
C is a procedural language, focusing on functions and procedures.
C++ is an object-oriented language, allowing for classes, objects, and inheritance.
C++ is an extension of C, adding features like classes, templates, and exception handling.
Q53. Check the output
The code will output 'Hello World!'
The code likely contains a print statement with the text 'Hello World!'
There may be a variable assignment with the value 'Hello World!'
More about working at TCS
Top HR Questions asked in Axis Max Life Insurance
Interview Process at Axis Max Life Insurance
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month