employer cover photo
employer logo
employer logo

Lithium Technologies

Oggi denominata Khoros

Questa è la tua azienda?

Domanda di colloquio di Lithium Technologies

Questions from engineers: a. Find the missing integer in a random length int[] array. b. Minimize sets of batch email addresses sent to an API, preserving address ordering, do not include duplicates in a batch. c. Define a login interface for a web app that works for a single server then multiple servers d. Develop a pub/sub interface which suppresses duplicates and supports priority levels e. Describe the architecture for a product on your resume explain how each part works in detail.

Risposta di colloquio

Anonimo

26 nov 2013

a. lots of solutions, typical is probably Arrays.sort(), iterate through array until array[i] != (array[i+1] + 1) b. List> batches = new LinkedList>(); batches.add(new LinkedList()); outter: for (final String address : addresses) { for (final List batch : batches) { if (!batch.contains(address)) { batch.add(address); continue outter; } } List newBatch = new LinkedList(); newBatch.add(address); batches.add(newBatch); } return batches; c. Use form login or http authentication to identity a user, create a servlet session via cookie or url-rewriting. For distributed nodes, save the servlet session using a container mechanism to a backing store (rdbms or nosql). session state should have simple userid, login time, last activity time for aging logins. d. Use Java Observer/Observable to implement basic pub-sub classes, define an enum for priority and do not notify if below the current notification level. Keep notifications in a non-duplicating collection.