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

SDE - 1

Synopsys
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Java, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practice Atleast 250 Questions from coding ninjas
Tip 2 : Do some good projects

Application process
Where: Referral
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Do not put false things on resume.
Tip 2 : Be confident and be honest

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date10 Mar 2020
Coding problem1

9 MCQs and 1 coding question

1. Construct BST from Preorder Traversal

Moderate
13m average time
0/80
Asked in companies
Samsung R&D InstituteMercer MettlTekion Corp

You are given a preorder traversal of a binary search tree. Your task is to find the postorder from the preorder.


Return the root of the BST constructed from the given preorder. The driver code will then use this root to print the post-order traversal.


For example:
You are given preOrder = [10, 5, 1, 7, 40, 50], the binary search tree from the given preorder traversal is 

sample1

Hence the answer is [1, 7, 5, 50, 40, 10].
Problem approach

Pick an element from Preorder. Increment a Preorder Index Variable (preIndex in below code) to pick the next element in the next recursive call. 
Create a new tree node tNode with the data as the picked element. 
Find the picked element’s index in Inorder. Let the index be inIndex. 
Call buildTree for elements before inIndex and make the built tree as a left subtree of tNode. 
Call buildTree for elements after inIndex and make the built tree as a right subtree of tNode. 
return tNode.

Try solving now
02
Round
Easy
Telephonic
Duration60 minutes
Interview date11 Mar 2020
Coding problem2

Declare 2d array in C++

1. Next Greater Element

Easy
10m average time
90% success
0/40
Asked in companies
IBMInfo Edge India (Naukri.com)Amazon

You are given an array 'a' of size 'n'.



The Next Greater Element for an element 'x' is the first element on the right side of 'x' in the array, which is greater than 'x'.


If no greater elements exist to the right of 'x', consider the next greater element as -1.


For example:
Input: 'a' = [7, 12, 1, 20]

Output: NGE = [12, 20, 20, -1]

Explanation: For the given array,

- The next greater element for 7 is 12.

- The next greater element for 12 is 20. 

- The next greater element for 1 is 20. 

- There is no greater element for 20 on the right side. So we consider NGE as -1.
Problem approach

Step 1: Start the outer loop from 0 to the array’s length and initialise a temporary variable (temp) with -1.

Step 2: Start the inner loop from i+1 to the size of the array. 

Step 3: Check if the inner loop element is less than the outer loop element. 

Step 4: If yes, print the element, assign 1 to temp and break out of the inner loop.

Step 5: Repeat the same procedure to find the next greater element for each element.

Step 6: Print the arrays “smaller” and “greater” as the answers.

Try solving now

2. Queue Using Stack

Moderate
30m average time
60% success
0/80
Asked in companies
GE (General Electric)ZSGoldman Sachs

Implement a queue data structure which follows FIFO(First In First Out) property, using only the instances of the stack data structure.


Note:
1. To implement means you need to complete some predefined functions, which are supported by a normal queue such that it can efficiently handle the given input queries which are defined below.


2. The implemented queue must support the following operations of a normal queue: 

a. enQueue(data) : This function should take one argument of type integer and place the integer to the back of the queue.

b. deQueue(): This function should remove an integer from the front of the queue and also return that integer. If the queue is empty, it should return -1.

c. peek(): This function returns the element present in the front of the queue. If the queue is empty, it should return -1.

d. isEmpty(): This function should return true if the queue is empty and false otherwise.


3. You will be given q queries of 4 types:

a. 1 val - For this type of query, you need to insert the integer val to the back of the queue.

b. 2 - For this type of query, you need to remove the element from the front of the queue, and also return it.

c. 3 - For this type of query, you need to return the element present at the front of the queue(No need to remove it from the queue).

d. 4 - For this type of query, you need to return true if the queue is empty and false otherwise.


4. For every query of type:

a. 1, you do not need to return anything.

b. 2, return the integer being deQueued from the queue.

c. 3, return the integer present in the front of the queue.

d. 4, return “true” if the queue is empty, “false” otherwise.
Example
Operations: 
1 5
1 10
2
3
4

Enqueue operation 1 5: We insert 5 at the back of the queue.
Queue: [5]

Enqueue operation 1 10: We insert 10 at the back of the queue.
Queue: [5, 10]

Dequeue operation 2: We remove the element from the front of the queue, which is 5, and print it.
Output: 5
Queue: [10]

Peek operation 3: We return the element present at the front of the queue, which is 10, without removing it.
Output: 10
Queue: [10]

IsEmpty operation 4: We check if the queue is empty.
Output: False
Queue: [10]
Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date18 Mar 2020
Coding problem2

Basic C++ questions related to virtual functions and constructors.

1. Kth Largest Element in BST

Moderate
0/80
Asked in companies
AdobeWells FargoCIS - Cyber Infrastructure

Given the root node of a Binary Search Tree (BST), you have to return the Kth largest element in the BST.

For Example:
If K is 4 and the tree is depicted by the following image then,

Example1

The 4th largest element in the given BST is 1. So the output will be 1.
Follow-up :
 Try to do it in O(1) space without using recursion.
Problem approach

We traverse given Binary Search Tree in reverse inorder and keep track of counts of nodes visited. Once the count becomes 2, we print the node.

Try solving now

2. Detect Cycle in a Directed Graph

Moderate
25m average time
65% success
0/80
Asked in companies
AmazonAmerican ExpressOYO

Given a directed graph, check whether the graph contains a cycle or not. Your function should return true if the given graph contains at least one cycle, else return false.

Try solving now

Here's your problem of the day

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

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Synopsys
1780 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Synopsys
1728 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Synopsys
2442 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Synopsys
1682 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
6261 views
3 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by BNY Mellon
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by CIS - Cyber Infrastructure
2159 views
0 comments
0 upvotes