Pergunta de entrevista da empresa Veeva Systems

1. What are the basic principles of OOP? After answered, asked to explain each one. 2. (Coding) Given two strings, figure out if they are anagrams (Kept asking for a better answer until a good linear solution was presented) 3. Given a tile class, where each tile knows: the tile to the east, north, west, and south, along with whether it is a golden tile or not. Tiles are laid out in a large square (of unknown size), and there is only 1 golden tile. You start at one tile within the sqare (unknown) and need to find a path to the golden tile (list directions of east/south/north/west, in order).

Resposta da entrevista

Sigiloso

20 de ago. de 2018

1. Abstraction, Inheritance, Encapsulation, Polymorphism 2. Looped through each character in first string, for each new character I added it to a hashmap with a 1 (for a count). If character was already in map, added 1 to count. Looped through second string and subtracted 1 from count of each occurring character. If a new character not in hashmap was found, or a count for any character was not 0, it is not an anagram. 2. Tried using recursion to cover all spots, ran out of time before I could finish implementing solution.