Skip to main content

All Questions

Filter by
Sorted by
Tagged with
5 votes
2 answers
643 views

Thread-safe write-efficient register() method for a Load balancer

The code below was written for an interview question of designing a load balancer with only a register() method. ...
drets's user avatar
  • 313
2 votes
2 answers
146 views

A thread-safe performant Money Transfer API in Java

This is a popular interview question. It is meant to be done within 30 minutes. The task is to implement a thread-safe performant Bank Account API that allows to transfer, deposit, withdraw and check ...
Sasha Shpota's user avatar
7 votes
2 answers
1k views

A thread-safe performant URL Shortener in Java

This is a popular interview question. It is meant to be done within 45 minutes. The task is to implement a thread-safe performant in-memory URL Shortener. My implementation is based on two maps that ...
Sasha Shpota's user avatar
6 votes
2 answers
272 views

Data analysis program for job interview

Before the interview for the Junior (i hope:)) position of Java developer, I was asked to do a test task. Kindly ask you to review my code. Riht now program arguments are hardcoded and not from args[],...
Daniil Peterson's user avatar
2 votes
1 answer
1k views

Modelling a Call Center in Java (multithreading approach)

I wanted to give a shot to Modelling a Call Center from Cracking the Coding Interview. The problem statement is as follows: You have a call center with three levels of employees: Respondent, Manager,...
Koray Tugay's user avatar
  • 1,557
1 vote
1 answer
3k views

Print odd and even numbers using two threads in Java

I was asked below question in an interview where I need to print out even and odd numbers using two threads so I came up with below code one without synchronization and other with synchronization. <...
user5447339's user avatar
3 votes
1 answer
666 views

Thread-safe arraylist with get, put, add, remove functions

I am preparing for multithreading interview questions and I don't have much experience with multithreading. I referred some online article to come up with a solution. Is this solution appropriate? <...
user2038560's user avatar
6 votes
1 answer
3k views

Task scheduler coding exercise

In an interview about multithreading I was asked to write code to satisfy the requirements below: In the exercise you need to provide implementation of single-threaded TaskScheduler class with the ...
dghtr's user avatar
  • 287
6 votes
3 answers
22k views

Client Sends XML, Server Parses XML, Queues Up and Executes Commands

I recently had a Java interview where I was asked to write a client-server application. I don't code primarily in Java, but with my preliminary Java knowledge, I thought I built a reasonable working ...
DigitalEye's user avatar
36 votes
2 answers
6k views

Asynchronous network callback code

I did not get the job after submitting this piece of work in an interview, but I have no feedback to know what "BAD" things are inside this block of code. The requirements are: Connect to the ...
Kit Ho's user avatar
  • 491
2 votes
5 answers
2k views

Bounded blocking queue

Can someone please review this code for me? I have not implemented all the methods for simplicity. ...
p101's user avatar
  • 343