Jason
BAN USER
Questions (2)
Reputation 50
- 0of 0 votes
AnswersWrite a function to convert a string (char* that contains a number, e.g. "586") to int.
- Jason in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Algorithm - 0of 0 votes
Answers2*45min interviews back-to-back. First interviewer asked two questions.
- Jason in United States
Given n*m fields of O's and X's, where O=white, X=black, for example
OOOXOOO
OOXXOXO
OXOOOXO
Return the number of black shapes. A black shape consists of one or more adjacent X's (diagonals not included). In the example, the answer is 3.
Write code (I chose C++). What data structures would you use to store the input, and what to use for the shapes? What is the runtime complexity?| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Algorithm
Page:
1
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.