Add office photos
Engaged Employer

SAP

4.2
based on 1.6k Reviews
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

300+ Interview Questions and Answers

Updated 13 Nov 2024
Popular Designations
Q1. Duplicate in array

You are given an array ‘ARR’ of size ‘N’ containing each number between 1 and ‘N’ - 1 at least once. There is a single integer value that is present in the array twice. Your task is to find th...read more

View 4 more answers

Q2. Given a 10 digit number, sort the individual digits of the number.

Ans.

Sort the individual digits of a 10 digit number.

  • Convert the number to a string to access individual digits

  • Use a sorting algorithm to sort the digits

  • Convert the sorted digits back to a number

View 4 more answers
Q3. Reverse Linked List

Given a singly linked list of integers. Your task is to return the head of the reversed linked list.

For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked lis...read more
View 5 more answers
Q4. Multilevel Inheritance

Create a class GrandFather that has a parameterized constructor and a grandFatherName attribute.

Create another class Father that inherits the property of GrandFather and has a parameteriz...read more

Add your answer
Discover null interview dos and don'ts from real experiences
Q5. Longest Substring Without Repeating Characters

Given a string 'S' of length 'L', return the length of the longest substring without repeating characters.

Example:

Suppose given input is "abacb", then the length ...read more
View 5 more answers
Q6. Subset Sum

You are given an array of ‘N’ integers. You have to find the sum of all the subsets in the non-decreasing order of the given array.

For example
If N=3 and array elements are [1,2]. Following are the s...read more
View 3 more answers
Are these interview questions helpful?
Q7. Overlapping Intervals

You have been given the start and end times of 'N' intervals. Write a function to check if any two intervals overlap with each other.

Note :
If an interval ends at time T and another interv...read more
View 3 more answers
Q8. Factorial of a Number

You are given an integer ‘N’. You have to print the value of Factorial of ‘N’. The Factorial of a number ‘N’ is defined as the product of all numbers from 1 to ‘N’.

For Example:
Consider if...read more
View 3 more answers
Share interview questions and help millions of jobseekers 🌟
Q9. Zig-Zag String

You are given a string ‘STR’ of size ‘N’ and an integer ‘M’ (the number of rows in the zig-zag pattern of ‘STR’). Your task is to return the string formed by concatenating all ‘M’ rows when string...read more

View 3 more answers
Q10. Maximum Of All Subarrays Of Size k.

You are given an array consisting of N non-negative integers, and an integer K denoting the length of a subarray, your task is to determine the maximum elements for each subar...read more

View 4 more answers
Q11. Level Order Traversal

You have been given a Binary Tree of integers. You are supposed to return the level order traversal of the given tree.

For example:
For the given binary tree 

Example

The level order traversal wil...read more
View 2 more answers
Q12. Covid Vaccination

We are suffering from the Second wave of Covid-19. The Government is trying to increase its vaccination drives. Ninja wants to help the Government to plan an effective method to help increase v...read more

View 3 more answers
Q13. Longest Increasing Subsequence

'N' students are standing in a row. You are given the height of every student standing in the row. Your task is to find the longest strictly increasing subsequence of heights from ...read more

View 4 more answers
Q14. Find prime numbers

You are given a positive integer ‘N’. Your task is to print all prime numbers less than or equal to N.

Note: A prime number is a natural number that is divisible only by 1 and itself. Example ...read more

View 4 more answers
Q15. Longest Unique Substring

Given a string input of length n, find the length of the longest substring without repeating characters i.e return a substring that does not have any repeating characters.

Substring is t...read more

View 3 more answers
Q16. LCA Of Binary Tree

You have been given a Binary Tree of distinct integers and two nodes ‘X’ and ‘Y’. You are supposed to return the LCA (Lowest Common Ancestor) of ‘X’ and ‘Y’.

The LCA of ‘X’ and ‘Y’ in the bina...read more

View 3 more answers
Q17. Next Permutation

