Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Technical round that lasted for around 60 minutes. The interviewer asked me questions based on DSA and OOPS concepts.



Input:
4 5
0 1 5
0 2 8
1 2 9
1 3 2
2 3 6

In the given input, the number of vertices is 4, and the number of edges is 5.
In the input, following the number of vertices and edges, three numbers are given. The first number denotes node ‘X’, the second number denotes node ‘Y’ and the third number denotes the distance between node ‘X’ and ‘Y’.
As per the input, there is an edge between node 0 and node 1 and the distance between them is 5.
The vertices 0 and 2 have an edge between them and the distance between them is 8.
The vertices 1 and 2 have an edge between them and the distance between them is 9.
The vertices 1 and 3 have an edge between them and the distance between them is 2.
The vertices 2 and 3 have an edge between them and the distance between them is 6.
1. There are no self-loops(an edge connecting the vertex to itself) in the given graph.
2. There can be parallel edges i.e. two vertices can be directly connected by more than 1 edge.
Dijkstra's Algorithm basically starts at the source node and it analyzes the graph to find the shortest path between that node and all the other nodes in the graph.
The algorithm keeps track of the currently known shortest distance from each node to the source node and it updates these values if it finds a shorter path.
Once the shortest path between the source node and another node is found, that node is marked as "visited" and added to the path.
The process continues until all the nodes in the graph have been added to the path. This way, we have a path that connects the source node to all other nodes following the shortest path possible to reach each node.
Pseudocode :
function Dijkstra(Graph, source):
2: for each vertex v in Graph: // Initialization
3: dist[v] := infinity // initial distance from source to vertex v is set to infinite
4: previous[v] := undefined // Previous node in optimal path from source
5: dist[source] := 0 // Distance from source to source
6: Q := the set of all nodes in Graph // all nodes in the graph are unoptimized - thus are in Q
7: while Q is not empty: // main loop
8: u := node in Q with smallest dist[ ]
9: remove u from Q
10: for each neighbor v of u: // where v has not yet been removed from Q.
11: alt := dist[u] + dist_between(u, v)
12: if alt < dist[v] // Relax (u,v)
13: dist[v] := alt
14: previous[v] := u
15: return previous[ ]
Difference between C and C++
1. The C programming language is a procedural language type while C++ is an object-oriented programming language type.
2. C programming follows a top to down programming approach that focuses on the steps rather than the data. C++ follows a bottom-to-top approach that focuses on data rather than the overall procedure.
3. Since C is a structured programming language the program is divided into separate blocks known as functions. Since C++ is an object-oriented programming language, the code is divided into Objects and Classes.
Difference between malloc and new
1. new calls constructor while malloc does not calls constructors
2. new is an operator. malloc () is a function.
3. new returns exact data type while malloc() returns void *
4. On failure, new throws bad_alloc exception. While malloc() on failure, returns NULL.
What is virtual function?
A C++ virtual function is a member function in the base class that you redefine in a derived class. It is declared using the virtual keyword. It is used to tell the compiler to perform dynamic linkage or late binding on the function. A 'virtual' is a keyword preceding the normal declaration of a function. When the function is made virtual, C++ determines which function is to be invoked at the runtime based on the type of the object pointed by the base class pointer.
Technical round that lasted for around 60 minutes. The interviewer asked me questions based on SQL and OOPS concepts.
Query to find nth highest salary
TOP keyword can be used to find the nth highest salary. By default ORDER BY clause print rows in ascending order, since we need the highest salary at the top, we have used ORDER BY DESC, which will display salaries in descending order. Again DISTINCT is used to remove duplicates. The outer query will then pick the topmost salary, which would be your Nth highest salary.
SQL query :
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP N salary
FROM #Employee
ORDER BY salary DESC
) AS temp
ORDER BY salary
OOPS contains 3 classes A,B,C and they are in multi level inheritance, was asked about the use of public, protected and private members of A in B and in C
When a subclass inherits a base class, it inherits only the members of superclass that are marked with public, protected visibility modes, these members are -
Properties of the base class.
Functions of the base class.
Note - Base class members marked with private visibility mode are never inherited.
Difference between Stack and Heap
1. Stack is a linear data structure whereas Heap is a hierarchical data structure.
2. Stack memory will never become fragmented whereas Heap memory can become fragmented as blocks of memory are first allocated and then freed.
3.Stack memory is allocated in a contiguous block whereas Heap memory is allocated in any random order.
4. Stack variables can’t be resized whereas Heap variables can be resized.
HR round that lasted for around 30 minutes. The interviewer asked questions to know more about me. We also discussed a puzzle.
Hourglasses Puzzle
1. At 0 minutes: Start both hourglasses at the same time.
2. At 4 minutes: 4 minutes hourglass runs out and flip it. 7 minutes hourglass is left with 3 minutes.
3. At 7 minutes: 4 minutes hourglass is left with 1 minute. 7 minutes hourglass runs out and flip it.
4.At 8 minutes: 4 minutes hourglass runs out and 7 is filled with 6 minutes and 1 minute on the other side. Flip it as the sand is left with 1 minute.
5. At 9 minutes: 7 minutes hourglass becomes empty from above side.
Q1. Firstly was asked about the subjects I'm studying this semester
Q2. Different questions about my projects
Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?