PuzzlersWorld.com

  • Hacker Puzzle
  • Interview Puzzles
  • Number Puzzles
  • Maths Puzzles

Interview

Interview Puzzles

Consonants Solution: Google codejam 2013 Round 1C

May 20, 2013 by puzzler Leave a Comment

Most of us are familiar with google codejam, those who don’t visit https://code.google.com/codejam for more information. This is the first problem from Online Round 1C 2013, top 1000 from this round will be eligible for next online round.

Problem Statement

In English, there are 26 letters that are either vowels or consonants. In this problem, we consider a, e, i, o, and u to be vowels, and the other 21 letters to be consonants.

A tribe living in the Greatest Colorful Jungle has a tradition of naming their members using English letters. But it is not easy to come up with a good name for a new member because it reflects the member’s social status within the tribe. It is believed that the less common the name he or she is given, the more socially privileged he or she is.

The leader of the tribe is a professional linguist. He notices that hard-to-pronounce names are uncommon, and the reason is that they have too many consecutive consonants. Therefore, he announces that the social status of a member in the tribe is determined by its n-value, which is the number of substrings with at least n consecutive consonants in the name. For example, when n = 3, the name “quartz” has the n-value of 4 because the substrings quartz, uartz, artz, and rtz have at least 3 consecutive consonants each. A greater n-value means a greater social status in the tribe. Two substrings are considered different if they begin or end at a different point (even if they consist of the same letters), for instance “tsetse” contains 11 substrings with two consecutive consonants, even though some of them (like “tsetse” and “tsetse“) contain the same letters.
[Read more…]

Checkout more Interview Questions Tags: Google codejam, Interview, Java, Solved Puzzles

Bullseye Solution: Google codejam 2013 Round 1A

April 27, 2013 by puzzler 4 Comments

Most of us are familiar with google codejam, those who don’t visit https://code.google.com/codejam for more information. This is the first problem from Online Round 1A 2013, top 1000 from this round will be eligible for next online round.

Problem

Maria has been hired by the Ghastly Chemicals Junkies (GCJ) company to help them manufacture bullseyes. A bullseye consists of a number of concentric rings (rings that are centered at the same point), and it usually represents an archery target. GCJ is interested in manufacturing black-and-white bullseyes.

Maria starts with t millilitres of black paint, which she will use to draw rings of thickness 1cm (one centimetre). A ring of thickness 1cm is the space between two concentric circles whose radii differ by 1cm.

Maria draws the first black ring around a white circle of radius r cm. Then she repeats the following process for as long as she has enough paint to do so:

  1. Maria imagines a white ring of thickness 1cm around the last black ring.
  2. Then she draws a new black ring of thickness 1cm around that white ring.

Note that each “white ring” is simply the space between two black rings.

The area of a disk with radius 1cm is π cm2. One millilitre of paint is required to cover area π cm2. What is the maximum number of black rings that Maria can draw? Please note that:

  • Maria only draws complete rings. If the remaining paint is not enough to draw a complete black ring, she stops painting immediately.
  • There will always be enough paint to draw at least one black ring.

[Read more…]

Checkout more Interview Questions Tags: Google codejam, Interview, Java, Solved Puzzles

Inverted cards puzzle

April 21, 2013 by puzzler Leave a Comment

 

inverted cards puzzle

inverted cards puzzle

One fine day, Santa and banta were playing cards, but suddenly power went off and they were getting bored. So santa randomly inverted position of 10 cards out of 52 cards(and shuffled it) and asked banta to divide the card in two pile with equal number of inverted cards(number of cards in each pile need not be equal). It was very dark in the room and banta could not see the cards, after thinking a bit banta divided the cards in two piles and quite surprisingly on counting number of inverted cards in both the piles were equal.
[Read more…]

Checkout more Interview Puzzles Tags: Interesting Puzzles, Interview, medium, Puzzle, Solved Puzzles

10 prisoners and hats puzzle

April 20, 2013 by puzzler 12 Comments

