Code Room
Code reviewMediumcr-g006
Subject Thread safetyLevel Mid–Senior~25 minCommon in Concurrency interviewsIndustries Software development

Question

Review this Go in-memory cache used by HTTP handlers.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewgo
type Cache struct {	data map[string][]byte} func NewCache() *Cache { return &Cache{data: map[string][]byte{}} } func (c *Cache) Get(k string) ([]byte, bool) {	v, ok := c.data[k]	return v, ok} func (c *Cache) Set(k string, v []byte) {	c.data[k] = v}
Run or narrate your approach, then ask the coach.