Don’t create panic in any case in the interview , as even if you are not selected you will learn a lot from your interview experience and perform well in the future. Also I would recommend you Coding Ninjas as according to me it is a good platform to learn basic coding concepts and to practice coding.
Write whatever you are sure about and have actually done that. CGPA plays a good role but not a complete role as it is just eligibility criteria for some companies. Have at least 1 or 2 good projects from which you know everything involved in the project.
This round consist of two questions and we have to solve both the questions to qualify for the next round.
Count number of occurrences (or frequency) in a sorted array
Given a sorted array arr[] and a number x, write a function that counts the occurrences of x in arr[].
Examples:
Input: arr[] = {1, 1, 2, 2, 2, 2, 3,}, x = 2
Output: 4
2 occurs 4 times in arr[]
Given an array and an integer K, find the maximum for each and every contiguous subarray of size k.
Examples :
Input: arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6}, K = 3
Output: 3 3 4 5 5 5 6
Explanation:
Maximum of 1, 2, 3 is 3
Maximum of 2, 3, 1 is 3
Maximum of 3, 1, 4 is 4
Maximum of 1, 4, 5 is 5
Maximum of 4, 5, 2 is 5
Maximum of 5, 2, 3 is 5
Maximum of 2, 3, 6 is 6
A single coding question was asked that had a lot of corner cases.
Convert a given number into words for news reading by a device.
Example :
If the given input is 62, the output should be 'Sixty two' (without quotes).
It had 3 coding questions followed by basic concepts of DP.
Converting a min heap to a max heap. There can be multiple max heaps possible. Any max heap will be good.
You have been given stock values/prices for N number of days. Every i-th day signifies the price of a stock on that day. Your task is to find the maximum profit which you can make by buying and selling the stocks.
To find the maximum difference between a node and its descendent in the same path in the binary tree.
It had 2 coding questions which were of good level.
Implement a data structure that can perform insertion, deletion, searching in constant time.
Find an MST from a given graph by using Kruskal algorithm.
This was the last round.
You are given a Singly Linked List which contains a series of integers separated by ‘0’.
Between two zeroes, you have to merge all the nodes lying between them into a single node which contains the sum of all the merged nodes. You have to perform this in place.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you write a single-line comment in C++?