Their are 10 prisoners in a jail for a minor crime, they all request the jail officer to set them free, jail officer agrees to release them tomorrow, saying i will

  1. Make you all stand in a queue in ascending order of your heights(smallest first).
  2. You will not be allowed to turn your head(they have to look straight)
  3. I will put one hat on your head, either BLACK or WHITE in color.
  4. Everyone of you has to tell the color of his hat starting from the tallest prisoner, you can only say BLACK or WHITE.
  5. You all will be released, if and only if at least 9 of you guess your hat’s color correctly.

Can you suggest a strategy to the prisoners to maximize the chances of their release?

10 prisoners and hats puzzle

10 prisoners and hats puzzle

[Read more…]

Checkout more Logical Puzzles Tags: Difficult, Hats Puzzles, Interview, Puzzle, Solved Puzzles

Rectangular cake puzzle

April 18, 2013 by puzzler 2 Comments

 

rectangle cake

rectangle cake

Given a rectangular cake with a rectangular piece removed(of any size and orientation) how can you cut the rectangle in two equal parts with one straight line cut of a knife.
Note:- The cut is of any size and any orientation, it means the removed piece can be one of the layer of the cake.
[Read more…]

Checkout more Logical Puzzles Tags: Interesting Puzzles, Interview, medium, Puzzle, Solved Puzzles

Four glasses on a square table

April 15, 2013 by puzzler 4 Comments

four glasses on a square table puzzle, also known as the blind bartender’s problem

Four glasses are placed on the corners of a square table. Some of the glasses are upright (up) and some upside-down (down). You have to arrange the glasses so that they are all up or all down (while keeping your eyes closed all the time). The glasses may be re-arranged in turns subject to the following rules.

  1. Any two glasses may be inspected in one turn and after feeling their orientation you may reverse the orientation of either, neither or both glasses.
  2. After each turn table is rotated through a random angle.
  3. At any point of time if all four glasses are of the same orientation a ring will bell

You have to come up with a solution to ensure that all glasses have the same orientation (either up or down) in a finite number of turns. The algorithm must be non-stochastic i.e. it must not depend on luck.
[Read more…]

Checkout more Interview Puzzles Tags: Difficult, Interview, Puzzle, Solved Puzzles

Fair and Square Solution: Google codejam 2013 Qual Round

April 14, 2013 by puzzler Leave a Comment

Most of us are familiar with google codejam, those who don’t visit https://code.google.com/codejam for more information. This is the third problem from Qualification Round 2013.

Problem Statement

Little John likes palindromes, and thinks them to be fair (which is a fancy word for nice). Apalindrome is just an integer that reads the same backwards and forwards – so 6, 11 and 121 are all palindromes, while 10, 12, 223 and 2244 are not (even though 010=10, we don’t consider leading zeroes when determining whether a number is a palindrome).

He recently became interested in squares as well, and formed the definition of a fair and square number – it is a number that is a palindrome and the square of a palindrome at the same time. For instance, 1, 9 and 121 are fair and square (being palindromes and squares, respectively, of 1, 3 and 11), while 16, 22 and 676 are not fair and square: 16 is not a palindrome, 22 is not a square, and while 676 is a palindrome and a square number, it is the square of 26, which is not a palindrome.

Now he wants to search for bigger fair and square numbers. Your task is, given an interval Little John is searching through, to tell him how many fair and square numbers are there in the interval, so he knows when he has found them all.
[Read more…]

Checkout more Interview Questions Tags: Difficult, Google codejam, Interview, Java, Solved Puzzles

Lawnmower Solution: Google codejam 2013 Qual Round

April 14, 2013 by puzzler Leave a Comment

Most of us are familiar with google codejam, those who don’t visit https://code.google.com/codejam for more information. This is the second problem from Qualification Round 2013.

Problem

Alice and Bob have a lawn in front of their house, shaped like an N metre by M metre rectangle. Each year, they try to cut the lawn in some interesting pattern. They used to do their cutting with shears, which was very time-consuming; but now they have a new automatic lawnmower with multiple settings, and they want to try it out.

