CacheBox interview question

how are Semaphores implemented? , kernel threads, some DS question about tries : like implementing a dictionary.