You have been given a permutation of ‘N’ integers. A sequence of ‘N’ integers is called a permutation if it contains all integers from 1 to ‘N’ exactly once. Your task is to rearrange the number...read more

View 3 more answers
Q18. Debugging Question

There is a program which inserts and deletes node in a sorted singly linked list. There is a bug in one of the modules, how would you debug it?

Add your answer
Q19. BFS in Graph

You are given an undirected and disconnected graph G(V, E) having V vertices numbered from 0 to V-1 and E edges. Your task is to print its BFS traversal starting from the 0th vertex.

BFS or Breadth-...read more

View 2 more answers
Q20. Find all anagrams

You have been given a string STR and a non-empty string PTR. Your task is to find all the starting indices of PTR’s anagram in STR.

An anagram of a string is another string which contains the s...read more

View 2 more answers
Q21. Reverse Linked List
Input Format :
The first line of input contains a single integer T, re...read more
View 3 more answers
Q22. What is Linked list and reverse the linked list iteratively.

Given a singly linked list of integers. Your task is to return the head of the reversed linked list.

For example:
The given linked list is 1 -> 2 -> 3...read more
View 6 more answers
Q23. Reverse the String

You are given a string 'STR'. The string contains [a-z] [A-Z] [0-9] [special characters]. You have to find the reverse of the string.

For example:

 If the given string is: STR = "abcde". You h...read more
View 2 more answers
Q24. Middle Of Linked List

Given the head node of the singly linked list, return a pointer pointing to the middle of the linked list.

If there are an odd number of elements, return the middle element if there are eve...read more

View 2 more answers
Q25. Puzzle

Four people need to cross a rickety bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at...read more

Add your answer
Q26. Find uncommon characters of the two strings. Given strings 'str1' and 'str2'. Return a string of characters which are present in either of them but not both.The strings contain only lowercase characters and can...read more
View 3 more answers
Q27. Print Permutations - String

You are given an input string 'S'. Your task is to find and return all possible permutations of the input string.

Note:
1. The input string may contain the same characters, so there w...read more
View 2 more answers
Q28. Binary Pattern

You have been given an input integer 'N'. Your task is to print the following binary pattern for it.

Example

Pattern for 'N' = 4 1111 000 11 0 

The first line contains 'N' 1s. The next line contai...read more

Add your answer
Q29. Boundary Traversal of Binary Tree

You have been given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in Anti-Clockwise direction starting from the root node.

NOTE:
The bo...read more
Add your answer
Q30. Nth Fibonacci Number

Nth term of Fibonacci series F(n), where F(n) is a function, is calculated using the following formula -

 F(n) = F(n-1) + F(n-2), Where, F(1) = F(2) = 1 

Provided N you have to find out the ...read more

View 4 more answers

Q31. How do you tackle something that you can't find a solution to?

Ans.

When faced with an unsolvable problem, I break it down, research, seek help, experiment, and iterate until a solution is found.

  • Break down the problem into smaller, manageable parts

  • Research and gather information related to the problem

  • Seek help from colleagues, online communities, or experts

  • Experiment with different approaches or solutions

  • Iterate and refine the solution based on feedback and results

View 1 answer
Q32. Subarray Sums I

You are given an array of positive integers ‘ARR’ that represents the strengths of different “jutsus” (‘jutsu’ is a Japanese word for art i.e. ninja techniques) that a Ninja knows and can use to ...read more

View 2 more answers

Q33. Discuss a DBMS consisting of college faculty, professors, courses and students.

Ans.

A DBMS for managing college faculty, professors, courses, and students.

  • The DBMS should have tables for faculty, professors, courses, and students.

  • Each table should have appropriate attributes to store relevant information.

  • Relationships can be established between tables using foreign keys.

  • Queries can be used to retrieve information about faculty, professors, courses, and students.

  • The DBMS can be used to track enrollment, grades, and other relevant data.

View 1 answer
Q34. Bubble Sort

