Enterprise Applications Developer Interview Questions

101 enterprise applications developer interview questions shared by candidates

Coding challenge you'll build a simplified version of [battleship](https://en.wikipedia.org/wiki/Battleship_(game)). You'll have 3 ships that will be placed on a 10 by 10 grid which is the battleground. Each cell in the battleground is identified by its space on an x,y axis with [0,0] being the cell in the bottom left corner. Each ship is 1 cell wide and 3 cells long. On initial placement, each ship is oriented vertically. To initialize the playing field you'll receive a 2 dimensional array where each element in the array contains the x,y coordinates of each ship's topmost cell. So for example, if you receive this array [[0,3],[4,8],[6,6]] then your initial playing board will have ships that occupy the following cells: `[[0,3],[0,2],[0,1]]`, `[[4,8],[4,7],[4,6]]` and `[[6,6],[6,5],[6,4]]` Your game interface will be a basic HTTP API. Each of the methods should return a JSON response with a single property named `message`. We want you to flesh out the provided battleship app so that the `create` function in `app/game/index.js` accepts a 2-dimensional array (represented as JSON) that contains the topmost cell coordinates of ships to initialize the playing board. You'll then need to complete the `update` method to take x and y parameters and return a JSON response where `message` is set to the string "hit" if the coordinate lands on a ship. The `update` method should return the string "miss" for the `message` property if the coordinate does not land on a ship. If a ship has been hit on all 3 of its cells then the `update` method should return the string "sunk" for the `message` property. What we're looking for We want you to submit a solution you're proud of and we want you to be successful so here are some of the things we're looking for in a solution: * A solution that is correct for various input values. We're big fans of writing tests to help us build quality software. * A solution that shows good object oriented (or functional) programming principles but doesn't go overboard. * A solution that shows familiarity with the language used.
avatar

Enterprise Applications Engineer

Interviewed at GitHub

3.7
Mar 20, 2017

Coding challenge you'll build a simplified version of [battleship](https://en.wikipedia.org/wiki/Battleship_(game)). You'll have 3 ships that will be placed on a 10 by 10 grid which is the battleground. Each cell in the battleground is identified by its space on an x,y axis with [0,0] being the cell in the bottom left corner. Each ship is 1 cell wide and 3 cells long. On initial placement, each ship is oriented vertically. To initialize the playing field you'll receive a 2 dimensional array where each element in the array contains the x,y coordinates of each ship's topmost cell. So for example, if you receive this array [[0,3],[4,8],[6,6]] then your initial playing board will have ships that occupy the following cells: `[[0,3],[0,2],[0,1]]`, `[[4,8],[4,7],[4,6]]` and `[[6,6],[6,5],[6,4]]` Your game interface will be a basic HTTP API. Each of the methods should return a JSON response with a single property named `message`. We want you to flesh out the provided battleship app so that the `create` function in `app/game/index.js` accepts a 2-dimensional array (represented as JSON) that contains the topmost cell coordinates of ships to initialize the playing board. You'll then need to complete the `update` method to take x and y parameters and return a JSON response where `message` is set to the string "hit" if the coordinate lands on a ship. The `update` method should return the string "miss" for the `message` property if the coordinate does not land on a ship. If a ship has been hit on all 3 of its cells then the `update` method should return the string "sunk" for the `message` property. What we're looking for We want you to submit a solution you're proud of and we want you to be successful so here are some of the things we're looking for in a solution: * A solution that is correct for various input values. We're big fans of writing tests to help us build quality software. * A solution that shows good object oriented (or functional) programming principles but doesn't go overboard. * A solution that shows familiarity with the language used.

Viewing 21 - 30 interview questions

Glassdoor has 101 interview questions and reports from Enterprise applications developer interviews. Prepare for your interview. Get hired. Love your job.