Count Leaves in Binary Tree
Calculate the total number of leaf nodes in a binary tree.
[1, 2, 3, 4, 5]3Pattern breakdown, verified question volume, and topic weights based on recent candidate interview reports.
Cognizant (GenC, GenC Next, and GenC Elevate tracks) assessments are commonly reported to test Quantitative and Analytical ability followed by a Coding test. The GenC Next round typically presents 2-3 medium difficulty questions covering recursion, hash sets, sliding windows, and binary search.
Calculate the total number of leaf nodes in a binary tree.
[1, 2, 3, 4, 5]3What is the worst-case time complexity of binary search on a sorted array of size n?
Given two strings s1 and s2, check if s2 is a rotation of s1 (e.g., 'ABCD' and 'CDAB').
s1='waterbottle', s2='erbottlewat'TrueAccess the complete Cognizant placement question bank, live code execution against test cases, AI-guided debugging hints, and placement readiness scores.
Pre-configures Cognizant as your target company during onboarding. Free student access.