Trustwave On-Site Flashcards
How does Java pass a large string?
by reference, a string is a just a pointer to a sequence of characters
What style of database would you use for your Barista example?
Personally, as I think of it. Using a NoSQL database makes the most sense. Because each nested combination could be stored as a JSON object. For example each Drink has a mix. In that mix could be a count of each object. This prevents from having to create a unique id for a mix in a different database tables in a regular SQL table.
What else would you do to improve your solution?
I believe finding a way to reduce the repetitive code when accepting the input would be a start. I could check if its a number first. If not, show the error. If it is a number push it through the switch statement.
Is Java pass by reference?
Java manipulates objects by reference. You get a reference to the pointer. However, Java passes method arguments by value.
https://www.javaworld.com/article/2077424/learn-java/learn-java-does-java-pass-by-reference-or-pass-by-value.html
Write/describe/analyze an algorithm which converts binary numbers to decimals
int decimal=0,p=0;
while(n!=0) { decimal+=((n%10)*Math.pow(2,p)); n=n/10; p++; }
System.out.println(decimal);
Explain hashcode method in java
Answer
Difference between list and set, which one is ordered
Answer
What is Spring
Framework to be used in any web application with Java.
Explain REST
The set of functions that can be performed via http. GET POST. Not limited to one language
What makes an api restful
Client server relationship, client handles the front end and server handles the backend. stateless in the fact that the server doesnt store data in between requests. clients can cache responses