Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Volodymyr Pavlyshyn
Volodymyr Pavlyshyn

Posted on

Open Question Coding Interviews

I deeply believe that Developers should write code on interviews.

The most critical part of the coding interview is the thinking and communication process.

So how does a person interact with you, and what kind of questions person asks?

Designing small and, most importantly, open interview challenges suitable for multiple levels is hard.

One of the interesting forms of coding interviews could be a code review.

I like this code review task from my ex-colleague.

/**** Select Last 10 Orders  */public class RecordController {  RecordRepository r;  public RecordController() {  }  public RecordController(RecordRepository repository) {    r = repository;;  }  public ArrayList<Record> get_forPage(String query) {    List<Record> l = r.findByQuery(query.toLowerCase());    ArrayList<Record> rrr = new ArrayList<>();    for (int i = 1; i < 10; i++) {      rrr.add(l.get(i));    }    Collections.sort(rrr, new RecordSorterByDateAsc());    return rrr;  }  public class RecordSorterByDateAsc implements Comparator<Record> {    public int compare(Record a, Record b) {      return b.getOrderDate().compareTo(a.getReturnDate());    }  }}
Enter fullscreen modeExit fullscreen mode

It is broken into many dimensions, from architecture and layer abstraction to the most important part.

The first question I expect to get — is what it should do.

I got so many quite interesting results out of this task

some candidates ignored the original request for code review and tried to rewrite a code,
some folks did not try to ask questions about logic, etc
The best part of this task — it is open so many cool topics to talk about

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I am big fun of ssi web5 decentralized systems
  • Location
    Berlin
  • Education
    master of systems on Chip
  • Work
    mykin.ai
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp