State Street interview prep
5 practice questions on the topics candidates reported from State Street interviews, with answers. The questions are ours; each one links to the interview report that names its topic.
DSA 2
-
A queue is built on a fixed-size array with front and rear indexes. Why is it usually made circular, so rear wraps around to index 0?
- So the queue can hold more items than the array size
- So dequeue becomes O(log n)
- So slots freed by dequeues at the front can be reused; otherwise rear reaches the end while the array still has room
- So the items stay sorted
Show the answer
C. So slots freed by dequeues at the front can be reused; otherwise rear reaches the end while the array still has room
Without wrapping, front and rear only ever move right, and the queue reports full once rear hits the end even if the front is empty. Moving with (index + 1) % size reuses that space. A linked-list queue has no fixed size but spends extra memory on each node.
This topic is named in a candidate’s interview report: On-campus interview, 2023, on GeeksforGeeks.
-
In a doubly linked list you insert node n right after node p, where p is not the tail. Which set of pointer updates is right?
- p.next = n only
- n.prev = p; n.next = p.next; p.next.prev = n; p.next = n
- p.next = n; n.next = p.next
- n.next = p; p.prev = n
Show the answer
B. n.prev = p; n.next = p.next; p.next.prev = n; p.next = n
Four links change. Set n's own two pointers first, then point the old successor back at n, and only last overwrite p.next: changing p.next first would lose the old successor. If p is the tail, the old successor is null and the tail pointer moves to n.
This topic is named in a candidate’s interview report: On-campus interview, 2023, on GeeksforGeeks.
Web development 2
-
How do radio buttons differ from checkboxes in an HTML form?
- They behave the same
- Radio buttons that share a name form a group in which only one can be selected; each checkbox is on or off independently
- Checkboxes allow only one choice
- Radio buttons cannot be submitted with a form
Show the answer
B. Radio buttons that share a name form a group in which only one can be selected; each checkbox is on or off independently
A gender or plan picker is a radio group: <input type="radio" name="gender" value="female">, with a label for each. The shared name is what makes picking one clear the others. Checkboxes fit "choose any that apply".
This topic is named in a candidate’s interview report: On-campus interview, 2023, on GeeksforGeeks.
-
Which JavaScript statement reloads the current page?
- window.refresh()
- location.reload()
- document.reload()
- history.reload()
Show the answer
B. location.reload()
location.reload() loads the current URL again. Assigning location.href = location.href also works but can be ignored when the URL has a #fragment. Browsers removed the old forced-reload argument, reload(true).
This topic is named in a candidate’s interview report: On-campus interview, 2023, on GeeksforGeeks.
Software engineering 1
-
How does an agile process differ from the waterfall model?
- They are the same process with different names
- Waterfall runs requirements, design, build, test and release once, in order; agile delivers working software in short iterations and revises requirements as feedback comes in
- Agile skips testing
- Waterfall needs no documentation
Show the answer
B. Waterfall runs requirements, design, build, test and release once, in order; agile delivers working software in short iterations and revises requirements as feedback comes in
Waterfall suits fixed, well understood requirements, but a misunderstanding surfaces only at the end. Agile methods such as Scrum release every few weeks so mistakes are caught early. The iterative waterfall adds feedback between phases.
This topic is named in a candidate’s interview report: On-campus interview, 2023, on GeeksforGeeks.