Add office photos
Engaged Employer

SAP

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

10+ Sreevari Enterprises Interview Questions and Answers

Updated 13 Mar 2024
Popular Designations

Q1. Multilevel Inheritance Implementation

Create a series of classes to demonstrate multilevel inheritance.

Explanation:

Create three classes to illustrate multilevel inheritance.

  • GrandFather: This class should ha...read more
Ans.

Demonstrate multilevel inheritance with classes GrandFather, Father, and Son with specific attributes and methods.

  • Create a class GrandFather with a parameterized constructor and attribute grandFatherName.

  • Create a class Father inheriting from GrandFather with an additional attribute fatherName.

  • Create a class Son inheriting from Father with an additional attribute sonName and a method printName to display all names in a specific format.

  • Ensure constructors initialize attributes ...read more

Add your answer

Q2. Reverse Linked List Problem Statement

Given a singly linked list of integers, return the head of the reversed linked list.

Example:

Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Ans.

Reverse a singly linked list of integers and return the head of the reversed linked list.

  • Iterate through the linked list and reverse the pointers to point to the previous node.

  • Keep track of the current, previous, and next nodes while reversing the linked list.

  • Update the head of the reversed linked list as the last node encountered during reversal.

Add your answer

Q3. BFS Traversal in a Graph

Given an undirected and disconnected graph G(V, E) where V vertices are numbered from 0 to V-1, and E represents edges, your task is to output the BFS traversal starting from the 0th ve...read more

Ans.

BFS traversal in a disconnected graph starting from vertex 0.

  • Implement BFS algorithm to traverse the graph starting from vertex 0.

  • Explore neighbor nodes first before moving to the next level neighbors.

  • Consider the bidirectional nature of edges in an undirected graph.

  • Output the BFS traversal sequence for each test case in a separate line.

Add your answer

Q4. Reverse the String Problem Statement

You are given a string STR which contains alphabets, numbers, and special characters. Your task is to reverse the string.

Example:

Input:
STR = "abcde"
Output:
"edcba"

Input...read more

Ans.

Reverse a given string containing alphabets, numbers, and special characters.

  • Iterate through the string from the end to the beginning and append each character to a new string.

  • Use built-in functions like reverse() or StringBuilder in languages like Python or Java for efficient reversal.

  • Handle special characters and numbers while reversing the string.

  • Ensure to consider the constraints provided in the problem statement.

  • Test your solution with different test cases to validate th...read more

Add your answer
Discover Sreevari Enterprises interview dos and don'ts from real experiences

Q5. Right View of Binary Tree

Given a binary tree of integers, your task is to output the right view of the tree.

The right view of a binary tree includes the nodes that are visible when the tree is observed from t...read more

Ans.

The task is to output the right view of a binary tree, which includes the nodes visible when observed from the right.

  • Traverse the tree level by level and keep track of the rightmost node at each level.

  • Use a queue for level order traversal and a map to store the rightmost nodes.

  • Print the values of the rightmost nodes stored in the map as the right view of the tree.

Add your answer

Q6. Prime Numbers Identification

Given a positive integer N, your task is to identify all prime numbers less than or equal to N.

Explanation:

A prime number is a natural number greater than 1 that has no positive d...read more

Ans.

Identify all prime numbers less than or equal to a given positive integer N.

  • Iterate from 2 to N and check if each number is prime

  • Use the Sieve of Eratosthenes algorithm for efficient prime number identification

  • Optimize by only checking up to the square root of N for divisors

Add your answer
Are these interview questions helpful?
Q7. You have 3 bulbs in one room and 3 switches in another room. The challenge is to determine which switch controls which bulb, with the constraint that you can only enter the bulb room once.
Ans.

Turn on one switch for a while, then turn it off and turn on another switch. One bulb will be on, one will be off, and one will be warm.

  • Turn on switch 1 for a few minutes, then turn it off.

  • Turn on switch 2 and enter the room with bulbs.

  • The bulb that is on corresponds to switch 2, the warm bulb corresponds to switch 1, and the off bulb corresponds to switch 3.

