All Questions
28 questions
8
votes
3
answers
2k
views
A* (shortest path) with the ability to remove up to one wall
Problem
You are given an HxW matrix. Each element is either 0 (passable space) or 1 (wall).
Given that you can remove one wall, find the shortest path from [0,0] (start)
to [width-1, height-1] (end).
...
3
votes
1
answer
464
views
How to design shopping cart Java application which satisfy modular, extensible and maintainable
I am new in Application Design. I have use-case as below
As per the above story I have implemented code as below without any Modularity, Extensible and Maintainable. Could someone share the thoughts ...
3
votes
3
answers
789
views
An in memory Url Shortener in Java
This is a popular question in machine coding rounds. The requirements are to build a URL shortener. There are certain registered users who have the capability to define a URL and an optional time to ...
5
votes
3
answers
3k
views
Mars Rover technical Challenge in OOP
I am trying to practice OOP and TDD concepts,
I have written this code for Mars rover challenge from
marsrovertechchallenge .
Can you please review my code from my GitHub repository?
Or you can ...
3
votes
2
answers
702
views
Banking application for Udemy Java course
I just "finished" a Udemy Java that involves building a banking application.
Here is the problem definition:
Scenario: You are a back-end developer and need to create an application to handle new ...
0
votes
2
answers
174
views
A simple card game simulator
This is a homework question, and I have written the code but wasn't sure if I had picked the right data structure for this job and minimised time complexity. Can anyone give me some feedback, anything ...
6
votes
2
answers
2k
views
Predict mars robot position
Description
A robot lands on Mars, which happens to be a cartesian grid; assuming that we hand the robot these instructions, such as LFFFRFFFRRFFF, where "L" is a "turn 90 degrees left", "R" is a "...
4
votes
3
answers
101
views
Print the first, last, and in-between integers of a range
Given our spec from Code Golf:
Given two integers, output the two integers, and then the range between them.
The order of the range must be the same as the input.
Examples:
...
2
votes
2
answers
4k
views
Designing a book library
Description:
Design a book library which maintains the book inventory.
The library should allow an user to favorite/un-favorite
book. The library should allow an user to rent a book for
a given ...
0
votes
2
answers
207
views
Verifying if two numbers are equal using ArrayLists
I have some question about the code below. It works correctly, but:
Is there a better/another way to solve the exercise (as an expert would have done:) or mine it's perfectly done?
Also, I don't see ...
1
vote
1
answer
756
views
Count number of leaves in binary tree
Description:
Given a binary tree find the number of leaves. Although the problem is simple and has been solved many times I am more interested in find object oriented ways to solve the algorithmic ...
10
votes
2
answers
22k
views
Parking lot OO design
I have tried to design the parking lot problem. Here is the problem statement.
Design a parking lot system where
Admin can look up all the available spots for parking,
He should be able to choose ...
2
votes
1
answer
613
views
Jesse and Cookies
Jesse loves cookies. He wants the sweetness of all his cookies to be greater than value K. To do this, Jesse repeatedly mixes two cookies with the least sweetness. ...
12
votes
2
answers
7k
views
"Merchants Guide to Galaxy" challenge
I have solved the classic "Merchants Guide to Galaxy" problem:
A merchant buys and sells items in the galaxy. Buying and selling over
the galaxy requires you to convert numbers and units. The ...
2
votes
1
answer
2k
views
Reading Input from file for sorting and rewriting
I am writing a program that reads a DAT file with names. The names are stored in an ArrayList of Type Name, the Name object can hold the first, middle and last name. Once the names are stored in the ...