Fragen im Vorstellungsgespräch bei Allscripts: in an auditorium with various... |

Frage im Vorstellungsgespräch

Associate Software Engineer-Vorstellungsgespräch Springfield, IL (Vereinigte Staaten von Amerika)

in an auditorium with various filled or empty seats [a

  boolean array], create a function that returns the best open seat. The best open seat being the one with the most empty seats around it. He said I could email him the answer the next day but if they say that that means you failed pretty much.

Antwort im Vorstellungsgespräch

1 Antwort


I eventually solved this using 3 for loops and a 2D array. One main loop for iterating through all the seats and 2 other loops to rank the seats by counting the empty seats to the left and right of the current index. Sorting multidimensional arrays was the hard part.

Bewerber im Vorstellungsgespräch am 14.03.2014

Antwort oder Kommentar posten

Um dies zu kommentieren, bitte anmelden oder Konto anlegen.