• len() function returns elements that are present in the slice.
  • cap() function returns capacity of slice, which refers to the number of elements it can be accommodated.

This is one of the frequently asked go programming interview questions.

BY Best Interview Question ON 04 Apr 2020