Samsung R&D interview questions – Campus Placement

I appeared for Samsung R&D Bengaluru in MNIT campus interview recently. I would like to contribute for CrazyforCode by sharing my experience. First of all I would like to thanks crazyforcode for maintaining such a good website. Technical Interview :- Q1. Detailed discussion on the project that I had did in summers(I had did that Read More →

What is the difference between delete, truncate and drop?

TRUNCATE is DDL command. It is used to delete all the rows from table. You can not use where clause with truncate. It also free up the space containing the table. Truncate is executed by taking table lock. You can not retrieve data even after rollback is performed, in case of truncate as it does Read More →

Find the number occurring odd number of times in an array

You are given an array of integers. All the numbers in array occurs even number of times except the one which occurs odd number of time. You have to find the number in O(N) time and constant space. For eg. 1,4,6,7,3,1,4,7,3,1,6 (given array) Output: 1 Solution: Take bitwise XOR of all the elements. We will Read More →

Print nodes at K distance from root in binary tree

In a binary tree, given a root and a number K. You have to find the all nodes at distance K from given root node. For example in a given tree, if K =2 then Output should be 4,5,6 if k = 1 then Output should be 2,3 Time complexity: O(N) as we have to Read More →

Snapdeal Interview Questions – Set 1

I have appeared for snapdeal some time back. I am sharing my interview experience with crazyforcode. First Round: 1. Lowest Common Ancestor of two nodes in binary tree.I wrote code for this.Then interviewer drew a tree and asked to print stacktrace on it. 2. You are given two ropes.Each rope takes exactly 1 hour to Read More →

Directi Interview Questions – Campus Placement

Company : DIRECT-I Year : 2012 First of all, I would like to sincerely thank the entire CrazyforCode team for creating and maintaining such an awesome site. Written Round : • General Aptitude + technical questions (C, OOP, DBMS) • Aptitude questions (with a few exceptions)were easy, technical questions were of moderate difficulty • C Read More →

Nvidia Graphics interview

Aptitude Test: Aptitude test consisted of 4 sections: First section includes basic languages like C, C++. Second section includes questions on Operating System. Third section includes questions on Data Structures. And the last section includes logical questions or puzzles. 1)C & C++ [20 Q’s 20Marks] 2)OS [20 Q’s 20Marks] 3)DSA [15 Q’s 15Marks] 4)Analytical [15 Read More →

13 Caves And A Thief Puzzle

13-caves-and-a-thief-puzzle-150x150

Problem: There are 13 caves arranged in a circle. There is a thief  in one of the caves. Each day the the thief can move to any one of adjacent cave or can stay in smae cave in which he was staying the previous day. And each day, cops are allowed to enter any two Read More →

Can a private method in super class be overriden in the sub-class?

No, a private method cannot be overridden since it is not visible from any other class. If we do this than its a new method for your subclass that has no relation to the superclass method. One way to look at it is to ask yourself whether it would be legal to write super.func() in Read More →

Is it possible to override static methods in java?

Answer is NO if you think from the perspective of how an overriden method should behave in Java. But, you don’t get any compiler error if you try to override a static method. That means, if you try to override, Java doesn’t stop you doing that but you certainly don’t get the same effect as Read More →

Java – Overriding

If a class inherits a method from its super class, then there is a chance to override the method provided that it is not marked final. The benefit of overriding is: ability to define a behavior that’s specific to the subclass type which means a subclass can implement a parent class method based on its Read More →

Supersonic bee and trains

Problem: Two trains enter a tunnel 200 miles long, traveling at 100 mph at the same time from opposite directions. As soon as they enter the tunnel a supersonic bee flying at 1000 mph starts from one train and heads toward the other one. As soon as it reaches the other one it turns around Read More →