PuzzlersWorld.com

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

Security problem solution: Facebook hacker cup 2013 Round 1

February 4, 2013 by puzzler Leave a Comment

From 2011 facebook is organizing a Facebook hacker cup every year around feb, visit Facebook hacker cup homepage for more details

This question is the second question(Carried 35 marks out of 100) for the Round 1 of 2013 hacker cup. only top 500 contestants will be moved to Round 2.

Problem Statement

You are designing a new encryption system that works in the following way:

For server-client communication you need a key k, composed of m sections, each of length l, and the key consists only of lowercase characters in the set {a, b, c, d, e, f}. The server has a key k1 and the client has a key k2 where:

  • k1 = f(k). f is a function that receives a key and replace some random letters by ? indicating that those characters can be any lowercase letter of the set described before.
  • k2 = f(g(k)). g is a function that takes a key and produces a random permutation of its m sections. And f is the function defined above.

For example: let m = 3, l = 2

  • f(‘abacbc’) = ‘?ba??c’
  • g(‘abacbc’) = ‘acbcab’ (each section was moved one place to the left).

Your task is given k1 and k2, find key k. If there are several solutions, print the lexicographically smallest key. And if there is no solution at all, print “IMPOSSIBLE” (without the quotes).

Input description:

[Read more…]

Checkout more Interview Questions Tags: Difficult, Facebook Hacker Cup, Interview, Java, Solved Puzzles

Card Game solution: Facebook hacker cup 2013 Round1

February 4, 2013 by puzzler 1 Comment

From 2011 facebook is organizing a Facebook hacker cup every year around feb, visit Facebook hacker cup homepage for more details

This question is the first question(Carried 20 marks out of 100) for the Round 1 of 2013 hacker cup. only top 500 contestants will be moved to Round 2.

Problem Statement

John is playing a game with his friends. The game’s rules are as follows: There is deck of N cards from which each person is dealt a hand of K cards. Each card has an integer value representing its strength. A hand’s strength is determined by the value of the highest card in the hand. The person with the strongest hand wins the round. Bets are placed before each player reveals the strength of their hand.

John needs your help to decide when to bet. He decides he wants to bet when the strength of his hand is higher than the average hand strength. Hence John wants to calculate the average strength of ALL possible sets of hands. John is very good at division, but he needs your help in calculating the sum of the strengths of all possible hands.

Problem

You are given an array a with N ≤ 10 000 different integer numbers and a number, K, where 1 ≤ K ≤ N. For all possible subsets of a of size K find the sum of their maximal elements modulo 1 000 000 007.

Input

[Read more…]

Checkout more Interview Questions Tags: Facebook Hacker Cup, Interview, Java, Solved Puzzles

Find the Min solution: Facebook hacker Cup 2013 Qual Round

January 29, 2013 by puzzler 4 Comments

From 2011 facebook is organizing a Facebook hacker cup every year around feb, visit Facebook hacker cup homepage for more details

This question is the third question(Carried 45 marks out of 100) for the qualification round 2013 hacker cup.

Problem Statement

After sending smileys, John decided to play with arrays. Did you know that hackers enjoy playing with arrays? John has a zero-based index array, m, which contains n non-negative integers. However, only the first k values of the array are known to him, and he wants to figure out the rest.

John knows the following: for each index i, where k <= i < n, m[i] is the minimum non-negative integer which is *not* contained in the previous *k* values of m.
[Read more…]

Checkout more Interview Questions Tags: Facebook Hacker Cup, Interview, Java, Solved Puzzles, Very Difficult

Balanced Smileys solution: Facebook hacker Cup 2013 Qual Round

January 29, 2013 by puzzler 4 Comments

From 2011 facebook is organizing a Facebook hacker cup every year around feb, visit Facebook hacker cup homepage for more details

This question is the second question((Carried 35 marks out of 100) for the qualification round 2013 hacker cup.

Problem Statement

Your friend John uses a lot of emoticons when you talk to him on Messenger. In addition to being a person who likes to express himself through emoticons, he hates unbalanced parenthesis so much that it makes him go 🙁

Sometimes he puts emoticons within parentheses, and you find it hard to tell if a parenthesis really is a parenthesis or part of an emoticon.

A message has balanced parentheses if it consists of one of the following:
[Read more…]

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

Beautiful Strings solution: Facebook hacker Cup 2013 Qual Round

January 29, 2013 by puzzler Leave a Comment

From 2011 facebook is organizing a Facebook hacker cup every year around feb, visit Facebook hacker cup homepage for more details

This question is the first question in the qualification round of 2013 hacker cup.

When John was a little kid he didn’t have much to do. There was no internet, no Facebook, and no programs to hack on. So he did the only thing he could… he evaluated the beauty of strings in a quest to discover the most beautiful string in the world.

Given a string s, little Johnny defined the beauty of the string as the sum of the beauty of the letters in it.

The beauty of each letter is an integer between 1 and 26, inclusive, and no two letters have the same beauty. Johnny doesn’t care about whether letters are uppercase or lowercase, so that doesn’t affect the beauty of a letter. (Uppercase ‘F’ is exactly as beautiful as lowercase ‘f’, for example.)

You’re a student writing a report on the youth of this famous hacker. You found the string that Johnny considered most beautiful. What is the maximum possible beauty of this string?

[Read more…]

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

Find all non duplicate pairs that sum to S

January 25, 2013 by puzzler Leave a Comment

Find all non duplicate pairs that sum to S.

try to do it in O(nlogn).

Solution 1:
[Read more…]

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

Days of month using 2 dice

January 24, 2013 by puzzler 8 Comments

How can you represent days of month using two 6 sided dice ?

You can write one number on each face of the dice from 0 to 9 and you have to represent days from 1 to 31, for example for 1, one dice should show 0 and another should show 1, similarly for 31 one dice should show 3 and another should show 1.

represent days of month using two dice

represent days of month using two dice

See AnswerHide Answer
Answer is:
Dice 1: 0 1 2 3 5 7
Dice 2: 0 1 2 4 6 8

How?
Basically you have to show 11, 22 so 1 and 2 should be present in both dices, similarly to show 01, 09 0 should be present in both dices, now the trick is for showing 9 you can use dice with 6 printed on one of the face.

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

How many animals

January 21, 2013 by puzzler 6 Comments

 

how many animals do you see

how many animals do you see

How many animals do you see in above image ?

See AnswerHide Answer
There are a total of 6 animals.

Checkout more Picture Puzzles Tags: Easy, How Many, Puzzle, Solved Puzzles

Guess the movie names

January 21, 2013 by puzzler 10 Comments

Guess the movie names from WhatsApp Emoticons and smileys

guess the movie names from the picture

guess the movie names from the picture

Guess the movie names in above image

[Read more…]

Checkout more Picture Puzzles Tags: Difficult, Guess the Movie Names, Solved Puzzles, WhatsApp Emoticons

Triangle angle puzzle

January 21, 2013 by puzzler 3 Comments

 

triangle puzzle

triangle puzzle

What is the missing number in above picture?

See AnswerHide Answer

Answer with Explanation

Answer is 30.
How?
ignore 225, it is to confuse, here we will use the triangles property that the sum of all the angles inside a triangle should be 180 degree.

so 75 + 75 + ? = 180
=> ? = 180 – 150
=> ? = 30

Checkout more Picture Puzzles Tags: Easy, Puzzle, Solved Puzzles, Triangle

  • « Previous Page
  • 1
  • …
  • 64
  • 65
  • 66
  • 67
  • 68
  • …
  • 71
  • 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 © 2025 · 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