SDE-2
300+ SDE-2 Interview Questions and Answers
1. Whats polymorphism - compile time and run time.
2. What are exceptions in Java - Since my primary language was C++, I explained exception in C++ only.
3. What are collections in Java- list, ...read more
Question 1 : A scenario/story where Bitonic Sequence was to be implemented.
Question 2 : Design a Scheduler for scheduling n jobs with input give at the runtime , input can be the also generic...read more
Exception handling in C++ in detail.
What do mean by OOPS.
What is inheritance.
Create a database to store the information of employees and their salaries (just explain)
What are insertion, delet...read more
For a given array/list of integers of size N, print the Next Greater Element(NGE) for every element. The Next Greater Element for an element X is the first element on the right side of X in ...read more
Atlassian has 5 values. Situational questions will be asked around those 5 values if you've demonstrated them in your past or not.
Atlassian has 5 values. Situational questions will be asked around those 5 values if you've demonstrated them in your past or not.
Be the change you seek
Don't #@!% the customer
Play, as a team
Build with heart and balance
Be the CEO of your own career
You have been given a string ‘S' representing a number. Your task is to find the closest palindromic number from this integer represented by 'S'. The closest number is defined as the one for ...read more
Share interview questions and help millions of jobseekers 🌟
You have to create a landing page, where you will provide linkages. On click of linkages button, the respective page should open below. Give different approaches.
So we can do it using fram...read more
What is a basic form of GRANT statement?
Calculate the result of the following prefix expression: +,-,*,8,4,/,6,2,5
If a new node is added into a red-black tree, which statements are true ?
What...read more
SDE-2 Jobs
This was taken by an SDE III guy, who again asked me about my projects for like 10 mins and then moved on to a low level design question.He asked me to design the HackerRank platform.
Again I ...read more
You are given two strings 'str1' and 'str2'. Find the minimum operations required to convert str1 into str2.
An Operation is defined as:
A character from a...read more
He took a deep dive into my resume and asked a lot of questions around my projects asking my roles and responsibilities in each project/product/team. Asked about Kadane's Algorithm.
After that...read more
Write as you speak is a special sequence of strings that starts with string “1” and after one iteration you rewrite the sequence as whatever you speak.
Example :
The first few iterations of the seq...read more
Two strings ‘S1’ and ‘S2’ are considered similar if either ‘S1’ equals ‘S2’ or we can swap two letters of ‘S1’ (at different positions) so that it equals ‘S2’.
For Example :
“code” and “eod...read more
Design and code publisher subscriber based messaging queue supporting following features:
1. New topic creation
2. Multiple...read more
You will be given ‘Q’ queries. You need to implement a circular queue according to those queries. Each query will belong to one of these two types:
1 ‘X’: Enqueue element ‘X’ into the end of the n...read more
Design Data structure like Queue in which you have to get the middle element in O(1), then update that value and do some modification and add back to the Queue in O(1) and the rearrangement...read more
You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a squar...read more
I was asked to design a Food Delivery App (Swiggy). This round revolved around designing database schemas. I was given around 20 minutes to identify the various entities involved in the sy...read more
Q1. Why Groupon?
Q2. Where do you see yourself after next 5 years?
What is the probability of getting a sum of 22 or more when four dice are thrown?
Fifteen people sit around a circular table. What are odds against two particular people sitting together?
He asked me to desgin a bookmyshow and then started asking question around the design
Design a bookmyshow system
Design a system to book and manage movie tickets
Consider features like seat selection, payment, and ticket cancellation
Include user authentication and authorization
Implement a database to store movie and theater information
Consider scalability and performance of the system
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
1. Benefits of Learning Data Structures ?
2. Can you explain the difference between file structure and storage structure?
3. What is a multidimensional array?
4. What is a stack? What are the applicat...read more
I wrote C++as skill, So interviewer asked me how you make sure that whenever dynamically memory is allocated, it gets freed up when you go out of scope from the place where you allocated the memory?
What is the difference between drop and truncate?
How would you sort and display a column of table in descending order?
Create a table with primary key.
Set the marks of student to 50 whose address i...read more
How can you find the largest or smallest number in an array of integers?
What is an AVL Tree?
What is the difference between tree and graph data structure?
Oops concepts with principal.
Basic ...read more
Design Facebook API. (Question was vague)
Given a basic interface and the list of functionality that need to implement.
And basic test cases were there again the operations.
Design Facebook API
Define the basic interface for the API
Implement functionality for user authentication and authorization
Create endpoints for posting, retrieving, and deleting posts
Include features for liking, commenting, and sharing posts
Implement a search functionality for users, posts, and hashtags
Design a notification system for user interactions
Consider scalability and performance optimizations
What is Data Abstraction and how to achive it ?
What is Diamond Problem in C++ and how do we fix it?
What is meant by Multitasking and Multithreading in OS?
Given a System API to manage memory which allocates memory of size 1024 bytes only, create a wrapper to allocate memory efficiently. Deep discussion about why I used X data structure why n...read more
This round is behavioral and cultural based round and manager wants to know how can i handle the critical situation.
The questions will be based on low level system design and you will be given certain conditions for which you have to design a system.
There were a lot of questions, related to my resume, past experience, the technologies i had worked on. And then there were questions regarding the technologies and tec...read more
Asked about the system architecture i was working on. And then went deeper to ask other related stuffs. And also there were some situational questions like what would you do if you get into s...read more
1. What is Code Motion?
2. What are the different phases of compilation process?
3. Explain Lexical Analysis?
4. What are macros? What are inline functions?
5. What is recursion? Write a recursiv...read more
Q187. 1. A variation on 2 sum problem (based on number of digits) 2. Average of node value and its subtree (Count no of nodes where average of the subtree and the node itself equals to the node value). It was taken b...
read more2 sum problem variation based on number of digits and finding nodes where average of subtree and node value equals node value.
For the 2 sum problem variation, use a hash table to store the digits and their indices.
For the subtree problem, use a recursive function to traverse the tree and calculate the average.
Examples: [1, 2, 3, 4, 5] with target 7 and tree with root 5, left child 4, right child 6, should return 2 and 1 respectively.
Q188. Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them. For example : ABC -> A BC, AB C, ABC, A B C
Given a string, print all possible strings that can be made by placing spaces (zero or one) in between them.
Use recursion to generate all possible combinations of spaces
For each recursive call, either add a space or don't add a space between the current character and the next character
Base case is when there are no more characters left to add spaces between
Time complexity is O(2^n) where n is the length of the string
Was asked to design a notification service for website like Facebook.
Whenever someone liked our post or commented on our post
Why tcs?
What are your expectations?
Where do you see yourself in 5 years?
Explain how will you scale these services.
Follow up: Where will you use a queue.
Internally how queues work?
What is the difference between @RestController and @Controller in Spring Boot?
How to prevent breaking of singleton pattern using reflections?
Questions on optimisations of a particular use case and scenario.
How can we reduce the number of API calls?
Behavioural questions on leadership aspirations etc.
Write a query to find the elements using the dates_of_delivery.
What is relational Database.
Difference between SQL and NoSQL
1. What is immutability?
2. Is try with multiple catch allowed? Explain.
3. What is garbage collection?
4. Tell me a little about HashMaps.
1) A table was shown to me and I was asked to write a query for displaying unique elements.
2) What is RDBMS ?
3) Difference between MySql & NoSql.
What is a default method, and when does it get used?
What is JIT compiler?
Scheduling algos.
2nd highest salary using joins of tables
Design Stackoverflow application. Given basic requirements for the app. We need to provide high level design for the requirements. also low level design if asked.
Top Interview Questions for SDE-2 Related Skills
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month