Bubble Sort is one of the sorting algorithms that works by repeatedly swapping the adjacent elements of the array if they are not in sorted order.

You are given an unsorted array consisting of N non-...read more

View 2 more answers
Q35. Inorder Successor of a node in Binary Tree. Given a node x. Find it's inorder successor.

You have been given an arbitrary binary tree and a node of this tree. You need to find the inorder successor of this node ...read more

View 3 more answers
Q36. Logic Questions

1. from which point on earth is it that if u move 1 mile south, i mile east, 1 milenorth will u reach the same point (ans = North pole)
2. using 6 matchsticks of same length create 4 equilateral t...read more

Add your answer
Q37. Behavioral questions

After a basic introduction , I was asked all my marks from class 10. He asked many company specific questions like who is the CEO,CTO, name 3 SAP products all to which I had no answer becaus...read more

Add your answer
Q38. Floyd Warshall

You have been given a directed weighted graph of ‘N’ vertices labeled from 1 to 'N' and ‘M’ edges. Each edge connecting two nodes 'u' and 'v' has a weight 'w' denoting the distance between them.

Y...read more

View 2 more answers
Q39. Move All Negative Numbers To Beginning And Positive To End

You are given an array 'ARR' consisting of 'N' integers. You need to rearrange the array elements such that all negative numbers appear before all posit...read more

View 4 more answers
Q40. Sum Of Max And Min

You are given an array “ARR” of size N. Your task is to find out the sum of maximum and minimum elements in the array.

Follow Up:
Can you do the above task in a minimum number of comparisons? ...read more
View 4 more answers
Q41. Puzzle

You are given 3 boxes containing apples, oranges and apples oranges mixed. All boxes are labeled incorrectly. You can open only 1 box. Find out which box will you open to correctly identify the boxes.

Add your answer
Q42. Swap Number Without Temporary Variable

Given two variables ‘X’ and ‘Y’. Your task is to swap the number without using a temporary variable or third variable.

Swap means the value of ‘X’ and ‘Y’ must be interchan...read more

View 5 more answers
Q43. Operating System Questions

Questions about race condition, semaphore, mutex, etc.
Was asked to explain the Reader-Writer problem and write its code.
Also, was asked to explain the conflicts which can happen in thi...read more

Add your answer
Q44. Right View

You have been given a Binary Tree of integers.

Your task is to print the Right view of it.

The right view of a Binary Tree is a set of nodes visible when the tree is viewed from the Right side and the...read more

View 3 more answers

Q45. Write code for LCA in Binary Search Tree.

Ans.

The code for finding the Lowest Common Ancestor (LCA) in a Binary Search Tree (BST).

  • Start from the root node and compare it with the given two nodes.

  • If both nodes are smaller than the current node, move to the left subtree.

  • If both nodes are greater than the current node, move to the right subtree.

  • If one node is smaller and the other is greater, then the current node is the LCA.

  • Continue this process until the LCA is found.

Add your answer
Q46. All Prime Numbers less than or equal to N

You are given a positive integer 'N'. Your task is to return all the prime numbers less than or equal to the 'N'.

Note:

1) A prime number is a number that has only two f...read more
View 4 more answers
Q47. Minimum Number of Platforms

You have been given two arrays, 'AT' and 'DT', representing the arrival and departure times of all trains that reach a railway station.

Your task is to find the minimum number of plat...read more

View 4 more answers
Q48. Total area of overlapping rectangles

You are given two arbitrary rectangles on a 2-D coordinate plane, which may have an intersecting area. You have to find the net area covered by both the rectangles on the car...read more

View 2 more answers
Q49. Remove Duplicates

Ninja is playing with numbers but hates when he gets duplicate numbers. Ninja is provided an array, and he wants to remove all duplicate elements and return the array, but he has to maintain th...read more

View 2 more answers
Q50. Move Zeroes to End

