Cohere Coding Interview Questions
25 Cohere coding interview problems with full optimal solutions — 8 easy, 12 medium, 5 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Cohere interviewer values, and a FAQ section.
Showing 5 problems of 25
- #4hardoccasionally asked
4. Median of Two Sorted Arrays
Find the median of two sorted arrays in O(log(m+n)) time. Cohere asks this hard problem because binary search on partition boundaries is the same mathematical discipline applied to efficient percentile estimation in model evaluation pipelines.
- #23hardfrequently asked
23. Merge K Sorted Lists
Merge k sorted linked lists into one sorted list. Cohere asks this because k-way merge is the core algorithm for combining ranked results from multiple retrieval shards in a distributed RAG system — minimising latency while maintaining global ordering.
- #42hardfrequently asked
42. Trapping Rain Water
Calculate how much water can be trapped between bars after rain. Cohere asks this because the two-pointer insight — maintaining running maxima from both ends — mirrors how bidirectional attention masks are constructed in transformer architectures.
- #127hardoccasionally asked
127. Word Ladder
Find the shortest transformation sequence from one word to another, changing one letter at a time. Cohere asks this because BFS over an implicit graph is the same reasoning used to find shortest edit-distance paths between token sequences in vocabulary-constrained generation.
- #642hardoccasionally asked
642. Design Search Autocomplete System
Design a real-time autocomplete system that suggests the top-3 most frequently typed sentences matching the current prefix. Cohere asks this design-heavy hard problem because prefix-indexed retrieval with frequency ranking is the core of their enterprise search and query-suggestion products.