Visa Coding Interview Questions

Review this list of 13 Visa coding data engineer interview questions and answers verified by hiring managers and candidates.
  • Visa logoAsked at Visa 
    +16

    "We can use dictionary to store cache items so that our read / write operations will be O(1). Each time we read or update an existing record, we have to ensure the item is moved to the back of the cache. This will allow us to evict the first item in the cache whenever the cache is full and we need to add new records also making our eviction O(1) Instead of normal dictionary, we will use ordered dictionary to store cache items. This will allow us to efficiently move items to back of the cache a"

    Alfred O. - "We can use dictionary to store cache items so that our read / write operations will be O(1). Each time we read or update an existing record, we have to ensure the item is moved to the back of the cache. This will allow us to evict the first item in the cache whenever the cache is full and we need to add new records also making our eviction O(1) Instead of normal dictionary, we will use ordered dictionary to store cache items. This will allow us to efficiently move items to back of the cache a"See full answer

    Data Engineer
    Coding
    +6 more
  • Visa logoAsked at Visa 

    "Use a representative of each, e.g. sort the string and add it to the value of a hashmap> where we put all the words that belong to the same anagram together."

    Gaston B. - "Use a representative of each, e.g. sort the string and add it to the value of a hashmap> where we put all the words that belong to the same anagram together."See full answer

    Data Engineer
    Coding
    +4 more
  • +9

    "Would be better to adjust resolution in the video player directly."

    Anonymous Prawn - "Would be better to adjust resolution in the video player directly."See full answer

    Data Engineer
    Coding
    +4 more
  • Visa logoAsked at Visa 
    +20

    "Idea for solution: Reverse the complete char array Reverse the words separated by space. i.e. Find the space characters and the reverse the subarray between two space characters. vector reverseSubarray(vector& arr, int s, int e) { while (s reverseWords(vector& arr ) { int n = arr.size(); reverse(arr, 0, n - 1"

    Rahul M. - "Idea for solution: Reverse the complete char array Reverse the words separated by space. i.e. Find the space characters and the reverse the subarray between two space characters. vector reverseSubarray(vector& arr, int s, int e) { while (s reverseWords(vector& arr ) { int n = arr.size(); reverse(arr, 0, n - 1"See full answer

    Data Engineer
    Coding
    +4 more
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

  • Visa logoAsked at Visa 
    Video answer for 'Given an nxn grid of 1s and 0s, return the number of islands in the input.'
    +9

    " from typing import List def getnumberof_islands(binaryMatrix: List[List[int]]) -> int: if not binaryMatrix: return 0 rows = len(binaryMatrix) cols = len(binaryMatrix[0]) islands = 0 for r in range(rows): for c in range(cols): if binaryMatrixr == 1: islands += 1 dfs(binaryMatrix, r, c) return islands def dfs(grid, r, c): if ( r = len(grid) "

    Rick E. - " from typing import List def getnumberof_islands(binaryMatrix: List[List[int]]) -> int: if not binaryMatrix: return 0 rows = len(binaryMatrix) cols = len(binaryMatrix[0]) islands = 0 for r in range(rows): for c in range(cols): if binaryMatrixr == 1: islands += 1 dfs(binaryMatrix, r, c) return islands def dfs(grid, r, c): if ( r = len(grid) "See full answer

    Data Engineer
    Coding
    +4 more
  • Visa logoAsked at Visa 
    +9

    "class ListNode: def init(self, val=0, next=None): self.val = val self.next = next def has_cycle(head: ListNode) -> bool: slow, fast = head, head while fast and fast.next: slow = slow.next fast = fast.next.next if slow == fast: return True return False debug your code below node1 = ListNode(1) node2 = ListNode(2) node3 = ListNode(3) node4 = ListNode(4) creates a linked list with a cycle: 1 -> 2 -> 3 -> 4"

    Anonymous Roadrunner - "class ListNode: def init(self, val=0, next=None): self.val = val self.next = next def has_cycle(head: ListNode) -> bool: slow, fast = head, head while fast and fast.next: slow = slow.next fast = fast.next.next if slow == fast: return True return False debug your code below node1 = ListNode(1) node2 = ListNode(2) node3 = ListNode(3) node4 = ListNode(4) creates a linked list with a cycle: 1 -> 2 -> 3 -> 4"See full answer

    Data Engineer
    Coding
    +4 more
  • +9

    "from typing import List def maxprofitgreedy(stock_prices: List[int]) -> int: l=0 # buying r=1 # selling max_profit=0 while rstock_prices[l]: profit=stockprices[r]-stockprices[l] maxprofit=max(maxprofit,profit) else: l=r r+=1 return max_profit debug your code below print(maxprofitgreedy([7, 1, 5, 3, 6, 4])) `"

    Prajwal M. - "from typing import List def maxprofitgreedy(stock_prices: List[int]) -> int: l=0 # buying r=1 # selling max_profit=0 while rstock_prices[l]: profit=stockprices[r]-stockprices[l] maxprofit=max(maxprofit,profit) else: l=r r+=1 return max_profit debug your code below print(maxprofitgreedy([7, 1, 5, 3, 6, 4])) `"See full answer

    Data Engineer
    Coding
    +4 more
  • Visa logoAsked at Visa 
    +37

    "Arrays.sort(inputarray) sliding window with a size of 2. Check for the sum in the sliding window. subtract the start when window moves"

    Sridhar R. - "Arrays.sort(inputarray) sliding window with a size of 2. Check for the sum in the sliding window. subtract the start when window moves"See full answer

    Data Engineer
    Coding
    +5 more
  • Visa logoAsked at Visa 
    Data Engineer
    Coding
    +4 more
  • Visa logoAsked at Visa 
    +2

    "int main() { int a1[7]={1,2,3,4,5,6,7}; int a2[7]={1,9,10,11,12,13,14}; vectorv; v.insert(v.begin(),begin(a1),end(a1)); v.insert(v.begin(),begin(a2),end(a2)); int a3[v.size()]; sort(v.begin(),v.end()); for(int i=0;i<v.size();i++) { a3[i]=v[i]; } } `"

    Aryan D. - "int main() { int a1[7]={1,2,3,4,5,6,7}; int a2[7]={1,9,10,11,12,13,14}; vectorv; v.insert(v.begin(),begin(a1),end(a1)); v.insert(v.begin(),begin(a2),end(a2)); int a3[v.size()]; sort(v.begin(),v.end()); for(int i=0;i<v.size();i++) { a3[i]=v[i]; } } `"See full answer

    Data Engineer
    Coding
    +4 more
  • Visa logoAsked at Visa 
    +16

    " O(n) time, O(1) space from typing import List def maxsubarraysum(nums: List[int]) -> int: if len(nums) == 0: return 0 maxsum = currsum = nums[0] for i in range(1, len(nums)): currsum = max(currsum + nums[i], nums[i]) maxsum = max(currsum, max_sum) return max_sum debug your code below print(maxsubarraysum([-1, 2, -3, 4])) `"

    Rick E. - " O(n) time, O(1) space from typing import List def maxsubarraysum(nums: List[int]) -> int: if len(nums) == 0: return 0 maxsum = currsum = nums[0] for i in range(1, len(nums)): currsum = max(currsum + nums[i], nums[i]) maxsum = max(currsum, max_sum) return max_sum debug your code below print(maxsubarraysum([-1, 2, -3, 4])) `"See full answer

    Data Engineer
    Coding
    +4 more
  • Visa logoAsked at Visa 
    +7

    "from typing import List def traprainwater(height: List[int]) -> int: if not height: return 0 l, r = 0, len(height) - 1 leftMax, rightMax = height[l], height[r] res = 0 while l < r: if leftMax < rightMax: l += 1 leftMax = max(leftMax, height[l]) res += leftMax - height[l] else: r -= 1 rightMax = max(rightMax, height[r]) "

    Anonymous Roadrunner - "from typing import List def traprainwater(height: List[int]) -> int: if not height: return 0 l, r = 0, len(height) - 1 leftMax, rightMax = height[l], height[r] res = 0 while l < r: if leftMax < rightMax: l += 1 leftMax = max(leftMax, height[l]) res += leftMax - height[l] else: r -= 1 rightMax = max(rightMax, height[r]) "See full answer

    Data Engineer
    Coding
    +4 more
Showing 1-13 of 13