Cognizant Interview Question

Simple palendrom question and triangle using star