Given an unsorted array of integers, you have to move the array elements in a way such that all the zeroes are transferred to the end, and all the non-zero elements are moved to the front. The...read more

View 2 more answers

Q51. Design a parking lot? Design should include -Logic Flow Diagram -E-R diagram (very important) -DB tables with relations between them, preferably normalized -Commands for transaction with tables

Ans.

Design a parking lot with Logic Flow Diagram, E-R diagram, DB tables with relations, and commands for transactions.

  • Identify the types of vehicles that will use the parking lot

  • Determine the number of parking spaces needed for each vehicle type

  • Create a flow diagram to show the process of entering and exiting the parking lot

  • Design an E-R diagram to show the relationships between entities such as vehicles, parking spaces, and transactions

  • Normalize the DB tables to reduce redundan...read more

Add your answer

Q52. Given an array, sort the zeroes from non zeros for example Input: 1 2 0 0 7 4 42 0 0 0 6 Output: 1 2 7 4 42 6 0 0 0 0 0

Ans.

Sort an array by moving all zeroes to the end.

  • Iterate through the array and move all non-zero elements to the front.

  • Count the number of zeroes encountered and append them at the end of the array.

  • Use two pointers to swap elements and maintain the order.

View 1 answer
Q53. Find middle node of a Linked List

Given the head node of the singly linked list, return a pointer pointing to the middle of the linked list.

If there are an odd number of elements, return the middle element if t...read more

View 3 more answers
Q54. Binary Tree from Parent Array

Given an array parent which represents a binary tree such that parent-child relationship is defined by ('PARENT'[i], 'i') which means that parent of i is 'PARENT'[i]. The value of t...read more

View 3 more answers
Q55. Technical Question

A pair of redundant systems are operating, how would you ensure that when one of them goes down, the other one will take over its operation ?

Add your answer
Q56. Merge Sort

Given a sequence of numbers ‘ARR’. Your task is to return a sorted sequence of ‘ARR’ in non-descending order with help of the merge sort algorithm.

Example :

Merge Sort Algorithm - Merge sort is a Div...read more
View 2 more answers
Q57. Technical Questions

1. How do you think Gmail works?
2. Give me a step by step procedure of how will you download an attachment from an email.

Add your answer
Q58. Puzzle

Heavy and light ball puzzles : You have 2 ball of each A,B,C colors and each color have 1 light and 1 heavy ball. All light balls are of same weight same goes for heavy. Find out weight type of each ball ...read more

Add your answer

Q59. Given a tree, WAP such that a matrix is generated so that: Tree: 1 / 2 3 | / 4 5 6 Matrix: 0 1 2 3 4 5 6 1 0 1 1 1 1 1 2 0 0 0 1 0 0 3 0 0 0 0 1 1 4 0 0 0 0 0 0 5 0 0 0 0 0 0 6 0 0 0 0 0 0

Ans.

WAP to generate a matrix from a given tree.

  • Create a 2D array to store the matrix

  • Traverse the tree and fill the matrix accordingly

  • Use BFS or DFS to traverse the tree

  • The matrix will be symmetric along the diagonal

Add your answer
Q60. Build Heap

You are given an integer array with N elements. Your task is to build a max binary heap from the array.

A max-heap is a complete binary tree in which the value of each internal node is greater than or...read more

View 2 more answers
Q61. Puzzle

There are 25 horses. There are 5 tracks. So at a time, only 5 horses can be raced. What is the minimum number of races to be conducted to decide the winner?

Add your answer
Q62. Uncommon Characters

Given two strings S1 and S2 of lowercase alphabets, find the list of uncommon characters for the two strings.

A character is uncommon if it is present only in one of the strings i.e. it is ei...read more

View 3 more answers
Q63. Remove Duplicates

Given a string S, remove consecutive duplicates from it recursively.

Input Format :
String S 
Output Format :
Output string 
Constraints :
1 <= |S| <= 10^3 where |S| represents the length of s...read more
View 2 more answers
Q64. What are the different types of errors?

