Bloomberg L.P.
3.2 of 5 1,031 reviews New York, NY 5000+ Employees

Bloomberg L.P. Financial Software Engineer Interview Question

I interviewed in New York, NY and was asked:
"You're given a set of strings. You want to test if any two strings in the set are anagrams."
Tags: data structures, algorithm
Add Tags [?]
Answer Flag Question

Part of a Financial Software Engineer Interview Review - one of 1,609 Bloomberg L.P. Interview Reviews

Answers & Comments

of 0
I gave a solution that involved sorting the strings and using that as elements of a new set to check for anagrams. They asked me to reduce the memory footprint of my solution without sacrificing the O(N) time (N = number of strings, we assumed that string lengths were O(1)). I suggested that if the strings represent words in a natural language, we might be able to apply the same Huffman encoding to everything in the set, which maybe could reduce space by, say, 50%. They seemed satisfied with that solution.
- Interview Candidate on Nov 3, 2011 Flag Response
of 0
You could also check to see if the words have the same number of characters and same characters using a hash map. Only anagrams can satisfy that.
- Rio on Nov 14, 2011 Flag Response

To comment on this question, Sign In with Facebook or Sign Up

Bloomberg L.P. – Why Work for Us?

Bloomberg’s global mission is to help individuals, enterprises and governments make smarter, faster, more profitable decisions — first. In order to get there, we need constant ideas, energy, innovation— which is where… Full Overview

Provided by employer [?]

Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at Bloomberg L.P. interview questions and advice. All interview reviews posted anonymously by Bloomberg L.P. employees and interview candidates.