Add your answer
Q8. You have 2 eggs and a building with 100 floors. What is the minimum number of attempts needed to find the highest floor from which an egg can be dropped without breaking?
Ans.

The minimum number of attempts needed is 14.

  • Start dropping the first egg from the 14th floor, then move up by one floor for each attempt until the first egg breaks.

  • Once the first egg breaks, use the second egg to test each floor starting from the last unbroken floor.

  • The worst-case scenario is dropping the first egg 14 times and the second egg 13 times, totaling 14 attempts.

Add your answer
Share interview questions and help millions of jobseekers 🌟
Q9. How can you make 3 cuts to divide a round cake into 8 equal pieces?
Ans.

Make one horizontal cut through the middle of the cake, then make two vertical cuts perpendicular to each other.

  • Make a horizontal cut through the middle of the cake to create two equal halves.

  • Make one vertical cut through the center of one of the halves.

  • Make another vertical cut through the center of the other half, perpendicular to the first cut.

  • You will end up with 8 equal pieces of cake.

Add your answer
Q10. Can you design an ER diagram for an online shopping portal?
Ans.

Yes, I can design an ER diagram for an online shopping portal.

  • Entities: User, Product, Order, Payment, Cart

  • Relationships: User places Order, Order contains Product, Payment for Order, User has Cart

  • Attributes: User (id, name, email), Product (id, name, price), Order (id, date), Payment (id, amount)

Add your answer
Q11. What is BCNF (Boyce-Codd Normal Form) in database management systems?
Ans.

BCNF is a normal form in database management systems that ensures all determinants are candidate keys.

  • BCNF stands for Boyce-Codd Normal Form.

  • It is a stricter version of 3NF (Third Normal Form).

  • In BCNF, every determinant must be a candidate key.

  • It helps in reducing redundancy and anomalies in the database.

  • Example: If a table has columns A, B, and C, and A determines B and B determines C, then it is not in BCNF unless A is a candidate key.

Add your answer
Q12. How can you calculate 45 minutes using only 2 candles?
Ans.

By burning one candle at both ends, you can calculate 45 minutes using only 2 candles.

  • Light one end of the first candle and both ends of the second candle simultaneously.

  • When the second candle burns out completely, 30 minutes have passed.

  • Light the other end of the first candle and let it burn. When it meets the first end, 15 minutes have passed.

Add your answer
Q13. What is the difference between C and C++?
Ans.

C is a procedural programming language while C++ is an object-oriented programming language with features like classes and inheritance.

  • C is a procedural programming language, while C++ is a multi-paradigm language with support for object-oriented programming.

  • C does not support classes and objects, while C++ does.

  • C uses structures for data organization, while C++ uses classes.

  • C does not have features like inheritance and polymorphism, which are present in C++.

  • C++ allows functi...read more

Add your answer

Q14. remove node in linked list

Ans.

To remove a node in a linked list, update the previous node's next pointer to skip the node to be removed.

  • Traverse the linked list to find the node to be removed

  • Update the previous node's next pointer to skip the node to be removed

  • Free the memory allocated to the node to be removed

Add your answer

Q15. design parking lot

Ans.

Design a parking lot system with features like parking, retrieving, and displaying available spots.

  • Create a class for ParkingLot with attributes like total spots, available spots, and a list of parked vehicles.

  • Implement methods for parking a vehicle, retrieving a vehicle, and displaying available spots.

  • Consider using data structures like arrays or lists to manage parked vehicles and available spots.

Add your answer

More about working at SAP

Top Rated Large Company - 2024
Top Rated Internet/Product Company - 2024
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Sreevari Enterprises

based on 5 interviews
1 Interview rounds
Coding Test Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

4.0
 • 107 Interview Questions
3.9
 • 35 Interview Questions
4.3
 • 25 Interview Questions
3.7
 • 23 Interview Questions
3.7
 • 21 Interview Questions
3.5
 • 15 Interview Questions
View all
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
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

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