She was looking for run time errors, compile time errors, exceptions which are handled and unhandled

Add your answer
Q65. Explain inheritance to a layman with an example.

Make a class using inheritance implementing the database of a system where each object must work on the same database maintaining consistency and mutual exclusion...read more

Add your answer

Q66. Write a function to know if the check-box is checked in javascript.

Ans.

Function to check if a checkbox is checked in JavaScript

  • Use the 'checked' property of the checkbox element

  • Access the checkbox element using its ID or class name

  • Return true if checked, false if not checked

View 1 answer
Q67. DFS Traversal

Given an undirected and disconnected graph G(V, E), containing 'V' vertices and 'E' edges, the information about edges is given using 'GRAPH' matrix, where i-th edge is between GRAPH[i][0] and GRAP...read more

Add your answer
Q68. Shape and Overriding

Create a Class Shape having a field shapeType and a function printMyType.

Create another class, Square and Rectangle, which inherits the Shape class and has additional fields length and brea...read more

Add your answer
Q69. OOPS Question

What is a virtual function in C++?

Add your answer

Q70. How to handle a team and areas of implovement for each team under the managera which is approved by Director

Ans.

To handle a team, identify areas of improvement for each team member and get approval from the Director.

  • Regularly communicate with team members to understand their strengths and weaknesses.

  • Provide constructive feedback and coaching to help team members improve.

  • Set clear goals and expectations for each team member.

  • Encourage collaboration and teamwork within the team.

  • Get approval from the Director before implementing any major changes or improvements.

Add your answer

Q71. what is the difference between Java and C++?

Ans.

Java is platform-independent and uses automatic memory management, while C++ is faster and allows for more control over memory.

  • Java is compiled to bytecode and runs on a virtual machine, while C++ is compiled to machine code.

  • Java has automatic memory management through garbage collection, while C++ requires manual memory management.

  • Java has a simpler syntax and is easier to learn, while C++ has more complex syntax and is more difficult to master.

  • Java is used for web developme...read more

View 1 answer

Q72. When to use List and Vector of Standard Template Library ?

Ans.

List is preferred when frequent insertion and deletion is required. Vector is preferred when random access is required.

  • List is implemented as a doubly-linked list, allowing for efficient insertion and deletion at any position.

  • Vector is implemented as a dynamic array, allowing for efficient random access.

  • Use List when the number of elements is expected to change frequently and the order of elements matters less.

  • Use Vector when the number of elements is fixed or changes infrequ...read more

Add your answer
Q73. Puzzle

How to Measure 45 minutes using two identical wires?

Add your answer

Q74. Different versions of polymorphism, how to solve the problem of multiple inheritance

Ans.

Polymorphism can be achieved through method overloading, method overriding, and interfaces. Multiple inheritance can be solved using interfaces.

  • Method overloading allows multiple methods with the same name but different parameters

  • Method overriding allows a subclass to provide its own implementation of a method already defined in its superclass

  • Interfaces provide a way to achieve multiple inheritance by allowing a class to implement multiple interfaces

  • Diamond problem in multipl...read more

Add your answer

Q75. What is polymorphism? Explain using a real life example

Ans.

Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as the same type.

  • Polymorphism allows a single interface to be used for different types of objects.

  • It enables code reusability and flexibility in object-oriented programming.

  • For example, a parent class 'Animal' can have multiple child classes like 'Dog', 'Cat', and 'Bird'. They can all be treated as 'Animal' objects.

  • Each child class can have its own implementati...read more

Add your answer

Q76. What do you mean by Linux? Explain its features.

Ans.

Linux is an open-source operating system known for its stability, security, and flexibility.

  • Linux is a Unix-like operating system that was developed as a free and open-source software.

  • It provides a stable and secure environment for running applications and services.

  • Linux supports a wide range of hardware architectures and has a large community of developers and users.

  • It offers a command-line interface, as well as various graphical user interfaces.

  • Linux is highly customizable ...read more

