Engenheiro De Software Java Interview Questions

3,072 engenheiro de software java interview questions shared by candidates

Write a function in Java that would accept two parameters, a string and any type of Object. The Object could have any number of fields (all public, just to simplify the question) that have any names. The string would then be written as follows: "{:name} went to {:location} to buy {:item}." Whenever you reach (without quotes) "{:something}", then you have to see if the object contains a field with the name inside (in this case, if it contains "name", "location", or "item". You would then convert it to what the object says. You can assume all fields are stored as Strings, even if they are numbers. The signature would be something like this: public static String decode(Object o, String s);. Example: Object o fields: name="Jerry", age="52", location="Walgreens", gender="male". String s: "{:name} went to {:location} to buy {:item}." Result: "Jerry went to Walgreens to buy {:item}." ({:item} never changed because the object doesn't have an item field.
avatar

Java Software Engineer

Interviewed at 1stDibs.com

3.6
Oct 19, 2016

Write a function in Java that would accept two parameters, a string and any type of Object. The Object could have any number of fields (all public, just to simplify the question) that have any names. The string would then be written as follows: "{:name} went to {:location} to buy {:item}." Whenever you reach (without quotes) "{:something}", then you have to see if the object contains a field with the name inside (in this case, if it contains "name", "location", or "item". You would then convert it to what the object says. You can assume all fields are stored as Strings, even if they are numbers. The signature would be something like this: public static String decode(Object o, String s);. Example: Object o fields: name="Jerry", age="52", location="Walgreens", gender="male". String s: "{:name} went to {:location} to buy {:item}." Result: "Jerry went to Walgreens to buy {:item}." ({:item} never changed because the object doesn't have an item field.

Viewing 411 - 420 interview questions

Glassdoor has 3,072 interview questions and reports from Engenheiro de software java interviews. Prepare for your interview. Get hired. Love your job.