# DGM interview with Aida ### Check if a string is a palindrome: ```typescript const isPalindrome = (s: string): boolean => for(var i=0;i<s.length/2;i++) { if (s[i] !== s[s.length-i-1]) { return false; } } return true; ; ``` ```typescript const isPalindrome = (s: string): boolean => s.split('').reverse().join('') === s; ``` #### Test Cases ```javascript isPalindrome("aba") -> true isPalindrome("abb") -> false isPalindrome("abcca") -> false ``` ### Given an list of numbers, return the greatest number without using sort. ```typescript const greatest = (ns: number[]): number => let max_val: number = ns[0]; for (var i=0;i<ns.length;i++){ if(ns[i] > max_val) { max_val = ns[i]; } } return max_val; ; ``` ```typescript const greatest = (ns: number[]): number|undefined => ns.slice().sort()[ns.length-1]; const greatest = (ns: number[]): number|undefined => Math.max(...ns); const greatest = (ns: number[]): number|undefined => ns.reduce((m,x) => x > m ? x : m, ns[0]); ``` #### Test Cases ```javascript greatest([1,4,3,2,7,4]) -> 7 ``` ### Static analysis of glass panels ### More Question - discusison. //Thank you for the time that everyone put into this. I loved the collaboration in the team based on the interview. I'm not sure how fast you are looking to bring a new member on the team but can I start today or tomorrow? :D