Accenture recruits engineering graduates from all across India and mainly hires candidates for two roles — Associate Software Engineer (ASE) and Advanced Associate Software Engineer (AASE).
Accenture’s hiring has three major stages:
Accenture hires through:
They offer two profiles to freshers:
| Role | Salary Package |
|---|---|
| Associate Software Engineer (ASE) | 4.5 LPA |
| Advanced Associate Software Engineer (AASE) | 6.5 LPA |
Note: These packages may vary depending on the company’s financial performance and policies each year.
More than 75% candidates get eliminated here.
The test includes three qualifying sections:
In total, the online assessment lasts around 150 minutes.
Even though cut-off is not declared publicly, 60%+ in all sections is generally safe.
This test evaluates English speaking skills based on:
There are about 20–25 questions with 30 minutes duration.
It is not a qualifying round, but the score becomes crucial if two candidates score equally in other stages.
More than 92% of the remaining candidates get filtered out here.
Accenture conducts a combined interview (Technical + HR), which may last 60–90 minutes.
Topics usually asked:
What is an operator in Python?
Explanation:
Operator is a symbol, which is used on some values and produces an output as a result. Operator works on operands.
Operators are of unary, binary or ternary types depending on the number of operands required.
They include:
What is the use of printf() and scanf() functions?
Explanation:
printf() function displays integer, character, float or string values on the screen.
What is a constraint?
Explanation:
Constraints are limitations on the data type of a given table. Samples of constraints are:
What is a foreign key?
Explanation:
Foreign Key is a key which links 2 tables.
It is a field or a collection of fields in a table that corresponds to the Primary Key of another table.
What is slicing in Python?
Explanation:
Slicing is used to break up a list or tuple.
[start:stop:step]What is the static variable? What is its use?
Explanation:
A variable which is declared static is known as a static variable. These variables retain their value between function calls.
Syntax: static int y = 10;
Static variables are accessible from anywhere in the program and are shared by all methods.
What do you like most about the IT industry? What do you enjoy the least about it?
Explanation:
Mention the features of IT that you like. Example: opportunity to work with emerging technologies.
Also mention the aspects that you wish would change.
What is the use of ‘this’ keyword in Java?
Explanation:
‘this’ keyword refers to the current object. It is used to invoke the current class method or constructor, and is also passed as an argument to methods/constructors.
Do you have any technical certifications?
Explanation:
If you have mentioned certifications, the interviewer will ask this.
Explain your training, projects, workshops, webinars etc.
Include only job-relevant certifications and relate them to the job.
What was the recent technical project you worked on? What were your key responsibilities?
Explanation:
Behavioral question — answer using STAR method.
If your project includes technologies from the job description, highlight that.
Focus more on responsibilities or challenges if specifically asked.
What is a NULL pointer and far pointer?
Explanation:
Null Pointer — pointer that refers to no address; assigned value 0.
Far Pointer — pointer that can access all 16 segments (full memory space of RAM). It is a 32-bit pointer.
What are tables, fields and records?
Explanation:
What is a query?
Explanation:
A query is a request for information from a database. A DB query is code written to retrieve data.
What is method overloading?
Explanation:
It is a polymorphism technique that allows multiple methods with the same name but different signatures.
What is JVM, JDK and JRE?
Explanation:
What is DBMS?
Explanation:
DBMS stands for Database Management System. It performs creation, maintenance and usage of a database.
What is a pointer in C? What are its uses?
Explanation:
A pointer is a variable storing the address of another value.
Syntax: data_type *p;
Uses: accessing array elements, passing reference to functions.
What do you do to improve your technical skills?
Explanation:
Mention:
What is Python swapcase() function?
Explanation:
It converts uppercase characters to lowercase and vice-versa and returns a new modified copy of the string.
What is an infinite loop?
Explanation:
A loop that executes continuously for an indefinite number of times.
What is the difference between call by value and call by reference in C?
Explanation:
(No change — same explanation expected as provided.)
What is a command line argument?
Explanation:
The argument passed to the main() function while executing a program.
How can you restrict inheritance?
Explanation:
What are lists and tuples?
Explanation:
Both are sequence data types.
Lists → [] (mutable)
Tuples → () (immutable)
What is a production deployment process?
Explanation:
Deployment is the step-by-step method to make an application ready.
Models: Waterfall, Iterative, Agile, or a mix.
Explain your preferred process to the interviewer.
How many programming languages do you know?
Explanation:
Tell the languages listed in your resume and rate yourself realistically.
If you rate yourself high, you may be asked advanced questions on that language.
What is static method and static variable?
Explanation:
They are shared by all objects of a class. Their static nature originates from the class, not the object.
What is a unique key?
Explanation:
A unique key uniquely identifies each record in the database.
What is ACID property?
Explanation:
What is a Python decorator?
Explanation:
A powerful meta-programming tool that adds functionality to existing code without modifying it.
What is Recursion in C?
Explanation:
A function calling itself.
Two phases:
What is pass in Python?
Explanation:
A null operation used as a placeholder for code yet to be written.
What is a dangling pointer? How is it overcome?
Explanation:
Pointer referring to deallocated memory.
Solution: assign NULL after freeing memory.
What is SQL?
Explanation:
SQL stands for Structured Query Language. It is used to communicate with & manipulate a database.
What is an object and class?
Explanation:
Object: collection of methods & properties.
Class: blueprint used to create objects.
What is the extent of your technical expertise?
Explanation:
Rate your skills and mention technologies you know.
Include trending tech like ML, AI, AWS if true — don’t lie.
Why is a solution design document important?
Explanation:
It contains project details before implementation and aligns the team with a unified plan.
What is interpreted language?
Explanation:
Executes statements line-by-line without a separate compilation step.
What is Python “self”?
Explanation:
Self refers to the current instance of a class and is passed as the first parameter to methods.
What is the break statement used for?
Explanation:
It terminates the current loop and transfers control outside the block.
What is the difference between Python lists and arrays?
Explanation:
| Feature | Python List | Array |
|---|---|---|
| Data Type | Can store different data types in the same list (e.g., int, string, float) | Stores same data type only |
| Module | Built-in (no import needed) | Requires import (array module or NumPy) |
| Memory | Uses more memory | Uses less memory |
| Speed | Slower for numerical operations | Faster for numerical/calculation tasks |
| Use Case | General-purpose collection | Best for mathematical and large numeric data |
Can we compile a program without the main() function?
Explanation:
Yes, it compiles but does not execute.
Using #define, a program can execute without writing main() explicitly.
What is a relationship in DBMS and what are its types?
Explanation:
Relationship connects tables. Types:
What do you keep in mind while solving a technical problem — business, user or yourself?
Explanation:
Explain who the product is being built for and justify your answer.
What is Python slicing?
Python slicing is a technique used to extract a part (portion) of a list, string, tuple, or any sequence by specifying a start, end, and an optional step.
sequence[start : end : step]
step → gap between elements (optional)
start → index where slicing begins
end → index where slicing stops (end is not included)
What is DELETE vs TRUNCATE?
Explanation:
WHERE condition.Identity counter resets (auto-increment starts from beginning).
Removes all rows from a table (cannot delete selected rows).
Very fast because it deallocates data pages instead of row-by-row deletion.
Cannot be rolled back in most DBMS once executed.
Triggers do not fire.
Give an example of applying technical knowledge practically.
Explanation:
Behavioral question — answer using STAR method and share a project where you implemented your skills.
What is the ACID property?
ACID property ensures reliable database transactions through Atomicity, Consistency, Isolation, and Durability.
What is an infinite loop?
An infinite loop is a loop that runs endlessly because its terminating condition is never met.
What is the Python decorator?
A Python decorator is a function that modifies or adds extra functionality to another function without changing its actual code.
What is platform independence in Java?
Explanation:
Java is platform-independent because its bytecode can run on any system regardless of OS.
What are access modifiers in Java?
Explanation:
Keywords that restrict access to class elements:
What is enumeration?
Explanation:
An interface used to access elements of an original data structure.
What is the final variable in Java?
Explanation:
The final variable cannot be modified once assigned.
What is SDLC?
Answer:
SDLC stands for software development Life Cycle is a model used in project management to design, develop and test high quality softwares. It is also Known as the application development life-cycle. SDLC includes following phases — Planning, Analysis, Design, Development, Testing, Implementation, Maintenance.
What functions are used for dynamic memory allocation in C language?
Answer:
Basically, the concept of dynamic memory allocation in C language enables the programmer to allocate memory at runtime. Its memory can be increased while executing program. Dynamic memory allocation is possible by four functions of stdlib.h header file which are malloc(), calloc(), realloc(), free().
What is the difference between the local variable and global variable in C?
Answer:
In C:
Local variables are declared inside a function/block, stored in stack memory, and can be accessed only within that function/block.
Global variables are declared outside all functions, stored in global memory, and can be accessed by any function in the program.
What is the first object-oriented programming language?
Answer:
First object oriented programming language is Simula.
What is a deadlock condition in multithreading?
Answer:
When each process is holding a resource and waiting for another resource acquired by some other process this situation is known as a deadlock condition. Deadlock is a condition in which two or more threads are blocked forever, waiting for each other.
What are the features of the C language?
Answer:
Features of C Programming language are as follows: Procedural Language, Fast and Efficient, Modularity, Statically Type, General-Purpose Language, Rich set of built-in Operators, Libraries with rich Functions, Middle-Level Language, Portability, Easy to Extend.
What is an infinite loop?
Answer:
An infinite loop is a piece of code that keeps running forever as the terminating condition is never reached.
Why is Java called platform independent?
Answer:
Java is called a platform independent language because of the JVM. The byte code (.class file) generated after compilation runs on any operating system, but each OS has its own JVM — making Java platform independent.
What is a checked and unchecked exception?
Answer:
Checked exceptions are checked at compile time; the method must either handle them or declare using the throws keyword. Unchecked exceptions occur at runtime (RuntimeException and Error). In C++, all exceptions are unchecked.
What is encapsulation in Java?
Answer:
It’s a process of wrapping code and data together into a single unit — like a capsule that contains many medicines.
What is recursion in C?
Answer:
Recursion is a technique where a function calls itself repeatedly until a specific terminating condition is reached. The function that does this is called a recursive function.
What is “Collection Framework” in Java?
Answer:
It is a set of prepackaged data structures and algorithms for manipulating those data structures. It reduces programming effort and helps focus on logic building.
What are the reasons behind the occurrence of an exception?
Answer:
An exception is thrown when:
What is the maximum length of an identifier?
Answer:
The maximum length of an identifier is 79 characters.
Differentiate between class and object.
Answer:
Class is a blueprint or template that defines properties and behaviors (variables and methods), whereas an Object is an instance created from that class which actually uses those properties and behaviors.
What is the recursion in C?
Answer:
Recursion in C is a programming technique where a function calls itself repeatedly until a specified base condition is reached.
What are the keywords “super” and “this” in Java?
Answer:super refers to the parent class object and can be used to access parent variables, methods, and constructors. this refers to the current class object and can be used to access current class variables, methods, constructors, and return the current instance.
What is the newline escape sequence?
Answer:
The escape sequence for newline is “\n”.
How delete [] is different from delete?
Answer:delete deallocates memory and calls destructor for a single object created with new.delete[] deallocates memory and calls destructors for an array of objects created with new[].
What is “Diamond problem” in Java? How can it be removed?
Answer:
When two superclasses of a class have a common base class, it forms a diamond problem. Java avoids it by not supporting multiple class inheritance. Default methods & interfaces and virtual inheritance solve diamond problems.
What do you understand about runtime polymorphism?
Answer:
Runtime polymorphism (dynamic method dispatch) is when the call to an overridden method is resolved at runtime based on the object referenced by the superclass reference variable.
Can we compile a program without the main() function?
Answer:
Yes. Even though main() is the entry point for program execution, the system first calls _start(), which then calls main().
Differentiate between Collection and array.
Answer:
| Feature | Array | Collection |
|---|---|---|
| Size | Fixed size (cannot grow or shrink) | Dynamic size (can grow or shrink at runtime) |
| Data Type | Stores elements of same data type | Can store different data types depending on collection type |
| Memory | Memory allocated at compile time | Memory allocated at runtime |
| Performance | Faster because of fixed size and continuous memory | Slightly slower because of dynamic nature and internal processing |
| Built-in Methods | Very few inbuilt functions | Provides many inbuilt methods like add, remove, sort, search, etc. |
| Flexibility | Less flexible | Highly flexible |
| Example | int arr[5]; | ArrayList list = new ArrayList(); |
What do you understand about Exception Handling?
Answer:
Exception handling is a mechanism to handle runtime errors so that the normal flow of the application continues without interruption.
What is the “auto” keyword in C?
Answer:
An auto keyword defines a local variable storage class whose lifetime lasts only till the end of its enclosing scope.
What is call by value and call by reference?
Answer:
Call by value copies the actual value to the function parameters; call by reference passes the memory address of the variable instead of value.
What is the OOPs concept?
Answer:
Object-oriented programming allows software design using objects and classes and includes concepts like Object, Class, Inheritance, Polymorphism, Abstraction, and Encapsulation.
How can you differentiate between method overloading and method overriding?
Answer:
| Feature | Method Overloading | Method Overriding |
|---|---|---|
| Definition | Same method name with different parameters in the same class | Same method name with same parameters in parent and child class |
| Concept | Compile-time polymorphism | Runtime polymorphism |
| Class Involved | Happens within the same class | Happens between superclass and subclass |
| Parameters | Must be different (type, number, or order) | Must be same as parent class |
| Return Type | Can be same or different | Must be same or covariant |
| Purpose | To increase method flexibility | To change/extend parent class method behavior |
| Example | add(int a, int b) and add(double x, double y) in same class | Child class redefining display() method of parent class |
What is an abstract class in Java?
Answer:
An abstract class cannot be instantiated and may or may not include abstract methods. It is used to be subclassed instead of directly creating objects.
What is an overflow error?
Answer:
When a program receives a value outside the limit of what it can store or handle, leading to inaccurate or impossible calculation results.
Examine the array arr[] comprising N distinct integers. Your objective is to determine whether the array remains sorted after undergoing a counter-clockwise rotation. It is imperative to note that a conventionally sorted array, without any rotations, does not qualify as sorted and rotated in this context. In essence, ascertain the presence of at least one rotation for the array to be considered as sorted and rotated.
Example:
Input: arr[] = { 3, 4, 5, 1, 2 }
Output: true
Explanation:
Sorted array: {1, 2, 3, 4, 5}.
Rotating this sorted array clockwise
by 3 positions, we get: { 3, 4, 5, 1, 2}
Input: arr[] = {7, 9, 11, 12, 5}
Output: true
Within a collection of strings, your task is to employ Binary Search to identify the longest common prefix. Devise a solution that efficiently determines the shared prefix among the given strings, utilizing the principles of Binary Search.
Example:
Input: strings = [“flower”, “flow”, “flight”]
Output: Longest Common Prefix: ‘fl’
Determine the methodology to identify a peak element within a given 2D Array or Matrix. Develop an algorithm that can effectively pinpoint a peak element in the matrix, adhering to the specified task requirements.
Example:
Input: [[10 20 15], [21 30 14], [7 16 32]]
Output: 1, 1
Input: [[10 7], [11 17]]
Output : 1, 1
In the context of a sorted and rotated array containing duplicate elements, your objective is to devise an algorithm capable of efficiently identifying a specified element within the rotated array. The algorithm is required to achieve this task with a time complexity of O(log n). Additionally, it is important to output the index where the key exists, and if there are multiple valid answers, any of them can be printed. Design a solution that meets these criteria and successfully locates the specified element in the given rotated array.
Example:
Input: arr[] = {3, 3, 3, 1, 2, 3}, key = 3
Output: 0
arr[0] = 3
Input: arr[] = {3, 3, 3, 1, 2, 3}, key = 11
Output: -1
11 is not present in the given array.
Consider a mountain array, denoted as arr[], and an integer X. Your assignment is to formulate an algorithm to determine the smallest index of X within the given mountain array. In cases where no such index is identified, the output should be -1. Develop a solution that effectively locates the specified integer in the mountain array and prints the smallest index if found; otherwise, outputs -1.
Example:
Input: arr = {1, 2, 3, 4, 5, 3, 1}, X = 3
Output: 2
Explanation:
The smallest index of X(= 3) in the array is 2.
Therefore, the required output is 2.
Input: arr[] = {0, 1, 2, 4, 2, 1}, X = 3
Output: -1
Explanation: Since 3 does not exist in the array, the required output is -1.
In the context of two sorted arrays, namely a[] and b[], with N and M elements, the objective is to devise an algorithm to determine the median of the combined array. Your task is to formulate a solution that efficiently computes the median, considering the total number of elements in both arrays. Develop an algorithm that accurately identifies the median of the merged sorted arrays, with N and M denoting the number of elements in the respective arrays.
Example:
Input: a[] = {-5, 3, 6, 12, 15}, b[] = {-12, -10, -6, -3, 4, 10}
Output: The median is 3.
Explanation: The merged array is: ar3[] = {-12, -10, -6, -5 , -3, 3, 4, 6, 10, 12, 15}.
So the median of the merged array is 3
Input: a[] = {2, 3, 5, 8}, b[] = {10, 12, 14, 16, 18, 20}
Output: The median is 11.
Explanation : The merged array is: ar3[] = {2, 3, 5, 8, 10, 12, 14, 16, 18, 20}
If the number of the elements are even. So there are two middle elements.
Take the average between the two: (10 + 12) / 2 = 11.
In an examination scenario, you are presented with K sorted arrays, each of size N. Your assignment is to develop an algorithm for merging these arrays into a single sorted output. Formulate a solution that efficiently merges the K sorted arrays and produces the final sorted result. Provide the code for your algorithm along with the necessary explanation, demonstrating your ability to handle and manipulate sorted arrays in a merging context.
Example:
Input: K = 3, N = 4, arr = { {1, 3, 5, 7}, {2, 4, 6, 8}, {0, 9, 10, 11}}
Output: 0 1 2 3 4 5 6 7 8 9 10 11
Explanation: The output array is a sorted array that contains all the elements of the input matrix.
You are presented with k sorted arrays, each possessing varying lengths. Your task is to devise an algorithm that effectively merges these arrays into a singular array, ensuring that the resulting merged array maintains a sorted order. Formulate a solution that efficiently handles arrays of different lengths, demonstrating your ability to merge and maintain sorted order in the merged array. Provide the corresponding code, along with a clear explanation of your algorithm.
Example:
Input : {{3, 13},
{8, 10, 11}
{9, 15}}
Output : {3, 8, 9, 10, 11, 13, 15}
Input : {{1, 5},
{2, 3, 4}}
Output : {1, 2, 3, 4, 5}
You are presented with K sorted linked lists, each comprising N elements. Your assignment is to develop an algorithm capable of merging all these linked lists while preserving their sorted order. Devise a solution that efficiently handles the merging of K sorted linked lists, showcasing your ability to maintain the overall sorted order in the merged linked list. Additionally, provide a well-documented example illustrating the input and output of your algorithm.
Example:
Input: K = 3, N = 4
list1 = 1->3->5->7->NULL
list2 = 2->4->6->8->NULL
list3 = 0->9->10->11->NULL
Output: 0->1->2->3->4->5->6->7->8->9->10->11
Merged lists in a sorted order where every element is greater than the previous element.
Input: K = 3, N = 3
list1 = 1->3->7->NULL
list2 = 2->4->8->NULL
list3 = 9->10->11->NULL
Output: 1->2->3->4->7->8->9->10->11
Merged lists in a sorted order where every element is greater than the previous element.
Write a program to generate two linked lists, L1 and L2, representing sets of elements. Implement functions to compute the union and intersection of these sets and create linked lists, U and I, where U represents the union of elements from L1 and L2, and I represents the intersection of elements present in L1 and L2. Ensure that the order of elements in the output lists is not significant.
Example:
Input:
List1: 10 -> 15 -> 4 -> 20
List2: 8 -> 4 -> 2 -> 10
Output:
Intersection List: 4 -> 10
Union List: 2 -> 8 -> 20 -> 4 -> 15 -> 10
Input:
List1: 1 -> 2 -> 3 -> 4
List2: 3 -> 4 -> 8 -> 10
Output:
Intersection List: 3 -> 4
Union List: 1 -> 2 -> 3 -> 4 -> 8 -> 10
Develop a program to construct a linked list that captures the disparity between two given linked lists. Specifically, create a linked list to store the elements present in the first linked list but absent in the second linked list. Ensure the order of elements in the resultant list is not a determining factor.
Example:
Input:
List1: 10 -> 15 -> 4 ->20,
List2: 8 -> 4 -> 2 -> 10
Output: 15 -> 20
In the context of a numerical scenario, formulate a program to substitute a specified digit, denoted as d1, with another digit, denoted as d2, in a given number x.
Example:
Input : x = 645, d1 = 6, d2 = 5
Output : 545
We replace digit 6 with 5 in number 645.
Input : x = 746, d1 = 7, d2 = 8
Output : 846
Given an integer N, the task is to check whether the product of digits at even and odd places of a number are equal. If they are equal, print Yes otherwise print No.
Example:
Input: N = 2841
Output: Yes
Product of digits at odd places = 2 * 4 = 8
Product of digits at even places = 8 * 1 = 8
Input: N = 4324
Output: No
Product of digits at odd places = 4 * 2 = 8
Product of digits at even places = 3 * 4 = 12
Compose a program to determine the count of matching digits at corresponding indices in two given numbers, denoted as N and M.
Example:
Input: N = 123, M = 321
Output: 1
Explanation: Digit 2 satisfies the condition
Input: N = 123, M = 111
Output: 1
Design a program to reverse a 32-bit integer, taking into account potential overflow scenarios. If the reversed integer exceeds the 32-bit limit, the program should output -1.
Write a program to compute the N-th root of a given number A. In mathematical terms, determine the real number that, when raised to the power of the integer N, results in the value A.
Example:
Input : A = 81
N = 4
Output : 3
3^4 = 81
Consider an array arr[] of size N and an integer K. Your task is to determine the maximum value for each contiguous subarray of size K.
Write a function or algorithm to efficiently solve this problem.
Example:
Input:
Array: [1, 3, 4, 2, 6, 7]
K: 3
Output:
Maximum Values: [4, 4, 6, 7]
You are given an array Arr[] of N integers. Your task is to identify the contiguous sub-array (containing at least one number) with the maximum sum and return its sum.
Write a function or algorithm to efficiently solve this problem.
Example:
Input:
Array: [-2, 1, -3, 4, -1, 2, 1, -5, 4]
Output:
Maximum Sum: 6
Explanation:
The contiguous sub-array [4, -1, 2, 1] has the maximum sum, which is 6.
You are given an array Arr[] of N integers. Your task is to identify the contiguous sub-array (containing at least one number) with the maximum sum and return its sum.
Write a function or algorithm to efficiently solve this problem.
Example:
Input:
Array: [-2, 1, -3, 4, -1, 2, 1, -5, 4]
Output:
Maximum Sum: 6
Explanation:
The contiguous sub-array [4, -1, 2, 1] has the maximum sum, which is 6.
Consider an array of size N-1 containing distinct integers in the range of 1 to N. Your task is to find the missing element in the array.
Write a function or algorithm to efficiently solve this problem.
Example:
Input:
Array: [1, 2, 4, 6, 3, 7, 8]
Output:
Missing Element: 5
Explanation:
The missing element in the array is 5.
Develop a program to arrange an unsorted array of integers into a wave array. An array arr[0..n-1] is considered in wave form if it satisfies the condition:
arr[0] >= arr[1] <= arr[2] >= arr[3] <= arr[4] >= …..
Example:
Input: arr[] = {10, 5, 6, 3, 2, 20, 100, 80}
Output: arr[] = {10, 5, 6, 2, 20, 3, 100, 80}
Input: arr[] = {20, 10, 8, 6, 4, 2}
Output: arr[] = {20, 8, 10, 4, 6, 2}
Formulate a program to sort a binary array with the objective of minimizing the number of swaps. The program should adhere to the constraint that only adjacent elements are permissible for swapping.
Example:
Input : [0, 0, 1, 0, 1, 0, 1, 1]
Output : 3
1st swap : [0, 0, 1, 0, 0, 1, 1, 1]
2nd swap : [0, 0, 0, 1, 0, 1, 1, 1]
3rd swap : [0, 0, 0, 0, 1, 1, 1, 1]
Input : Array = [0, 1, 0, 1, 0]
Output : 3
Create an algorithm to efficiently sort an array of N elements, considering that each element is at most K positions away from its target position. The algorithm should achieve a time complexity of O(N log K).
Example:
Input: arr[] = {6, 5, 3, 2, 8, 10, 9}, K = 3
Output: arr[] = {2, 3, 5, 6, 8, 9, 10}
Input: arr[] = {10, 9, 8, 7, 4, 70, 60, 50}, k = 4
Output: arr[] = {4, 7, 8, 9, 10, 50, 60, 70}
Develop a program to determine whether an array, consisting of both positive and negative numbers, contains a subarray (of minimum size one) with a sum equal to zero.
Example:
Input: {4, 2, -3, 1, 6}
Output: true
Explanation:
There is a subarray with zero sum from index 1 to 3.
Input: {4, 2, 0, 1, 6}
Output: true
Explanation: The third element is zero. A single element is also a sub-array.
Create a program to identify the index of the first repeating element in an array of integers, where the first occurrence of the repeating element has the smallest index.
Example:
Input: arr[] = {10, 5, 3, 4, 3, 5, 6}
Output: 5
Explanation: 5 is the first element that repeats
Input: arr[] = {6, 10, 5, 4, 9, 120, 4, 6, 10}
Output: 6
Explanation: 6 is the first element that repeats
Develop a program to determine the minimum number of times a given string A needs to be repeated such that another string B becomes a substring of it. If no solution exists, the program should output -1.
Example:
Input : A = “abcd”, B = “cdabcdab”
Output : 3
Repeating A three times (“abcdabcdabcd”), B is a substring of it. B is not a substring of A when it is repeated less than 3 times.
Input : A = “ab”, B = “cab”
Output : -1
Create a program to capitalize the first and last characters of each word in a given string.
Develop a program to calculate the sum of the minimum absolute differences within a given array.
Example:
Input: arr[]={2, 4, 5, 3};
Output: Minimum Absolute Difference Sum is 4
Create a program to identify all pairs of integers in an array whose sum equals a given target number.
Example:
Input: arr[] ={10, 12, 10, 15, -1, 7, 6, 5, 4, 2, 1, 1, 1}
Output: Count of pairs is 9
Formulate a program to identify the first non-repeating element in an array of integers of size N.
Example:
Input: {-1, 2, -1, 3, 0}
Output: 2
Explanation: The first number that does not repeat is : 2
Input: {9, 4, 9, 6, 7, 4}
Output: 6