Software Engineer • Mid-Level
Software Engineer • Mid-Level
High QualityInterview Summary
The Duolingo interview was a code-review exercise rather than a traditional algorithm round. I was given a proposed change spanning the glossary data model, Elasticsearch DAL, and API view layer, and needed to review the diff for correctness, security, performance, and maintainability issues.
The change added creation timestamps to glossary entries and introduced APIs for retrieving entries created within a specified number of days or hours. The diff intentionally contained a number of subtle bugs across multiple layers.
Interview Details
Code Review — Glossary Time-Range Retrieval
The change added a new field to the glossary model creation_timestamp. The DAL then introduced methods for fetching glossary entries created between two relative time boundaries, such as get_entries_between_days_before_today(...) and get_entries_between_hours_before_today(...). The view layer exposed corresponding endpoints and optionally allowed callers to filter the returned entries using a list of matching_ids. The task was to inspect the overall change and point out problems in the implementation.
Issue — Hard-Coded Elasticsearch Credentials
One of the most serious problems was that the new DAL method created its own Elasticsearch client and embedded connection information and credentials directly in source code. This was especially problematic because the class already received an Elasticsearch client through dependency injection. The review needed to call out both the security problem and the fact that the new code bypassed the application's existing configuration mechanism.
Issue — Incorrect Result Construction
Inside _get_elasticsearch_entries_by_time, the code initialized res = list() but then assigned a converted entry directly to res inside the loop instead of adding entries to the list. Conceptually, the code behaved like res = converted_entry rather than accumulating all returned Elasticsearch
Unlock Full Details
Create a free account to unlock this interview experience report.