View 2 more answers
Q77. What approach can we use to count hair on our head.
Add your answer

Q78. Write a query to find name of a player with maximum number of runs in a match on given date and given venue

Ans.

Query to find player with maximum runs in a match on given date and venue

  • Use MAX() function to find maximum runs

  • Join tables for player name, match details and runs scored

  • Filter by given date and venue

  • Order by runs scored and limit to 1 result

Add your answer

Q79. Different types of polymorphism, the diamond problem, and how can it be avoided?

Ans.

Polymorphism refers to the ability of an object to take on many forms. The diamond problem occurs in multiple inheritance.

  • Polymorphism can be achieved through method overloading and method overriding.

  • Method overloading allows multiple methods with the same name but different parameters.

  • Method overriding occurs when a subclass provides a specific implementation of a method already defined in its superclass.

  • The diamond problem arises in languages that support multiple inheritan...read more

Add your answer

Q80. Puzzle: Four people need to cross a rickety bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people ...

read more
Add your answer
Q81. DBMS Question

What are deadlock avoidance schemes?

Add your answer

Q82. What is Linux Shell? What types of Shells are there in Linux?

Ans.

Linux Shell is a command-line interpreter that allows users to interact with the operating system. There are various types of shells in Linux.

  • Linux Shell is a program that interprets user commands and executes them.

  • It provides a command-line interface for users to interact with the Linux operating system.

  • Shells can be used to run scripts, automate tasks, and manage system resources.

  • Some popular shells in Linux are Bash (Bourne Again SHell), C Shell (csh), Korn Shell (ksh), an...read more

View 1 answer

Q83. What is foreign key? can foreign key be Null?

Ans.

Foreign key is a column in a table that refers to the primary key of another table.

  • It establishes a relationship between two tables.

  • It ensures referential integrity.

  • It can be null, but only if it is defined as nullable.

  • It helps in joining tables.

  • Example: Customer table has a foreign key to the Order table's primary key.

  • Example: Order table's foreign key can be null if the order has not been placed by any customer yet.

Add your answer

Q84. What is normalization? why should we do normalization?

Ans.

Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.

  • Normalization involves breaking down a database into smaller, more manageable tables.

  • It helps to eliminate data redundancy and inconsistencies.

  • Normalization ensures that each table has a primary key and that data is stored in a logical and consistent manner.

  • It improves data integrity and reduces the likelihood of errors and inconsistencies.

  • Normalization is important f...read more

Add your answer
Q85. What is polymorphism and types of polymorphism?
Add your answer

Q86. Normalized form is better or storing in a single table/ 2 tables is better?

Ans.

Normalized form is better for data consistency and scalability.

  • Normalized form reduces data redundancy and ensures data consistency.

  • Normalized form allows for easier scalability and maintenance.

  • Single table/2 tables may be appropriate for small, simple datasets.

  • Normalized form may require more complex queries to retrieve data.

  • Normalized form may require more storage space due to additional tables.

  • Example: Normalized form for a customer database would have separate tables for ...read more

Add your answer
Q87. Puzzles

1. Two candles and a match box is given, each burning for 1 hour, how to measure 30 minutes.
2. Nine balls are given. All are equally weighed except one that was less weighed. How would we identify the l...read more

Add your answer

