Software engineering interview questions shared by candidates
You are given a stream of directions in [up, down, left, right]. Each direction means move one unit in that direction. After completing the movements, you will return to the position where you started. Compute the area of the shape you created. I was asked this when FactSet interviewed me a very long time ago. I liked the question so I sometimes use it myself when I interview other applicants..
There is no answer. The interviewer just wants to have a good discussion with you about algorithms and running time.
Does this mean the area of steps taken (not including duplicate steps)? Or the area of the steps taken AND area of the shape within those steps (assuming the steps produce a complete shape)?
use the floor function of (number of moves / 2). [n/2]
See Interview Questions for Similar Jobs
- Senior Software Engineer
- Software Developer
- Software Development Engineer
- Software Engineer Intern
- Data Scientist
- Product Manager
- Business Analyst
- Associate Software Engineer
- Staff Software Engineer
- Java Developer
- Project Manager
- Senior Software Developer
- Software Engineering Intern
- Software Engineer III