Amazon Interview Question
Software EngineersCountry: India
Interview Type: Phone Interview
Looking for interview experience sharing and coaching?
Visit AONECODE for ONE-ON-ONE private classes by Google, Amazon engineers!
SYSTEM DESIGN
ALGORITHMS
latest Google interview questions
mock interviews.
Get the best coach and crack the interview in time.
Email us aonecoding@gmail.com with any questions. Thanks!
public class ContentCriteria implements FileCriteria {
private String content;
public ContentCriteria(String content) {
this.content = content;
}
@Override
public boolean matches(File file) {
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
String line;
while ((line = reader.readLine()) != null) {
if (line.contains(content)) {
return true;
}
}
} catch (IOException e) {
// Ignore exception
}
return false;
}
}
public class ContentCriteria implements FileCriteria {
private String content;
public ContentCriteria(String content) {
this.content = content;
}
@Override
public boolean matches(File file) {
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
String line;
while ((line = reader.readLine()) != null) {
if (line.contains(content)) {
return true;
}
}
} catch (IOException e) {
// Ignore exception
}
return false;
}
}
Looking for interview experience sharing and coaching?
- aonecode January 06, 2023Visit AONECODE.COM for ONE-ON-ONE private classes by Google, Amazon engineers!
SYSTEM DESIGN
ALGORITHMS
latest Google interview questions
mock interviews.
Get the best coach and crack the interview in time.
Email us aonecoding@gmail.com with any questions. Thanks!