The new lawnmower has a height setting – you can set it to any height h between 1 and 100 millimetres, and it will cut all the grass higher than h it encounters to height h. You run it by entering the lawn at any part of the edge of the lawn; then the lawnmower goes in a straight line, perpendicular to the edge of the lawn it entered, cutting grass in a swath 1m wide, until it exits the lawn on the other side. The lawnmower’s height can be set only when it is not on the lawn.

Alice and Bob have a number of various patterns of grass that they could have on their lawn. For each of those, they want to know whether it’s possible to cut the grass into this pattern with their new lawnmower. Each pattern is described by specifying the height of the grass on each 1m x 1m square of the lawn.

The grass is initially 100mm high on the whole lawn.
[Read more…]

Checkout more Interview Questions Tags: Google codejam, Interview, Java, medium, Solved Puzzles

Tic-Tac-Toe-Tomek Solution: Google codejam 2013 Qual Round

April 14, 2013 by puzzler Leave a Comment

Most of us are familiar with google codejam, those who don’t visit https://code.google.com/codejam for more information. This is the first problem from Qualification Round 2013.

Problem Statement

Tic-Tac-Toe-Tomek is a game played on a 4 x 4 square board. The board starts empty, except that a single ‘T’ symbol may appear in one of the 16 squares. There are two players: X and O. They take turns to make moves, with X starting. In each move a player puts her symbol in one of the empty squares. Player X’s symbol is ‘X’, and player O’s symbol is ‘O’.

After a player’s move, if there is a row, column or a diagonal containing 4 of that player’s symbols, or containing 3 of her symbols and the ‘T’ symbol, she wins and the game ends. Otherwise the game continues with the other player’s move. If all of the fields are filled with symbols and nobody won, the game ends in a draw. See the sample input for examples of various winning positions.

Given a 4 x 4 board description containing ‘X’, ‘O’, ‘T’ and ‘.’ characters (where ‘.’ represents an empty square), describing the current state of a game, determine the status of the Tic-Tac-Toe-Tomek game going on. The statuses to choose from are:

  • “X won” (the game is over, and X won)
  • “O won” (the game is over, and O won)
  • “Draw” (the game is over, and it ended in a draw)
  • “Game has not completed” (the game is not over yet)

If there are empty cells, and the game is not over, you should output “Game has not completed”, even if the outcome of the game is inevitable.
[Read more…]

Checkout more Interview Questions Tags: Easy, Google codejam, Interview, Java, Solved Puzzles

Sort the array in O(N)

April 11, 2013 by puzzler 1 Comment

Problem Statement
Given an integer array of length N, containing values in the range 1,2,3…N^2. Sort the array in O(N) time.

Solution
[Read more…]

Checkout more Interview Questions Tags: Algorithm, Array, Difficult, Interview, Java, Solved Puzzles

  • 1
  • 2
  • 3
  • …
  • 6
  • Next Page »
Submit your Puzzle

You may also like

    Categories

    • Aive hi Puzzles
    • Akbar and Birbal
    • Alphabetical Puzzles
    • Bollywood Puzzles
    • Google Code jam
    • Hindi Riddles
    • Interview Puzzles
    • Interview Questions
    • Logical Puzzles
    • Malayalam Puzzles
    • Maths Puzzles
    • Miscellaneous
    • Number Puzzles
    • Picture Puzzles
    • Riddles
    • Tamil Puzzles
    • Technical

    Social

    • View puzzlersworld’s profile on Twitter
    privacy policy

    Copyright © 2023 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in

    • Hacker Puzzle
    • Logo Puzzles
    • Optical Illusions
    • WhatsApp Puzzles
    • Picture Puzzles
    • Riddles
      ▼
      • Hindi Riddles
    • Bollywood Puzzles
    • Alphabetical Puzzles
    • Aive hi Puzzles
    • Interview Puzzles
    • Logical Puzzles
    • Interview Questions
      ▼
      • Data Structures
      • Binary Tree
      • Algorithms
      • Recursion Questions
      • Amazon Interview Questions
      • Snapdeal Interview Questions
      • Google Code jam
    • Technical
    • Akbar and Birbal
    • Number Puzzles
    • Maths Puzzles
    • Miscellaneous