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 8 problems of 25
- #1easyvery frequently asked
1. Two Sum
Given an integer array and a target, return indices of the two numbers that add up to the target. Cohere asks this as a warm-up because hash-map lookup is the foundation of embedding deduplication and nearest-neighbor retrieval at scale.
- #20easyfrequently asked
20. Valid Parentheses
Determine if a string of brackets is balanced. Cohere uses this as a warm-up to test stack reasoning — the same pattern that validates structured outputs and nested function calls in LLM inference pipelines.
- #21easyfrequently asked
21. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list. Cohere values this because the merge step is the backbone of k-way merge used when combining ranked candidate lists from multiple retrieval indexes in RAG pipelines.
- #53easyfrequently asked
53. Maximum Subarray
Find the contiguous subarray with the largest sum. Cohere asks this because Kadane's algorithm demonstrates the greedy DP reasoning that underlies attention-window selection and relevance-score aggregation in retrieval pipelines.
- #70easyfrequently asked
70. Climbing Stairs
Count distinct ways to reach the nth stair taking 1 or 2 steps at a time. Cohere uses this to gauge whether candidates recognise overlapping subproblems — a mental model critical for understanding dynamic-programming approaches in sequence modelling.
- #121easyfrequently asked
121. Best Time to Buy and Sell Stock
Find the maximum profit from a single buy-sell transaction. Cohere includes this because the running-minimum pattern mirrors how inference cost optimizers track cheapest-batch windows across fluctuating GPU pricing.
- #206easyfrequently asked
206. Reverse Linked List
Reverse a singly-linked list in place. Cohere interviewers use this to probe pointer manipulation — the same discipline required when implementing custom tokenizer chains and streaming decoder buffers.
- #283easyoccasionally asked
283. Move Zeroes
Move all zeroes to the end of an array while preserving the relative order of non-zero elements. Cohere asks this to test in-place two-pointer discipline — the same pattern used when compacting sparse token arrays in a batched inference engine.