Yatra.com Interview Questions

Recently I got an opportunity to appear for Yatra.com interview fro Senior Software Developer Java position. I would like to shrae it with CrazyforCode. Round 1 (Technical): Q1. Find whether a binary tree is BST or NOT? Q2. Reverse a linked list recursively? Q3. Quick sort? Q4. Given 2 arrays, need to merge them and Read More →

Heavy and Light Balls Puzzle

Puzzle: You have 2 ball of each A,B,C colors and each color have 1 light and 1 heavy ball. All light balls are of same weight same goes for heavy. Find out weight type of each ball in minimum chances. You can use a two sided balance system (not the electronic one). This puzzle was Read More →

Burning Rope Timer Puzzle

Daily Puzzle

Puzzle: A man has two ropes of varying thickness (Those two ropes are not identical, they aren’t the same density nor the same length nor the same width). Each rope burns in 60 minutes. He actually wants to measure 45 mins. How can he measure 45 mins using only these two ropes. He can’t cut Read More →

Grandma and Cake – Logical Puzzle

Puzzle: You are on your way to visit your Grandma, who lives at the end of the valley. It’s her anniversary, and you want to give her the cakes you’ve made. Between your house and her house, you have to cross 5 bridges, and as it goes in the land of make believe, there is a troll under every Read More →

Inverted Cards Puzzle

Problem: One day, Santa and banta were playing cards, but suddenly power went off. Santa randomly inverted position of 15 cards out of 52 cards(and shuffled it) and asked banta to divide the card in two piles with equal number of cards facing up. It was very dark in the room and banta could not Read More →

Red and Blue Balls in a Bag

Problem: You have 20 Blue balls and 10 Red balls in a bag. You put your hand in the bag and take off two at a time. If they’re of the same color, you add a Blue ball to the bag. If they’re of different colors, you add a Red ball to the bag. What Read More →

Qualcomm Interview Questions – Set 1

Company: Qualcomm College: IIT Roorke Written Test: It was an online MCQ test. Time limit was one hour. There were around 55 question. It consists of three sections: 1) Aptitude Questions Pretty simple. 2) Programming ability : Patience is required to solve the questions. They were easy. Most of them had 3 to 4 nested Read More →

Handshake Problem

Problem: At a party, everyone shook hands with everybody else. There were 66 handshakes. How many people were at the party? This question is asked in Infosys written. Solution: Lets say there are n persons 1st person shakes hand with everyone else: n-1 times(n-1 persons) 2nd person shakes hand with everyone else(not with 1st as Read More →

Reverse a Linked List using Recursion

Problem: To test both data structure and the recursion concept, a wonderful and confusing interview question asked to experienced people is “Reverse a linked list using recursion”. Solution: In recursive approach, we need to move to the end of the node. But must stop just before the end of the node, and we should have Read More →

Populate each next pointer to point to its next right node

Problem: Given a binary tree populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all next pointers are set to NULL. You may assume that it is a perfect binary tree (i.e. all leaves are at the Read More →

Check if Two Trees are Identical

Problem: Given two binary trees, write a function to check if they are equal or not. Solution: Two binary trees are considered equal if they are structurally identical andthe nodes have the same value. Time Complexity: O(N), Where N is number of nodes in a tree. This article is contributed by Vishwas Garg. You can Read More →

Find a Number that Appears Only once in array of Duplicates

Problem: Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory. Solution: Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory. Solution: XORing x with itself gives Read More →