Cvent interview experience Real time questions & tips from candidates to crack your interview

Software Engineer

Cvent
upvote
share-icon
1 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 5 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS
Tip
Tip

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.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

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.

Interview rounds

01
Round
Medium
Video Call
Duration60 minutes
Interview date17 Dec 2021
Coding problem3

Technical Interview round with questions on DSA and Compiler Design.

1. Detect cycle in undirected graph

Moderate
0/80
Asked in companies
FlipkartAmazonAdobe

You have been given an undirected graph with 'N' vertices and 'M' edges. The vertices are labelled from 1 to 'N'.

Your task is to find if the graph contains a cycle or not.

A path that starts from a given vertex and ends at the same vertex traversing the edges only once is called a cycle.

Example :

In the below graph, there exists a cycle between vertex 1, 2 and 3. 

Example

Note:

1. There are no parallel edges between two vertices.

2. There are no self-loops(an edge connecting the vertex to itself) in the graph.

3. The graph can be disconnected.

For Example :

Input: N = 3 , Edges =  [[1, 2], [2, 3], [1, 3]].
Output: Yes

Explanation : There are a total of 3 vertices in the graph. There is an edge between vertex 1 and 2, vertex 2 and 3 and vertex 1 and 3. So, there exists a cycle in the graph. 
Problem approach

DFS can be used to detect cycle in an undirected graph. Do a DFS traversal of the given graph. For every visited vertex ‘v’, if there is an adjacent ‘u’ such that u is already visited and u is not parent of v, then there is a cycle in graph.

If we don’t find such an adjacent for any vertex, we say that there is no cycle.

Pseudocode :

 

DetectCycle(graph, v, visited[], parent)
{
	// mark the current node as visited
	visited[v] = true;
	// do for every edge (v, w)
	for (w: graph[v])
	{
		// if `w` is not visited yet
		if (!visited[w])
		{
			if (DetectCycle(graph, w, visited, v)) {
				return true;
			}
		}
		// if `w` is visited, and `w` is not a parent
		else if (w != parent)
		{
			// back-edge (cycle) found
			return true;
		}
	} 
	// No back-edges were found in the graph
	return false;
}
Try solving now

2. Implement 3 stacks in a single array

Moderate
15m average time
85% success
0/80
Asked in companies
GoogleAppleFacebook

Given a sequence of queries of insertion and deletion from 3 stacks, you need to implement three stacks using a single array such that the size of the array doesn’t exceed the number of queries.

In each query, the input is of two types :

Id 0: where ‘id’ is the index of the stack ( out of the three ) in which we have to work on, 0 means we have to pop a top element from the stack.

Id 1 ele: where ‘id’ is the index of the stack ( out of the three ) in which we have to work on, 1 means we have to push ‘ele’ element on top of the stack.

After each pop operation, you have to print the element which is removed.

Note: If a pop operation is used in an empty stack nothing happens to the stack, but you have to print -1.
Problem approach

One method could be to divide the array in slots of size n/3. A simple way to implement 3 stacks is to divide the array in 3 slots of size n/3 each, and fix the slots for different stacks, i.e., use arr[0] to arr[n/3-1] for first stack, and arr[n/3] to arr[2n/3-1] for stack2 where arr[] is the array to be used to implement 3 stacks and size of array be n. The problem with this method is inefficient use of array space. A stack push operation may result in stack overflow even if there is space available in arr[].

A space efficient implementation : The idea is to use two extra arrays for efficient implementation of 3 stacks in an array. 
Following are the two extra arrays are used :
1) top[]: This is of size 3 and stores indexes of top elements in all stacks.
2) next[]: This is of size n and stores indexes of next item for the items in array arr[]. Here arr[] is actual array that stores 3 stacks.
Together with 3 stacks, a stack of free slots in arr[] is also maintained. The top of this stack is stored in a variable ‘free’.
All entries in top[] are initialized as -1 to indicate that all stacks are empty. All entries next[i] are initialized as i+1 because all slots are free initially and pointing to next slot. Top of free stack, ‘free’ is initialized as 0.

Try solving now

3. Compiler Design Question

Difference between Compiled and Interpreted Language?

Problem approach

1. A compiled language is a programming language whose implementations are typically compilers and not interpreters. An interpreted language is a programming language whose implementations execute instructions directly and freely, without previously compiling a program into machine-language instructions.


2. In compiled language, once the program is compiled it is expressed in the instructions of the target machine. While in interpreted language, the instructions are not directly executed by the target machine.
 

3. In compiled language, there are at least two steps to get from source code to execution. In interpreted language, there is only one step to get from source code to execution.
 

4. In compiled language, compiled programs run faster than interpreted programs. While in interpreted language, interpreted programs can be modified while the program is running.
 

5. In compiled language, compilation errors prevent the code from compiling. In interpreted language, all the debugging occurs at run-time.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Cvent
0 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 6 problems
Interviewed by Cvent
756 views
0 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Cvent
703 views
0 comments
0 upvotes
company logo
Software Engineer
4 rounds | 12 problems
Interviewed by Cvent
882 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Engineer
3 rounds | 5 problems
Interviewed by Mindtree
11082 views
7 comments
0 upvotes
company logo
Software Engineer
3 rounds | 7 problems
Interviewed by Optum
7001 views
1 comments
0 upvotes
company logo
Software Engineer
5 rounds | 5 problems
Interviewed by Microsoft
8503 views
1 comments
0 upvotes