Always remember question-solving is not everything in the interview, its a part of interview. Communicating well with the interviewer is most important thing during the interview. Also practice lot of Data Structures and Algorithms based questions that I have practiced from Coding Ninjas and on other coding portals.
Mention good projects and only those skills in which you are confident.
This was Online Coding round on Samsung Software. There were 50 test cases and all test cases should be passed to get selected.
You are given N stones, labeled from 1 to N. The i-th stone has the weight W[i]. There are M colors, labeled by integers from 1 to M. The i-th stone has the color C[i] (of course, an integer between 1 to M, inclusive). You want to fill a Knapsack with these stones. The Knapsack can hold a total weight of X. You want to select exactly M stones; one of each color. The sum of the weights of the stones must not exceed X. Since you paid a premium for a Knapsack with capacity X (as opposed to a Knapsack with a lower capacity), you want to fill the Knapsack as much as possible.
Write a program that takes all the above values as input and calculates the best way to fill the Knapsack – that is, the way that minimizes the unused capacity. Output this unused capacity.
This was also Face to Face coding Interview totally based on Data Structures and Algorithms.
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order.
Given a binary tree, print the top view of it. The output nodes can be printed in any order. Expected time complexity is O(n)
1
/ \
2 3
/ \ / \
4 5 6 7
Top view of the above binary tree is
4 2 1 3 7
1
/ \
2 3
\
4
\
5
\
6
Top view of the above binary tree is
2 1 3 6
This Face to Face Interview was Based on coding and projects.
To find the merging point of link list(Given pointers to the head nodes of 2 linked lists that merge together at some point, find the Node where the two lists merge. It is guaranteed that the two head Nodes will be different, and neither will be NULL.)
Implement DFS algorithm for the graph.
HR round was mainly based on questions about myself and my knowledge about the company.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which collection class forbids duplicates?