Q88. Count all pairs of numbers from a list where the ending digit of the ith number equals the starting digit of the jth number. Example [122, 21, 21, 23] should have 5 pairs (122, 21), (122, 21), (122, 23), (21, 1...

read more
Ans.

Count pairs of numbers where ending digit of ith number equals starting digit of jth number.

  • Iterate through each pair of numbers in the list

  • Check if the ending digit of the ith number equals the starting digit of the jth number

  • Increment the count if the condition is met

Add your answer
Q89. OOPS Question

What is Function Overloading?

Add your answer

Q90. Which data structures the candidate is confident in development and why?

Ans.

I am confident in developing arrays, linked lists, and hash tables.

  • Arrays are simple and efficient for storing and accessing data.

  • Linked lists are useful for dynamic data structures and efficient insertion/deletion.

  • Hash tables provide fast access to data with key-value pairs.

Add your answer

Q91. Find Minimum and Maximum of an array in only one traversal

Ans.

Find the minimum and maximum values in an array in a single traversal.

  • Initialize min and max variables with the first element of the array

  • Iterate through the array and update min and max if a smaller or larger value is found

  • Return the min and max values

Add your answer

Q92. Why String" class is immutable in Java environment?

Ans.

String class is immutable in Java to ensure security, thread-safety, and performance.

  • Immutable objects are thread-safe as they cannot be modified by multiple threads simultaneously.

  • Immutable objects are also secure as they cannot be modified by malicious code.

  • String pool is possible because of immutability, which improves performance by reducing memory usage.

  • StringBuffer and StringBuilder classes are used for mutable string operations.

Add your answer

Q93. What is C++? Difference between deep and shallow copy?

Ans.

C++ is a programming language. Deep copy creates a new object and copies all values, while shallow copy creates a reference to the original object.

  • C++ is a general-purpose programming language

  • Deep copy creates a new object with its own copy of the data

  • Shallow copy creates a reference to the original object

  • Deep copy is safer but can be slower and consume more memory

  • Shallow copy is faster but can lead to unexpected behavior if the original object is modified

Add your answer

Q94. You are given 3 boxes containing apples, oranges and apples oranges mixed. All boxes are labeled incorrectly. You can open only 1 box. Find out which box will you open to correctly identify the boxes.

Add your answer

Q95. Use of 'finally' block in Java? When finally" block is not called in which cases?

Ans.

The 'finally' block in Java is used to execute code after try-catch blocks, even if an exception is thrown.

  • The 'finally' block is always executed, regardless of whether an exception is thrown or caught.

  • It is used to release resources like database connections, network connections, etc.

  • If the JVM exits while the try or catch code is being executed, then the 'finally' block may not execute.

  • If the thread executing the try or catch code is interrupted or killed, the 'finally' blo...read more

Add your answer
Q96. DBMS Question

Given 2 tables : (empid,empname,dept) and (empid,salary).
Write sql query to list the details of employee having 5 maximum salaries

Add your answer
Q97. DBMS Question

What is a clustered index ?

Add your answer
Q98. OOPS Question

What is structure padding?

Add your answer

Q99. Given a chessboard find maximum number of squares present

Ans.

Given a chessboard, find the maximum number of squares present.

  • Start with the smallest square and count all possible squares

  • Use the formula n*(n+1)*(2n+1)/6 to find the total number of squares in an n x n chessboard

  • Add up the squares of all sizes from 1 to n to get the maximum number of squares

  • For example, an 8 x 8 chessboard has 204 squares

View 1 answer

Q100. What do you mean by a Process States in Linux?

Ans.

Process states in Linux refer to the different states that a process can be in during its execution.

  • The process states in Linux include running, waiting, sleeping, stopped, and zombie.

  • Running state indicates that the process is currently being executed by the CPU.

  • Waiting state means that the process is waiting for a particular event or resource to become available.

  • Sleeping state occurs when a process voluntarily gives up the CPU and waits for a specific condition to be satisf...read more

View 1 answer
1
2
3
4

More about working at SAP

Top Rated Large Company - 2024
Top Rated Internet/Product Company - 2024
HQ - Walldorf, Baden-Württemberg, Germany
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at null

based on 114 interviews in the last 1 year
Interview experience
4.2
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

4.1
 • 359 Interview Questions
4.2
 • 220 Interview Questions
3.8
 • 208 Interview Questions
3.9
 • 189 Interview Questions
3.9
 • 174 Interview Questions
3.5
 • 143 Interview Questions
View all
Top SAP Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter