Software engineer 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
- Associate Software Engineer
- Java Developer
- Software Development Engineer
- Business Analyst
- Technical Lead
- Trainee Software Engineer
- Software Development Engineer II
- Systems Engineer
- Technical Support Engineer
- QA Engineer
- Software Engineer II
- Project Manager