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

C++ Developer

Credit Suisse
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 Months
Topics: C++, Python, Arrays, Trees, Data Structures, Algorithms
Tip
Tip

Tip 1 : Have good knowledge of C++
Tip 2 : Practice easy, medium questions from leetcode mostly arrays, stack, trees.
Tip 3 : Have some knowledge of Python

Application process
Where: Other
Eligibility: 2021 passout, 7 CGPA above
Resume Tip
Resume tip

Tip 1 : Have some achievements like coding contest ratings, etc
Tip 2 : Have 1 or 2 good projects on Web Development or Machine Learning or any internship experience is even better.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration120 minutes
Interview date26 Mar 2021
Coding problem2

2 coding questions and 10 MCQ based on find output of code and some aptitude.

1. String Transformation

Moderate
23m average time
0/80
Asked in companies
WalmartSprinklrAccenture

Given a string (STR) of length N, you have to create a new string by performing the following operation:

Take the smallest character from the first 'K' characters of STR, remove it from STR and append it to the new string.

You have to perform this operation until STR is empty.

 Note:
The input string(STR) will not contain any spaces.

Assume that all characters in STR are lower case letters.

If characters less than 'K' remain, then append them in a sorted way to the new string.
Example:
Let the input string be "edcba" with K = 4.

Let the new string to be formed is initially empty, newString = "".
The first set of 4 characters are, ('e', 'd', 'c', 'b')
Out of these 4 characters, the smallest one is 'b' and hence we add it to the newString and it becomes, 
newString = "b"

The next set of 4 characters are, ('e', 'd', 'c', 'a')
Out of these 4 characters, the smallest one is 'a' and hence we add it to the newString and it becomes, 
newString = "ba"

Now we are left with "edc" and since we can't get a window of size 4, we sort them in the increasing order and append them to the newString.

Hence, newString thus formed will be "bacde".
Try solving now

2. Find Maximum number possible by doing at-most K swaps

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

You are given an array of 'N' non-negative integers, representing the digits of a number, and an integer 'K'. Your task is to find the maximum possible number that can be made by swapping the digits of the given number at most 'K' times.

Note :

1. The input may have 0 before the most significant digit, [0,3,5,7] is a valid input and it represents number 357.
2. Digits in the number can be repeated, i.e [3, 3, 4, 4] is a valid input and it represents the number 3344.
Try solving now
02
Round
Easy
Face to Face
Duration45 minutes
Interview date30 Jun 2021
Coding problem1

C++ questions, one coding question, some python question

1. Merge K Sorted Arrays

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

You have been given ‘K’ different arrays/lists, which are sorted individually (in ascending order). You need to merge all the given arrays/list such that the output array/list should be sorted in ascending order.

Try solving now
03
Round
Easy
Face to Face
Duration45 minutes
Interview date1 Jul 2021
Coding problem2

C++ related questions, coding questions, past internship experience,some python questions

1. Sort 0 1 2

Easy
22m average time
0/40
Asked in companies
WalmartZS AssociatesIntuit

You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
Try solving now

2. Move Zeroes to End

Easy
0/40
Asked in companies
SAP LabsBirdEyeCredit Suisse

Given an unsorted array of integers, you have to move the array elements in a way such that all the zeroes are transferred to the end, and all the non-zero elements are moved to the front. The non-zero elements must be ordered in their order of appearance.

For example, if the input array is: [0, 1, -2, 3, 4, 0, 5, -27, 9, 0], then the output array must be: [1, -2, 3, 4, 5, -27, 9, 0, 0, 0].

Expected Complexity: Try doing it in O(n) time complexity and O(1) space complexity. Here, ‘n’ is the size of the array.

Try solving now
04
Round
Medium
Face to Face
Duration60 minutes
Interview date2 Jul 2021
Coding problem2

Data Structure questions, trees questions.

1. Preorder traversal of a BST

Moderate
15m average time
85% success
0/80
Asked in companies
RazorpayHSBCDisney + Hotstar

You have been given an array/list 'PREORDER' representing the preorder traversal of a BST with 'N' nodes. All the elements in the given array have distinct values.

Your task is to construct a binary search tree that matches the given preorder traversal.

A binary search tree (BST) is a binary tree data structure that has the following properties:

• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.

Note:

It is guaranteed that a BST can be always constructed from the given preorder traversal. Hence, the answer will always exist.
Example:
From PREORDER = [20, 10, 5, 15, 13, 35, 30, 42] , the following BST can be constructed:

example

Try solving now

2. BST Delete

Easy
15m average time
80% success
0/40
Asked in companies
BarclaysWells FargoGainsight

You are given a binary search tree (BST) and a key value 'K'. You need to delete the node with value 'K'. It is guaranteed that a node has the value 'K'.

A binary search tree (BST), also called an ordered or sorted binary tree, is a rooted binary tree whose internal nodes each store a key greater than all the keys in the node's left subtree and less than those in its right subtree.

Note:
All the elements of the binary search tree are unique.
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

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
ENO
3 rounds | 10 problems
Interviewed by Credit Suisse
561 views
0 comments
0 upvotes
ENO
3 rounds | 7 problems
Interviewed by Credit Suisse
508 views
0 comments
0 upvotes
Fullstack Developer
3 rounds | 3 problems
Interviewed by Credit Suisse
960 views
1 comments
0 upvotes
ENO
4 rounds | 4 problems
Interviewed by Credit Suisse
670 views
0 comments
0 upvotes